Is there a way to pause Home Assistant activity while I reboot router (via scheduled automation)

I have an automation to restart my router every week.

I’ve noticed when that takes place my Home Assistant logs get flooded with errors because devices can’t connect. My OCD kicks in when I see these errors though in the logs. :slight_smile:

Is there any way to “pause” the HAOS activity for X minutes to wait for the router to be back online to avoid unnecessary errors from getting logged?

Not easily, although you could conceivably have an HA automation that does the following.

  1. Detect that the router has gone offline. How to trigger this, is up to your unique setup.
  2. Call a Home Assistant service to run a command locally as root which does something to the effect of:
sudo systemd-run --no-block --on-active=1 bash -c 'systemctl stop home-assistant.service ; sleep 60 ; systemctl start home-assistant.service'
# That means:
# * stop home assistant
# * sleep for 60 seconds
# * start home assistant

Unfortunately I doubt that HAOS ships with systemd.

Have you considered getting a router that doesn’t need constant or periodic reboots? That’s the actual fix you need.


Thank you! Will do some more digging - appreciate the tips

@Rudd-O ha - yea that would be ideal but never had one that didn’t seem to benefit from a cleanse

What are you using? No issues?

Try EdgeRouterX

After i moved to optic fibre, it turned out my current router wasn’t fast enough. It became unstable with high bandwidth usage 1Gbs up/down (even with running OpenWRT, it is just the hardware that couldn’t take the load).
But the wifi is fine so decided to go for an additional ‘cheap’ wired EdgeRouter and keep my old router for wifi only. Never had issues after that

I never reboot my router (except for firmware updates, or if I need to do something that affects the power). Unifi dream machine,

Same for my EdgeRouterX (also Ubiqity)

Fritz!Box here. 2 years without a reboot…

Very cool - will dig in (thanks! and @eggman & @BebeMischa too!)

I have an EdgeRouter4 at 171 days and it only went down then due to a total blackout.

While at it…my ‘old’ (TP-Link TL-WDR3600) with OpenWRT is stable too now that I don’t overload it as 1GBs gateway; it is only used as wifi access point.
Uptime 138d 1h 20m 55s