How to configure a watchdog service of home assitant and automatic restart if the system gets stuck

Hello, I’ve just been developing my Smart Home Assistant platform and I can say that it is a great system. The only problem that I have is that sometimes it gets stuck and if I do not realize about automation and data collection from Home assistant do not work. For example when I arrive home, I cannot use my automation to open the door. This is quite annoying.
So I’ve decided to do a watchdog system to allow me to follow if Homeassistant is working and in case it gets down, it will send me an alert. I’ve used UptimeRobot to do so.
After creating the Watchdog system, I’ve realized that I needed a way to automatically restart the Home Assistant when it was down. So I decided to use an smart plug connected to my Homeassistant Raspberry Pi with a restart scene configured (disconnect energy and connects energy after 1 minute). I launch the restart scene using IFTTT webhook automation, which is triggered when Uptime Robot detects that the system is down.
I will try to describe all steps of How I’ve done this process:

  1. Create an account on uptime robot: https://uptimerobot.com/
  2. Click in “Add Monitor” and create a monitor type HTTPs. At URL insert Home assistant Web page address which is going o be monitorized by uptimerobot
  3. In uptime robot click on My Settings and create an Webhook “alertdowntime_alert”.
  4. URL to notify must be obtained from IFTTT Documentation page: click in this link and after in documentation: Webhooks works better with IFTTT.
  5. After this you can create an IFTTT service that could automatically activate a scene, for example in a Tuya Smart Socket that has been created using Smart Life Integration

Yes, you can make a watchdog to restart HA, but wouldn’t you rather fix your problem? I’ve been here for a couple of years and HA stopping spontaneously has only presented on the forums three or four times that I can recall. In other words, rare.

Most of the time random idiopathic fails are almost always because of an inadequate power supply.

Not to mention you’ll bugger your storage.

Hello! In my case HA gets stuck randomly 1 or 2 times per week. It is quite frustraiting for example to arrive home and see that the whole system is down. I would love to debugg my system, but I don’t know how to start doing so. Can you describe how you do it? Which one are most commons problems? Thks in advance!

1 Like

For a start look at the logs.