Jump to content

VM Home Assistant automatic restart with UserScripts


Recommended Posts

My Home Assistant VM crashed nearly daily. Search for the logfile error or supervisor repair could not change anything so far.

 

Here is a Script for the "User Scripts" Plugin, to restart crashed VM:

 

#!/bin/bash
if netcat -z  Home.Assistant.IP.Nr  8123 >/dev/null; then
# if curl --url
http://Home.Assistant.IP.Nr:21080 >/dev/null; then
    echo "HAonline"
else
    echo "HAoffline reboot"
        virsh destroy  'Home Assistant'
        virsh start 'Home Assistant'
fi 

 

 

Costum Schedule 0,6,12,18,24,30,36,42,48,54 * * * * (every 6 min)

 

not the most elegant solution, but it works

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...