I doing my very first steps with HA, and after first automation ( witch works fine and It’s not related) I discovered when I doing some changes in configuration and restarting the HA service, the light state are wrong - some lights are turned ON however the web shows that all lights is OFF. I using sonoff basic module.
module described :
I tracked the mqtt as well- and same module send after every 5 minutes state information: tele/suurtuba_laualamp/STATE {"Time":"2017-10-26T09:53:16", "Uptime":36, "Vcc":3.182, "POWER":"OFF", "Wifi":{"AP":1, "SSId":"HAWiFi", "RSSI":78, "APMac":"36:A4:3C:09:DF:63"}}.
But the state on UI (classical default) stays the same (“OFF”)
Edit:
Actually, reading your post again, it looks like this is a general status message, rather than a response to the command. If your light is working normally, have you set the sonoff to send the state message with the retain flag set? That will cause the mqtt broker to store the state of the last message and send to it HA when it reconnects.
Wou thanks, PowerRetain 1 is the magic “word” - for the beginners ( like me) one more thing, after you add the PowerRetain 1 from commend lines to your sonoff, You must at least once change the status of switch, then the add command activating or adding necessary lines on state command.