System Info integrated with Home Assistant

I looked at Glances https://github.com/nicolargo/glances/blob/master/README.rst and while it’s good for CPU, memory and Disk it doesn’t show temperature, IP, OS etc… by default. Also seems to take a lot of CPU on Pi-zero.

Should the data be push or pull?

For push, we have a program running on the remote server that pushes info for MQTT.

For pull, we host an API on the remote server that a central controller polls.

PatternProsCons
PushPush can be scheduled so don’t have to worry about constantly running a server.Refresh rate set by server.
Load could be affected by program starting to push events.
PullRefresh rate set by client.
Find quickly if server is healthy.
Have to run API on remote server continually – needs auto restart.

On balance, because some servers (e.g. rpi-zero) get more impacted by always on API server, recommend going for push method.

Initially I used a python script from https://github.com/Sennevds/system_sensors.git but I had problems when it crashed.

So I’ve modified the script so that it dies after publishing the MQTT topics, so it can be scheduled in crontab at whatever frequency you like. Here’s the repo: https://gitlab.com/hyperons/system_sensors

Leave a comment