2

My Home Assistant (RPi4) keeps crashing. I'm not sure why, but I need to keep it running. My first plan was to task another computer on the network (I have many...) to ping the HA RPi4 every minute or so and cycle power on the HA server if the ping fails. Now (after upgrading HA to the most recent release...) HA crashes, but the host is still pingable. That sucks.

So, how can I check my HA host from another server on the same LAN and be sure HA itself is healthy? Suggestions?

I'm likely just coding a little Python program. I'll cycle power by plugging the HA host into an IoT plug, cycling it using MQTT /Tasmota (MQTT server is not a container on my HA server, it's on another device).

Bence Kaulics
  • 7,843
  • 8
  • 42
  • 90
JimS-CLT
  • 191
  • 5

1 Answers1

3

There is a REST API call you can make to HA to check if it's alive:

http://your.homeassistant.ip/api/

If HA is running, the call will return this:

{"message": "API running."}

You do need to authenticate though. The simplest way: generate a long-lived access token at the bottom of a user's profile page on the HA UI, then use it in a script or a curl request like this:

curl -X GET http://your.homeassistant.ip/api/ -H 'Authorization: Bearer <long lived access token>' 
Gabor Herman
  • 141
  • 4