Any way to set correct state of switches on boot based on automation config?

I have a series of switches which turn lights on and off using the automation control which are time and sun based.

This all works fine when the system is running continuously, but if I restart the HA service, triggers which have passed but whose action would still be active do not run.

Is there any way for HA to enumerate automation config to set the correct state of switches at startup so that switches are put into their correct state?

AppDaemon now comes with an example App that will reset switches to the previous state when HA is restarted. In addition, or as an alternative, it is better suited to the complex logic you might need to perform to reconstruct the previous state based on various sensors, time of day or whatever else.

Haven’t seen AppDaemon before. I’ll have a look.

Thanks!

1 Like

Did you figure this issue up?
I’m having a similar problem with Z-wave thermostat, they all boot up to random values…and something trigger my AC cooling when is not needed.