How do I trigger a notification/ automation when a Restart is required?
My HA is running smooth and I automatic update my add-on, ESPhome devises and as much as I can.
I know this is not popular , but for automation to work, I don’t want to do a lot of admin work to reading release notes, doing updates and restarts.
These events are fired during the startup of Home Assistant, in the following order:
homeassistant_start
homeassistant_started
These events contain no additional data.
If you want to trigger automation on a Home Assistant start event, we recommend using the special Home Assistant trigger instead of listening to these events.
{{
states.update |
selectattr('attributes.release_summary','eq','<ha-alert alert-type=\'error\'>Restart of Home Assistant required</ha-alert>') |
list | count
}}
and use that turning on as a trigger or condition
here’s my automation
alias: Restart Home Assistant
description: ""
trigger:
- platform: time
at: "00:15:00"
condition:
- condition: state
entity_id: binary_sensor.restart_required
state: "on"
action:
- service: homeassistant.restart
data: {}
mode: single