Hi, as I am sometimes updating/restarting homeassistant when I am not at home (e.g. on a business trip) I’d like to turn on a red light to indicate that HA is down. This would take away some confusion on “User Two” when she is trying to control something but HA is not responding.
I already got it working, that the light turns green and after 2 seconds off again when HA comes back up. Implemented this using Appdaemon like this.
To avoid Appdaemon not catching the homeassistant “shutdown” event I implemented the “Turn light red” automation directly in HA automations but it is not triggering.
Do you guys have any idea what I am missing? Automation works when I trigger it manually.
I have to say I’ve not had that automation run for a while now and the automation just plays a sound so I’ve not really looked into it, plus I’ve moved to docker and restart my docker when I need to restart HA (which I know if a bit overkill) so I guess the docker will be taken down before HA has the chance to run that automation…
I’m running docker too. I really don’t know why I have thought stopping the docker container would trigger a gracefull shutdown of homeassistant. Or does it?
I don’t know. It used to work when I was not using docker.
I’ve not tried to stop HA from within the container to see if that works, I guess it’s worth a try to potentially take docker out of the equation
If you stop a docker container without first shutting down HA you are essentially pulling the power plug. HA does not get the signal to gracefully shut down.
I suggest you stop HA before stopping the docker container.
If that still doesn’t resolve your issue you could create a toggle that you flip to turn on the light, then restart HA, and have HA turn off the toggle on start.
I am thinking of what the best way forward is here.
I already have a script for restarting the HA container. I am thinking to just include a curl call against HA to turn on the light before restarting the container.
Does anybody have a nice way in mind?
You might need some extra hardware, but might I suggest a sort of “dead man’s switch”? basically as long as HA is running, it’s sending a signal to something else that is controlling a red light. If that device gets the signal within a reasonable amount of time (say 30 seconds) then it keeps the light off and restarts the timer. As soon as the hardware detects the signal has been lost, it turns on the red light until it starts receiving the signal again.
as far as I remember you can access/control your tasmota device via it’s IP address on a web browser. It should be easy to have a script running somewhere that “pings” HA and then turns the red light on when no answer?