How are you shutting down HA? I’ve noticed the only way to get any kind of consistency using the ‘Shutdown’ trigger is when shutting down HA from-within HA.
NOTE: I run HA inside VirtualBox on Windows so YMMV.
I looks like only notify actions are executed when the shutdown event is triggered.
I’ve added some additional automations for testing. All automations has been triggered and I received all notifications. But the input_booleans hasn’t been turned off.
And although the notifications has all been sent the automation overview shows all the automations as never triggered.
I know this is an old post. I will say that I too wanted a work around for myself. So I was thinking why not generate the TTS file ahead of time. Copy it to where the rest of your media is stored and play it like the other sound files. I think the problem is tts itself is not able to receive the file because the system is being shutdown. But if your other sounds work then you can still cast before shutdown has completed. Just a thought, I’m going to try this myself and get back to you!
I also have been wondering if the reason for shutdown is logged and whether or not it could be included in the message.
Just as my previous speaker, I also know that this is an old post.
But for me too, automations listening to the shutdown event are not triggered. I’m trying to set an input boolean prior to shutdown so I know whether HA has been shutdown properly or by a power outage.
Not sure if this is indented behaviour. I would assume that HA would wait for automations that depend on this event to finish before actually beginning the shutdown process. (Maybe add a time threshold so automations cannot block the shutdown indefinitely)
If anyone else has a similar need, you can create a Trigger-based Template Sensor that indicates, on startup, whether Home Assistant had been shutdown properly or had been interrupted (such as by a power outage).
There’s no need to use a Time Pattern Trigger to repeatedly update an Input Datetime every 30 seconds. All that’s required is to detect the homeassistant_stop and homeassistant_started events using a single Trigger-based Template Sensor (see linked example posted above).
A Trigger-based Template Sensor and one automation
versus
A Template Binary Sensor, two automations and an Input Datetime
Probably right, I gave it a go and it seems to be working for the shutdown case, I’ll give it a go and do a real-life simulation tomorrow, thanks for insisting @123
I’m the OP of this thread. My shutdown notification from my original post (quoted above) has started working again today, after updating to Home Assistant OS 11.2 (from 10.5)