I have implemented the same script as @andynbaker has, but it seems that every so often HA decides that the data is “unavailable”. MQTT is on the same machine as HA. Using MQTT explorer I can see that the data is still available in MQTT, but it states that the remote PI’s are “offline” - which they are not. I can access both PI’s for their respective uses via the network, when it states that they are “offline”. Something tells me that I have something wrong with my MQTT setup and a timeout - but I’m not exactly sure where to look. Any thoughts?
I bailed out on this and went back to glances. I too kept getting the unavailable readings after a day or two. I found I needed to restart the systemd process to get it back up. I started going down the road of getting this running in docker that way I could let home assistant more easily restart the container when down (though I suppose I could just set up an Automation to ssh into the host). In the end I just said screw it and went back to glances. It is just so rock solid that it’s hard to beat.
If anyone is using NodeRed, I did this using the BigSSH node and a simple timer, and then I created custom sensors in HA.
2 Likes
BigSSH worked well for me for Pi-hole monitoring too. Well worth it