Restart required
The Restart required trigger fires when Home Assistant starts needing a restart, for example after you installed an update of a custom integration, or changed a setting that only applies after a restart.
Use it to know about it without opening Home Assistant, for example to send a notification to your phone, so you can restart at a moment that suits you.
Using this trigger from the user interface
If you prefer building automations visually, Home Assistant walks you through this trigger step by step. You pick what to watch, tweak a few options, and save. No YAML knowledge required.
To use this trigger in an automation:
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- In the When section, select Add trigger.
- From the search box, search for and select Restart required.
- Select Save.
Using this trigger in YAML
If you work directly in YAML, or you want to know exactly what Home Assistant does under the hood, this section has the technical reference. It lists the field names you use in YAML, their types, and which ones are required. For how an automation is built in YAML, refer to Automations in YAML.
In YAML, put the settings that are specific to this trigger under options. Keep target, if the trigger uses one, and general settings such as id, alias, enabled, and variables at the top level, next to trigger.
When this trigger starts an automation, it passes data about what happened to the automation. You can use this trigger data in the templates of your conditions and actions. To see which data is available, refer to Trigger data in templates.
In YAML, refer to this trigger as homeassistant.restart_required. It has no options:
trigger: homeassistant.restart_required
In templates, trigger.sources holds the integrations that asked for the restart when the trigger fired, such as ["hacs"].
Trigger variables
When the trigger reacts, the trigger variable contains the following data:
-
trigger.sources: List of the integrations that asked for a restart, by their domain, in alphabetical order.
For the data that all triggers include, refer to Trigger data in templates.
Good to know
- The trigger fires once, when the first integration asks for a restart. More integrations asking after that do not fire it again, because the restart is already pending.
- The restart stays pending until Home Assistant restarts. Nothing else clears it.
- If a restart was already pending when the automation was turned on, the trigger does not fire for it. To check for a pending restart, use the Restart required condition.
- If the host needs a reboot, use the Host reboot required trigger. A reboot restarts Home Assistant as well.
Try it yourself
Ready to test this? Go to Settings > Automations & scenes, create a new automation, and add this trigger. Save the automation, and then make the trigger react. For example, change the state of the targeted entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], turn on a light that the trigger monitors, or change its brightness. To check whether the automation ran, open its traces.
For this trigger, there is no target entity to change. To test it, install an update that needs a restart, or temporarily switch to a trigger you can control while you build the rest of the automation.
More examples
Real scenarios where this trigger fires in automations and scripts. Copy any example and adapt it to your setup. In the visual editor, select the UI options listed in the example when they are available, or paste the YAML code.
You don’t need to edit YAML to use these examples. Copy a YAML snippet from this page, open the visual automation editor in Home Assistant, and press Ctrl+V (or Cmd+V on Mac). Home Assistant automatically converts the pasted YAML into the visual editor format, whether it’s a full automation, a single trigger, a condition, or an action.
Automation: notify when a restart is needed
When Home Assistant needs a restart, send a notification with the integrations that asked for it.
- Trigger: Restart required
-
Action: Send a notification message
-
Target: My Device (
notify.my_device)
-
Target: My Device (
YAML example for a restart notification
alias: "Notify when a restart is needed"
triggers:
- trigger: homeassistant.restart_required
actions:
- action: notify.send_message
target:
entity_id: notify.my_device
data:
message: "Home Assistant needs a restart for: {{ trigger.sources | join(', ') }}"
Still stuck?
To find out why the trigger didn’t react, make the change that it should react to, and then open the traces of the automation. If the automation didn’t run, there’s usually no trace, but some triggers record a Did not trigger trace. For details, refer to Testing automations. For common problems and their solutions, refer to Troubleshooting automations.
If that doesn’t help, the Home Assistant community is quick to help: join Discord for real-time chat, post on the community forum with the trigger you’re using and what you expected to happen, or share on our subreddit /r/homeassistant.
AI assistants like ChatGPT or Claude can also explain triggers or suggest the right one when you describe what you want in plain language.
Related triggers
Explore related triggers:
- Host reboot required: Triggers when the host needs a reboot to apply installed updates or changed settings.