Restart required
The Restart required condition passes while Home Assistant needs 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 run a routine only while a restart is pending, like a nightly restart that only happens when one is needed. To hold off a routine while a restart is pending instead, wrap this condition in a Not condition.
Using this condition from the user interface
If you prefer building automations visually, Home Assistant walks you through this condition step by step. You pick what to check, tweak a few options, and save. No YAML knowledge required.
To use this condition in an automation:
- Go to Settings > Automations & scenes.
- Open an existing automation, or select Create automation > Create new automation.
- In the And if section, select Add condition.
- From the search box, search for and select Restart required.
- Select Save.
Using this condition 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 condition under options. Keep target, if the condition uses one, and general settings such as alias and enabled at the top level, next to condition.
In YAML, refer to this condition as homeassistant.restart_required. It has no options:
condition: homeassistant.restart_required
This passes while a restart is pending.
Good to know
- The restart stays pending until Home Assistant restarts. Nothing else clears it.
- To act the moment a restart becomes pending, use the Restart required trigger.
Try it yourself
Ready to test this? Go to Settings > Automations & scenes, open an automation, and add this condition. Trigger the automation with and without the condition met, and watch whether it continues or stops.
More examples
Real scenarios where this condition gates an automation. Copy any example and adapt it to your setup. In the visual editor, select the UI options listed in the example 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: restart at night when needed
Every night at 4:00, restart Home Assistant, but only when a restart is pending.
-
Trigger: Time
- At time: 4:00:00 AM
- Condition: Restart required
- Action: Restart Home Assistant
YAML example for a nightly restart
alias: "Restart at night when needed"
triggers:
- trigger: time
at: "04:00:00"
conditions:
- condition: homeassistant.restart_required
actions:
- action: homeassistant.restart
Still stuck?
To find out why the condition didn’t pass, check it live in the automation editor, and look at the trace of the run. 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 condition 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 conditions or suggest the right one when you describe what you want in plain language.
Related conditions
Explore related conditions:
- Host reboot required: Tests if the host needs a reboot to apply installed updates or changed settings.