I used sonoff with tasmota firmware to automate my light switch. Problem is it randomly turn on without any manual or automated trigger. Log just simply showed “front porch turned on” . I m somewhat new to HA, familiar with few linux commands but not quite know how to debug this problem.
I’d use a MQTT monitor (mosquitto_sub in a session if you’re using a Pi or similar) and subscribe to the cmnd/sonoff3/power topic and make sure nothing is actually commanding switch on.
Just some ideas. Just me but I usually keep my MQTT topics grouped so I’d have something like lights/sonoff3/power and lights/sonoff/state so I could just monitor the lights/sonoff/# topic and see all the action. Just me though.
The mosquitto_sub command should be like mosquitto_sub -h -v -t “//#” to monitor the topic and one down the topic tree.
Back to ghost switch issue, according to Dr.Zzs it could be electrical interference on the wire that could trigger “pushbutton” randomly. Some user also suggested to over come that by setting sonoff to “hold” for amount of time before fire a command. Through sonoff web console you can set following:
I tried but not sure how to test this. After setting SetOption32 to a larger value , e.g. 40 (i.e. 4 sec) I fired mqtt power on command, the switch was ON right away. i.e. it did not wait for 4sec… Has anyone try to tweak any of those setting above and could explain how it works?