Hassio latest version - Sonoff Basic several. All except one is working. Below is the one that is not working. I can turn the lights off and on from TasmoAdmin without any problems. Hassio sends the cmnd/sonoffsinklights/POWER ON or OFF command but the sonoff does not respond with a stat message and the light stays in the same state.
Here is my conf.yaml and customize.yam
- platform: mqtt
name: "sonoffsinklight"
state_topic: "stat/sonoffsinklights/POWER"
command_topic: "cmnd/sonoffsinklights/POWER"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: false
switch.sonoffsinklight:
friendly_name: Sink Light
emulated_hue_hidden: false
emulated_hue_name: sink light
icon: mdi:lightbulb-on
The following is from the log. See the cmnd but never see the stat from the device
2018-12-05 17:11:01 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/sonoffsinklights/POWER: OFF
It's almost like Hassio isn't sending the cmnd to the device.
Any help would be appreciated.
Sorry for the mistake. I had changed everything to sonoffsinklight removing the s. It still does not work. Here is a screen shot of the mqtt configuration on the sonoff.
I am looking at the hassio logs which show the string that is transmitted
2018-12-05 17:11:01 DEBUG (MainThread) [homeassistant.components.mqtt] Transmitting message on cmnd/sonoffsinklights/POWER: OFF
I did discover from the sonoff console that this basic is showing
07:30:26 MQT: Attempting connectionâŚ
07:30:26 MQT: Connect failed to 192.168.1.104:1883, rc 5. Retry in 10 sec
quite a bit of the time. I am wondering if the basic is having internal problems. I am going to try another module when I get a chance. It may be this sonoff. What has confused me is that I have no problem turning the light on and off using either a direct connection to the ip or via the TasmoAdmin add-on.
I do appreciate your looking at this and making suggestions.
He misunderstood me when I asked him to check the device mqtt topic was actually plural and he needlessly deleted the âsâ (then took the screen shot).
So now he either has to change the device topics back to plural or edit the config as you suggest.
Also have a look a the broker log. If you are using the Mosquitto addon it is below the config and network section in the hassio Mosquitto addon page. This will show you if connections to the broker from HA and the sonoff are successful.
Well it turns out that the sonoff lost the password to the mqtt broker. As you know the password is not shown when you look at the device via TasmoAdmin or via the configuration using the ip address. However, as I indicated above there were time that it would loose connection to the broker then try to reconnect. Today it failed continually so I re-entered the password and restarted it and itâs now working.
Thanks for all the help and suggestions. I might have found this faster if I had been using a sniffer so will look at setting one up.