Scheduled Home Assistant Reboots — Why, When, and How
- Andrea Leandri
- Jun 30
- 4 min read
Skill level: Beginner | Time to complete: 10-15 minutes
What you'll build: A simple automation that reboots your HA Green automatically once a night, at a time when nobody is using the house - keeping memory usage in check and clearing out small glitches before they become real problems.
Do You Actually Need This?
Before setting this up, it is worth being honest about what a scheduled reboot does and does not fix.
What a regular reboot helps with: memory creep from integrations with small memory leaks, stuck WebSocket connections to cloud services that occasionally hang silently, Zigbee/Z-Wave coordinator state getting slightly out of sync after weeks of uptime, and general gremlins that build up over time.
What it does NOT fix: a misconfigured automation that is genuinely broken (rebooting just delays noticing the problem), a failing SD card or storage device (frequent reboots add wear if anything), and integration bugs that reproduce immediately on every restart.
If your HA instance runs for weeks without any noticeable slowdown, you do not strictly need this. But for most home setups running many integrations and custom components, a nightly reboot is a cheap insurance policy that takes under a minute and happens while you are asleep.
What You'll Need
Home Assistant OS (HA Green, Raspberry Pi with HA OS, etc.) - the hassio.host_reboot service is specific to HA OS / Supervisor-based installs
HA Companion App (optional but recommended) - for a confirmation notification after each reboot
Important distinction: this guide uses hassio.host_reboot, which reboots the entire host machine, not just the Home Assistant Core software. If you are running HA Container or HA Core without Supervisor, this service is not available - use homeassistant.restart instead, which restarts just the Core process.
Picking a Good Time
The automation reboots at 02:05 AM - deliberately not exactly on the hour, and deliberately in the dead of night. Not midnight exactly, since many other automations and integrations run scheduled tasks at midnight (daily statistics resets, cloud sync jobs) and avoiding the exact hour reduces the chance of interrupting something mid-task. Early hours rather than evening, since a reboot takes HA offline for roughly 1-3 minutes - harmless at 2 AM, annoying if it happens mid-evening. And consistent timing makes it predictable: if something looks odd in your logs, you immediately know it is around the nightly reboot.
The Automation
Settings → Automations & Scenes → Create Automation → Edit in YAML:
alias: "Home Assistant nightly reboot"
description: >
Reboots the HA host every night at 02:05 to keep memory usage
and system state healthy. Takes 1-3 minutes.
triggers:
- trigger: time
at: "02:05:00"
conditions: []
actions:
- action: hassio.host_reboot
data: {}
mode: singleThat is the whole thing - three lines of actual logic. Save it and it runs every night automatically.
Adding a Pre-Reboot Notification
A silent nightly reboot is fine until the one night something actually goes wrong. A simple notification beforehand costs nothing and gives you visibility:
alias: "Home Assistant nightly reboot"
description: >
Reboots the HA host every night at 02:05.
Sends a notification beforehand.
triggers:
- trigger: time
at: "02:05:00"
conditions: []
actions:
- action: notify.mobile_app_iphone_andrea # replace with your device
data:
title: "Nightly HA reboot"
message: "Home Assistant is rebooting now. Back in 1-3 minutes."
- delay:
seconds: 5
- action: hassio.host_reboot
data: {}
mode: singleThe 5-second delay before the actual reboot ensures the notification has time to leave HA and reach your phone before the host goes offline - without it, there is a small chance the reboot starts before the notification finishes sending.
Test It Carefully
Settings → Automations → your reboot automation → Run. Do this once, during the day, when you are at the computer and can watch what happens. HA will go offline for 1-3 minutes and come back automatically. If you have the notification step, confirm it arrives before the reboot happens.
Do not skip this test. It is much better to discover a typo or misconfigured service call during a daytime test than to find out at 2 AM that something is wrong and you cannot access HA until you physically check on it.
The next morning, check Settings → System → Logs and look for a system restart event around 02:05. You can also check Settings → System → Hardware → uptime - it should show just a few hours, confirming the reboot happened as scheduled.
Adjusting the Schedule
Reboot less frequently than nightly by restricting to specific days with a condition:
conditions:
# Only reboot on Sunday and Wednesday nights
- condition: time
weekday:
- sun
- wedThis keeps the trigger checking every night at 02:05, but the reboot only actually happens on the days listed.
If you have long-running scripts or processes that might occasionally still be active at 2 AM, add a condition to skip the reboot when needed, using a corresponding input_boolean that another automation sets during sensitive operations:
conditions:
- condition: state
entity_id: input_boolean.backup_in_progress
state: "off"What Happens During the Reboot
HA stops gracefully (any in-progress automations or scripts are interrupted), the host operating system restarts completely, HA Supervisor starts back up, all add-ons restart (Mosquitto, Zigbee2MQTT, DuckDNS, File Editor, anything running), HA Core loads and reconnects to all integrations, Zigbee/Z-Wave networks re-establish (can take an extra minute or two beyond HA itself coming back online), and everything resumes normal operation.
Total downtime is typically 1-3 minutes for HA Core itself, though Zigbee mesh re-establishment and some cloud integrations reconnecting can take a few minutes longer to feel fully settled.
Troubleshooting
Automation runs but HA doesn't actually reboot: Confirm you are running HA OS (Supervisor-based). hassio.host_reboot does not exist on HA Container/Core installations - use homeassistant.restart instead.
Notification doesn't arrive before reboot: Increase the delay from 5 to 10 seconds, or check your notify service name is correct.
Zigbee devices seem unresponsive after reboot: Normal - the Zigbee mesh needs a short time to re-establish. Wait 2-3 minutes before troubleshooting further.
Some add-ons don't restart properly: Check each add-on has Start on boot enabled in its configuration - without this, an add-on will not come back up automatically after a host reboot.
Automation doesn't trigger at all: Check Traces to confirm the time trigger fired. Verify your HA system clock and timezone are set correctly under Settings → System → General.
Guide written by a Home Assistant enthusiast in Utrecht. A clean reboot at 2 AM has quietly solved more mystery glitches than hours of troubleshooting ever has.



Comments