Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

statetext invert - 6.20 not working #3656

Closed
timtimsson opened this issue Aug 31, 2018 · 4 comments
Closed

statetext invert - 6.20 not working #3656

timtimsson opened this issue Aug 31, 2018 · 4 comments
Labels
bug Type - Confirmated Bug fixed Result - The work on the issue has ended

Comments

@timtimsson
Copy link

i use my switchbutton inverse - now it work with 6.2.0, but status 0 dosnt work...

MQT: /ESP_02/stat/RESULT = {"StateText1":"1"}
MQT: /ESP_02/stat/RESULT = {"StateText2":"0"}

CMD: status 0
MQT: /ESP_02/stat/STATUS1 = {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoff4096","OtaUrl":"http://10.1.1.......
only status1

@ascillato
Copy link
Contributor

ascillato commented Aug 31, 2018

Hi,

Confirmed. Status 0 don't work when statetext1 1 and statetext2 0

Console Output:

00:00:00 Proyecto sonoff Sonoff (Topic Living, Fallback DVES_591719, GroupTopic sonoffs) Versión 6.2.0-2_4_2
00:00:00 WIF: Connectando a AP1 NetWireless en modo 11N como Living-5913...
00:00:04 WIF: Conectado
00:00:04 HTP: Servidor web activo en Living-5913 con dirección IP 192.168.1.33
00:00:06 MQT: Intentando conectar...
20:18:13 MQT: Conectado
20:18:13 MQT: tele/Living/LWT = Online (Grabado)
20:18:13 MQT: cmnd/Living/POWER = 
20:18:13 MQT: tele/Living/INFO1 = {"Module":"Generic","Version":"6.2.0","FallbackTopic":"DVES_591719","GroupTopic":"sonoffs"}
20:18:13 MQT: tele/Living/INFO2 = {"WebServerMode":"Admin","Hostname":"Living-5913","IPAddress":"192.168.1.33"}
20:18:13 MQT: tele/Living/INFO3 = {"RestartReason":"Software/System restart"}
20:18:13 MQT: stat/Living/RESULT = {"POWER":"OFF"}
20:18:13 MQT: stat/Living/POWER = OFF
20:18:21 CMD: status 0
20:18:21 MQT: stat/Living/STATUS = {"Status":{"Module":18,"FriendlyName":["Sonoff"],"Topic":"Living","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"SaveData":1,"SaveState":1,"ButtonRetain":0,"PowerRetain":0}}
20:18:21 MQT: stat/Living/STATUS1 = {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://sonoff.maddox.co.uk/tasmota/sonoff.bin","RestartReason":"Software/System restart","Uptime":"0T00:00:18","StartupUTC":"2018-08-31T23:18:03","Sleep":0,"BootCount":4,"SaveCount":9,"SaveAddress":"3FB000"}}
20:18:21 MQT: stat/Living/STATUS2 = {"StatusFWR":{"Version":"6.2.0","BuildDateTime":"2018-08-31T20:13:59","Boot":31,"Core":"2_4_2","SDK":"2.2.1(cfd48f3)"}}
20:18:21 MQT: stat/Living/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["NetWireless","NetWireless"],"TelePeriod":300,"SetOption":["00008009","55818000","00000000"]}}
20:18:21 MQT: stat/Living/STATUS4 = {"StatusMEM":{"ProgramSize":487,"Free":2584,"Heap":18,"ProgramFlashSize":4096,"FlashSize":4096,"FlashMode":3,"Features":["00002C0A","1F80A984","0C0003B0","23021796","00000000"]}}
20:18:21 MQT: stat/Living/STATUS5 = {"StatusNET":{"Hostname":"Living-5913","IPAddress":"192.168.1.33","Gateway":"192.168.1.1","Subnetmask":"255.255.255.0","DNSServer":"192.168.1.1","Mac":"60:01:94:59:17:19","Webserver":2,"WifiConfig":5}}
20:18:21 MQT: stat/Living/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.1.2","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_591719","MqttUser":"homeassistant","MqttType":2,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}}
20:18:21 MQT: stat/Living/STATUS7 = {"StatusTIM":{"UTC":"Fri Aug 31 23:18:21 2018","Local":"Fri Aug 31 20:18:21 2018","StartDST":"Sun Mar 25 02:00:00 2018","EndDST":"Sun Oct 28 03:00:00 2018","Timezone":-3,"Sunrise":"07:55","Sunset":"19:08"}}
20:18:21 MQT: stat/Living/STATUS10 = {"StatusSNS":{"Time":"2018-08-31T20:18:21"}}
20:18:21 MQT: stat/Living/STATUS11 = {"StatusSTS":{"Time":"2018-08-31T20:18:21","Uptime":"0T00:00:18","Vcc":2.993,"POWER":"OFF","Wifi":{"AP":1,"SSId":"NetWireless","RSSI":50,"APMac":"18:D6:C7:80:38:2C"}}}
20:18:22 MQT: tele/Living/STATE = {"Time":"2018-08-31T20:18:22","Uptime":"0T00:00:19","Vcc":2.993,"POWER":"OFF","Wifi":{"AP":1,"SSId":"NetWireless","RSSI":56,"APMac":"18:D6:C7:80:38:2C"}}
20:19:07 CMD: StateText1
20:19:07 MQT: stat/Living/RESULT = {"StateText1":"OFF"}
20:19:11 CMD: StateText2
20:19:11 MQT: stat/Living/RESULT = {"StateText2":"ON"}
20:19:23 CMD: StateText1 1
20:19:23 MQT: stat/Living/RESULT = {"StateText1":"1"}
20:19:26 CMD: StateText2 0
20:19:26 MQT: stat/Living/RESULT = {"StateText2":"0"}
20:19:32 CMD: status 0
20:19:32 MQT: stat/Living/STATUS1 = {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://sonoff.maddox.co.uk/tasmota/sonoff.bin","RestartReason":"Software/System restart","Uptime":"0T00:01:29","StartupUTC":"2018-08-31T23:18:03","Sleep":0,"BootCount":4,"SaveCount":11,"SaveAddress":"3F9000"}}

@ascillato2 ascillato2 added the bug Type - Confirmated Bug label Aug 31, 2018
@timtimsson
Copy link
Author

... i chanched my switchmode - thats ok for me...

@arendst
Copy link
Owner

arendst commented Sep 1, 2018

Ah nice one...

To get status 0 output you need to execute command status 1

To get status 1 output you need to execute command status 0

Considering this workaround it will be fixed in next release.

@arendst arendst added the good tip Type - Very useful information label Sep 1, 2018
arendst added a commit that referenced this issue Sep 2, 2018
Fix possible ambiguity on command parameters if StateText contains numbers only (#3656)
@arendst arendst added fixed Result - The work on the issue has ended and removed good tip Type - Very useful information labels Sep 2, 2018
@arendst
Copy link
Owner

arendst commented Sep 2, 2018

The issue as noted has been solved by removing the possibility of allowing StateText as input to a command parameter.

  • StateText1 is the text used for a device that is turned off
  • StateText2 is the text used for a device that is turned on

If a user configures StateText1 as "1" and StateText2 as "0" be prepared to see messages like

11:08:46 CMD: power 0
11:08:46 MQT: stat/ring2/POWER = {"POWER":"1"}
11:08:46 MQT: stat/ring2/POWER = 1
11:08:50 CMD: power 1
11:08:50 MQT: stat/ring2/POWER = {"POWER":"0"}
11:08:50 MQT: stat/ring2/POWER = 0

for the simple reason that the command power 0 wants to turn off power and user configured the resulting text as "1".

arendst added a commit that referenced this issue Sep 5, 2018
Version 6.2.1 20180905
 * Fix possible ambiguity on command parameters if StateText contains numbers only (#3656)
 * Fix Wemo emulation to select the first relay when more than one relay is present (#3657)
 * Fix possible exception due to buffer overflow (#3659)
 * Fix lost energy today and total energy value after power cycle (#3689)
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 7, 2018
Version 6.2.1 20180905
 * Fix possible ambiguity on command parameters if StateText contains numbers only (arendst#3656)
 * Fix Wemo emulation to select the first relay when more than one relay is present (arendst#3657)
 * Fix possible exception due to buffer overflow (arendst#3659)
 * Fix lost energy today and total energy value after power cycle (arendst#3689)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type - Confirmated Bug fixed Result - The work on the issue has ended
Projects
None yet
Development

No branches or pull requests

4 participants