If you’re like me, you have several of these pies running around your house performing various tasks and making your life easier However they need your love and attention, too!
So I created a script that runs in each pi. The script publishes to my HASS MQTT broker some basic system data so I know its health and activity.
Looking forward to your comments and ideas. One taht comes to mind is to create automations that would actually notify me when one of the Pies is failing, running out of disk space, cpu getting too hot, etc. I’m still learning HASS so that is a little out of my league right now.
Can you please tell how do you display value in home-assistant. I was able to get the values in raspberry pi y running the py file but i am not getting anything when i put it in sensors.yaml file. I am using the conf -
You’ll see that the payload i’m sending contains the values “datetimedatacollected”, “cpuusage”, “boottime”, “diskusage”, “cputemp” and “disktotal”. So the yaml code i’m using for my configuration will be something like this:
Hmm… I suppose I could do some automation to notify me when certain thresholds such as high cpu temp, low disk space, etc are reached. Thanks for the idea!
Need one more help in home-assistant config. How you use 2 brokers in home-assistant. I have 2 pi’s both running mqtt with same config you provided and both working independent but how do i get the 2nd pi’s broker in the 1st one which already has broker running on localhost.
Thank you for sharing your script.
Manually executed the script, got the sysinfos and also “[Errno 32] Broken pipe” error.
The payload did not reach its destination.
Home assistant is running the MQTT broker. This is the server that receives and keeps the messages coming from the mqtt clients (the RBPi’s you are monitoring.) Each RBPi you are monitoring is running the MQTT client to connect to the broker and send and receive messages from the MQTT server (HASS). So there is only ONE server (broker) running and multiple MQTT clients (one for each device you want to monitor.)
I would make sure the device you are running the script from has network connectivity. Another issue may be that the MQTT broker is not running. Check that it is running by trying to connect from the very same device it is running. if you get the same error then you know that the MQTT broker is not running or is not configured correctly. Good luck!