Flashing Itead Sonoff devices via original OTA mechanism!!! WORKS!!!
After a lot of search, I could find this excellent project to change the firmware to this switch lx-wifi-03o without soldering nothing !!!
This is a script to update a Sonoff device from the stock firmware to Sonoff-Tasmota purely over WiFi.
I used Console” and entered the command " PowerRetain 1 " as suggested still after restart it is not showing correct on off state. The Switch code I am using is
I’m using the broker in Hassio.
I did have to set the power retain in the console. I have found that if my router restarts that the switch will turn on when it reconnects which is a nuisance but only happened once… but if I restart home assistant, it stays on or off and HA shows the correct state.
OK. May be I give the built in MQTT a go and not the Mosquito add-on. In this discussion they claim that it is a problem with built in MQTT but add on work. But for me Add on MQTT (mosquito) does not work
That looks correct, make sure your MQTT broker is setup to allow persistence. You really don’t need the retain on the HA side, in some rare cases it could get out of sync, but absolutely the powerretain on the Tasmota console is key to the state of the switch staying.
I agree, flashing is a pain, I have 10 devices and only flashed four, one does not work at all and the other three work on the Sonoff GUI but not not work with HA without problems. I had many, many people to tell me to change my MQTT logic, did it and still have the problems.