So I have this issue that happens neraly twice a week. At my location there are power outages that last for like 2 seconds. Since I have lights that don’t support last state behaviour, they all turn on after power is restored. I wish to write an automation that will change those lights to their last known state (or just turn off those lights).
I don’t have UPS, so my server and HA also restart. I wonder how to solve this issue and have come up with this idea:
When HA turns on (some state that identifies that HA is powered on) it turns off all lights. How could I do that, so that my house doesn’t lit up? I have ikea tradfri bulbs that don’t have the “power restore” function so this is happening for them. I also have philips hue lights, that have the “power restore” function and they properly turn to their last state (mostly off) during the power restore.