PI Watcher

I was wondering if this device could be incorporated into Home Assistant.

I have this device on another RPi that runs NEMS. NEMS is an acronym for Network Enterprise Monitoring System developed by Robbie Fergerson
and it helps keep the Pi up all the time.

I recently went away on holidays and for some reason the HA PI locked up. I had to get someone to manually do a power reset to get it back.
A PiWatcher Integration would be a great asset in stability.
I don’t have the skills to get it up an running.
Robbie F included it in his image and all you had to do was plug up the hardware and it worked. Thanks Robbie.

Anyone have any ideas on how to get it gong?

If you are running raspbian then it should be as easy as following the instructions on the page. You can use the command_line integration to get values from it.

If you are running Hassos, it will be more difficult.

Hi nickrout,

Yes I am running the hassio image and that is the problem.
I could easily do it if I had it running under Raspbian.

This is why I was looking to see if an integration could be developed.

It is not impossible to simply download the binary into a hassos image and run it.

You’ d need to ssh in, download the binary to somewhere in /config, set it executable.

AFAIK you’ll need to do it again on every update.

OR you could build your own hassos images.

Not sure this is the best solution to begin with. HA could crash and piwatcher would never catch it.
Perhaps you can do something much simpler, using a smart socket that powers your Pi USB adapter. Thinking out loud here, Im sure there are more elegant solutions, but keep it on tuya (or alexa or IFTTT or whatever), create an automation in HA that sets the socket to shut down in say 30 minutes. Everytime the automation runs, the clock is reset to 30 mins. Then in tuya create an automation that turns the socket on 5s after its turned off.

That would just switch the pi off. It needs to be shut down properly, which I think piwatcher tries to do.

How are you going to shut it down properly if the Pi is no longer responsive? Thats all piwatcher can detect.

If you want to properly reboot the Pi in case HA stops working, but the pi is still responsive, you can probably do that too in a similar way, just run a script that reboots the pi in 30 minutes, and keep pushing that clock forward through a HA automation. But thats not going to catch many problems, so I would also add the smart socket solution for a hard reboot.

I read it again, absolutely correct.

The PiWatcher has this facility…

The PiWatcher can be programmed to automatically power cycle a Raspberry Pi if it does not receive a ‘heartbeat’ from the device after a user selectable delay. This can allow some critical applications to continue to operate without human intervention.

In other words if the Pi ise dead then no heartbeat and therefore it will reboot/power cycle.
This is how it is set up in NEMS by Robbie.

I think it would work OK if it was included in the hassio image. As I said Robbie has it included in his image and when it senses the hardware it activates.
I have no idea how he does it but it works fine and have had it running now for 6 months or so.

Doesn’t the Raspberry Pi have a built in hardware watchdog? Surely it would make more sense to use that:

For other systems however I imagine this addon may be more useful.