This is a simple Go utility built on top of the paho.mqtt.golang and gopsutil libraries to monitor the host machine running Home Assistant. The monitored machine is a Dell Wyse 5060 with an AMD K10 CPU, but the script can be easily modified to work with other devices as well.
The program uses MQTT protocol and will publish everything under hwinfo/ topic, as follows
hwinfo/network_total_bytes_sent
hwinfo/network_total_bytes_received
hwinfo/k10_temperature_celsius
hwinfo/cpu_utilization_percent
hwinfo/ram_used_percent
Then, you should create configuration file named config.ini in the working directory where you run the script:
[credentials]
user=<your mqtt username>
pass=<your mqtt password>
host=<your mqtt hostname>
Then, you should create a bash script, which you'll put somewhere to automatically start this python script on boot.
This is an example autorun script dedicated to Kubuntu autorun mechanism which also launches HA instance:
#!/bin/bash
cd /home/chris/Pulpit/HomeAssistant/uhostmon
nohup ./gohostmon >/dev/null 2>&1 &
VBoxManage startvm HomeAssistant --type headless
- Home Assistant dasboard
- MQTT explorer (see hwinfo topic)