Mine don’t do this. How are they configured? Mine are using the China Server and it maintains the state and in HA they show correctly across restarts. Even if I turn switch on or off HA immediately knows and shows the changed state. Same with the Yeelights on Singapore Server.
@kostya you are correct! It works for those with no N line and doesn’t work with those with N line, which most of my switches are in that type … thanks for that!
I wonder why no one complained about it before (or my search skill aren’t that good:)) I would’ve just bought only the non-N line versions.
What I’m thinking to do now is to try to set up simple automations to work around that “situation”:
add an input Boolean component per switch and create automation to mimic status of the switch (status update works fine for me, only the init state is always off)
Input Boolean does preserve its state after restart
add an automation that runs once upon hass startup to restore switch status from the input Boolean value
I haven’t tested that and a bit worried if the second automation mike cause a loop, will try to test that later tonight.
Quick update: the hack described above works! it might be one of the dirtiest hacks but it does work for me
It won’t cover cases when someone changes switch state while HASS is down but it is better than nothing