I have a shell_command
for adjusting my CPU cases RGB lighting and a Home Assistant script
that toggles my monitor power and speaker power on/off together with a delay to avoid any feedback hum…
Everything works great, except when I reboot Home Assistant… and since apparently I’m addicted to changing my Home Assistant configuration, rebooting Home Assistant seems to happen fairly often for me.
During each reboot, the current state of the switch
is lost.
I saw this post showing the use of a command_state:
command to inspect state, but I also saw a note in the Home Assistant documentation that the state
function should not be used to connect to the network - it’s expected to be a low latency function.
How do you preserve the state of switches that are based on shell_command
s and script
s across reboots?
Or at least is there some HA Startup Hook to run a script once after reboot and load the current state of those entities?