Tasmozed Sonoff topics


#1

I’m having trouble setting up correct topics in the configurator.yaml. I was able to make switch show up, but could not control it via hassio, after few seconds off turning it on it went back to off position even tho it was on in tasmota.
My tasmota console:

00:00:00 Project sonoff Sonoff (Topic sonoffhall, Fallback DVES_E4F33A3A, GroupTopic sonoffs) Version 6.4.0(sonoff)-2_5_0_BETA1
00:00:00 WIF: Connecting to AP1 Kaunas in mode 11N as sonoffhall-4922…
00:00:04 WIF: Connected
00:00:04 DNS: Initialized
00:00:04 HTP: Web server active on sonoffhall-4922.local with IP address 192.168.0.28
19:32:12 MQT: Attempting connection…
19:32:13 MQT: Connected
19:32:13 MQT: tele/sonoffhall/LWT = Online (retained)
19:32:13 MQT: cmnd/sonoffhall/POWER =
19:32:13 MQT: tele/sonoffhall/INFO1 = {“Module”:“Sonoff Basic”,“Version”:“6.4.0(sonoff)”,“FallbackTopic”:“DVES_E4F33A3A”,“GroupTopic”:“sonoffs”}
19:32:13 MQT: tele/sonoffhall/INFO2 = {“WebServerMode”:“Admin”,“Hostname”:“sonoffhall-4922”,“IPAddress”:“192.168.0.28”}
19:32:13 MQT: tele/sonoffhall/INFO3 = {“RestartReason”:“Software/System restart”}
19:32:13 MQT: stat/sonoffhall/RESULT = {“POWER”:“ON”}
19:32:13 MQT: stat/sonoffhall/POWER = ON
19:32:13 MQT: stat/sonoffhall/RESULT = {“POWER”:“ON”}
19:32:13 MQT: stat/sonoffhall/POWER = ON
19:32:13 MQT: stat/sonoffhall/RESULT = {“POWER”:“ON”}
19:32:13 MQT: stat/sonoffhall/POWER = ON
19:32:21 MQT: tele/sonoffhall/STATE = {“Time”:“2019-01-14T19:32:21”,“Uptime”:“0T00:00:15”,“Vcc”:3.552,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“ON”,“Wifi”:{“AP”:1,“SSId”:“Kaunas”,“BSSId”:“A0:BD:CD:00:4A:DA”,“Channel”:11,“RSSI”:34}}
19:32:21 MQT: tele/sonoffhall/SENSOR = {“Time”:“2019-01-14T19:32:21”,“Switch1”:“ON”}

My switch.yaml

platform: mqtt
name: "Sonoff01"
command_topic: "cmnd/sonoffhall/POWER"
state_topic: "stat/sonoffhall/RESULT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true

Also, what is needed after I edit my switch.yaml or configuration.yaml to take effect. I perform “Restart Hass”. Is there any quicker way?


#2

You don’t need any setup if you use discovery. Just do it.


#3

Should be ‘stat/sonoffhall/POWER’


#4

Discovery worked fine for my sonoff basic, but not for my sonoff TH. It shows up on hassio as unavaliable.
My sonoff basic console:

17:12:27 MQT: sonoffhall/tele/STATE = {“Time”:“2019-01-17T17:12:27”,“Uptime”:“0T00:00:14”,“Vcc”:3.552,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“ON”,“Wifi”:{“AP”:1,“SSId”:“Kaunas”,“BSSId”:“A0:BD:CD:00:4A:DA”,“Channel”:11,“RSSI”:36}}
17:12:27 MQT: sonoffhall/tele/SENSOR = {“Time”:“2019-01-17T17:12:27”,“Switch1”:“ON”}
17:13:27 CMD: SetOption19 1
17:13:27 MQT: homeassistant/light/E4F33A_LI_1/config = (retained)
17:13:27 MQT: homeassistant/switch/E4F33A_RL_1/config = {“name”:“Sonoff”,“command_topic”:“sonoffhall/cmnd/POWER”,“state_topic”:“sonoffhall/tele/STATE”,“value_template”:"{{value_json.POWER}}",“payload_off”:“OFF”,“payload_on”:“ON”,“availability_topic”:“sonoffhall/tele/LWT”,“payload_available”:“Online”,“payload_not_available”:“Offline”} (retained)
17:13:27 MQT: homeassistant/light/E4F33A_LI_2/config = (retained)
17:13:27 MQT: homeassistant/switch/E4F33A_RL_2/config = (retained)
17:13:27 MQT: homeassistant/light/E4F33A_LI_3/config = (retained)
17:13:27 MQT: homeassistant/switch/E4F33A_RL_3/config = (retained)
17:13:27 MQT: homeassistant/light/E4F33A_LI_4/config = (retained)
17:13:27 MQT: homeassistant/switch/E4F33A_RL_4/config = (retained)
17:13:27 MQT: homeassistant/light/E4F33A_LI_5/config = (retained)
17:13:27 MQT: homeassistant/switch/E4F33A_RL_5/config = (retained)
17:13:27 MQT: homeassistant/light/E4F33A_LI_6/config = (retained)
17:13:27 MQT: homeassistant/switch/E4F33A_RL_6/config = (retained)
17:13:27 MQT: homeassistant/light/E4F33A_LI_7/config = (retained)
17:13:27 MQT: homeassistant/switch/E4F33A_RL_7/config = (retained)
17:13:27 MQT: homeassistant/light/E4F33A_LI_8/config = (retained)
17:13:27 MQT: homeassistant/switch/E4F33A_RL_8/config = (retained)
17:13:27 MQT: sonoffhall/stat/RESULT = {“SetOption19”:“ON”}

When I put SetOption19 1 in sonoff th console it restarts and won’t display same text as basic

00:00:00 Project sonoffTH16 Sonoff (Topic sonoffth, Fallback DVES_432CA7A7, GroupTopic sonoffs) Version 6.4.0(sonoff)-2_5_0_BETA2
00:00:00 WIF: Connected
00:00:00 DNS: Initialized
00:00:00 HTP: Web server active on sonoffth-3239.local with IP address 192.168.0.29
00:00:01 MQT: Attempting connection…
00:00:01 MQT: Connected
00:00:01 MQT: tele/sonoffth/LWT = Online (retained)
00:00:01 MQT: cmnd/sonoffth/POWER =
00:00:01 MQT: tele/sonoffth/INFO1 = {“Module”:“Sonoff TH”,“Version”:“6.4.0(sonoff)”,“FallbackTopic”:“DVES_432CA7A7”,“GroupTopic”:“sonoffs”}
00:00:01 MQT: tele/sonoffth/INFO2 = {“WebServerMode”:“Admin”,“Hostname”:“sonoffth-3239”,“IPAddress”:“192.168.0.29”}
00:00:01 MQT: tele/sonoffth/INFO3 = {“RestartReason”:“Software Watchdog”}
00:00:01 MQT: stat/sonoffth/RESULT = {“POWER”:“ON”}
00:00:01 MQT: stat/sonoffth/POWER = ON
18:29:40 MQT: tele/sonoffth/STATE = {“Time”:“2019-01-18T18:29:40”,“Uptime”:“0T00:00:10”,“Vcc”:3.531,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“ON”,“Wifi”:{“AP”:1,“SSId”:“Kaunas”,“BSSId”:“A0:BD:CD:00:4A:DA”,“Channel”:11,“RSSI”:50}}
18:29:40 MQT: tele/sonoffth/SENSOR = {“Time”:“2019-01-18T18:29:40”,“SI7021”:{“Temperature”:17.1,“Humidity”:72.3},“TempUnit”:“C”}