How to schedule an automatic reboot every 12-24 hours to overcome network connectivity issues?

Hi how do I schedule an automatic reboot of my Home Assistant instance every either say 12, or 24 hours? For whatever reason, that was never answered in my previous query regarding networking issues, my Home Assistant instance (on a Raspberry Pi 4) will lose network connectivity randomly every 3 - 4 days on average. (both wired and WiFi. So the only possible workaround I can come up with is to somehow schedule an automatic reboot of this nature. Unfortunately my HomeAssistant instance has not seen as much use as it probably should, due to this specific issue, but unless someone can help to directly pinpoint what the cause of the network connectivity is, I fear my HA will have little choice other than to continue to be neglected.

Of course troublshooting network connectivity issues can often be very complex and it could be easy to become lost in the woods, so if possible I would welcome it if someone could assist me in putting this workaround in place first. To be clear a reboot always resolves the issue, until the timer starts counting down again, to another period of network unavailability.

Due to this issue, despite appearing to have been around these forums for a long time, please assume my skill level when dealing with these issues to be at very novice level. I used to mess about with Linux a fair bit back in the day, but that was at least 10-15 years ago.

With warm thanks!

Have you tried? It’s there. In actions there is a reboot the host system option.

Create the triggers and condition and use the reboot action.

Yes I tried. But it just says, “Message malformed integration not found.” I’m not sure if I did something wrong? I chose 5am every morning as the time to reboot, so 05 hours 00 minutes and 00 seconds as the trigger. Then I chose ‘device’ 'Home assistant host and ‘reboot’ as the action. But all I get is this error message.

Go to Developer tools, then action, then enter “Home Assistant Supervisor: Reboot the host system.” then hit the perform action button. If it works then there’s something wrong with you YAML in the automation.

The action part of you YAML should look like this

action: hassio.host_reboot
data: {}

Yeah I did that. It just reboots the system. But I want an automatic scheduled reboot every 12, or 24 hours. This doesn’t do that.

Sorry for the late response. Many distractions.

Should be something like this:

triggers:
  - trigger: time_pattern
    hours: "12"
conditions: []
actions:
  - action: hassio.host_reboot
    metadata: {}
    data: {}

OK I did as you suggested. This was the result when I clicked on ‘Perform Action’. Thanks so much for your kindness and patience, btw. I clearly have no clue what I’m doing. I simply copied and pasted as you had written. I don’t have a tab key, if I’m supposed to press tab after each of the spaced entries? (It’s taken up by SwitchResX which is an easy screen resolution switcher for my Mac Mini).

Because you’re trying to enter it in the action window in devtools. Dev tools was just to prove it works ‘do now’

That syntax is for an automation. (set your trigger, conditions etc)

Settings> automations and scenes > automations > + Create Automation

OK I did this following this video.

It seems simple enough. But when I hit on Enter to save my automation, it spits out the error message in the attached images. “Integration not found”

Sorry, wtf? Lol.


Top right of that page. Three dot menu.

Switch to yaml view.

Copy the whole thing and paste into the thread. Using the preformatted text feature in the forum input box (under the gear icon)

As @NathanCu suggests post your yaml but you also under the “Then Do” section you have two actions, the second is your reboot but the first is an empty device action with no device and no action specified. If you delete the section below

But yaml view will confirm

1 Like