So, my HomeAssistant runs on a Pi3 and seems to go offline roughly weekly. This is clearly not ideal, but I’m assuming that it’s just running out of memory or something. The fix is to use better hardware, but right now PI’s are a little expensive (!)
So. I’ve a few spare ESP01’s.
The idea is to create a node that will notice that HomeAssistant can’t be reached, and flip a GPIO pin that would be connected to the reset line of the Pi.
To work sensibly, it would detect HA being offline, and then continue to check for… three minutes(?) to see if it comes back (could be a brief network interruption), if it does not come back, flip the reset pin.
Importantly, it must not flip the reset pin again for… at least ten minutes, or something. To avoid it rebooting the Pi while it’s still booting up!
So, I started to write the yaml for this and rapidly fell in the dirt. I figure I must be re-inventing the wheel anyway, because surely someone has already done this?
If you’ve done this already, or know a good way to implement it, please share your code
Many thanks.