Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Latest commit

 

History

History
36 lines (27 loc) · 1.38 KB

README.md

File metadata and controls

36 lines (27 loc) · 1.38 KB

Linux Python MQTT

uhostmon

This is a simple python utility build up on top of paho-mqtt and psutil to monitor my HomeAssistant host machine. The machine is Dell Wyse 5060 with AMD K10 CPU, but it should be easy to modify this script to read from other devices as well.

The script uses MQTT protocol and will publish everything under hwinfo/ topic, as follows

hwinfo/k10_temperature_celsius
hwinfo/cpu_utilization_percent
hwinfo/ram_used_percent

Configuration

All you need is to install python and then two requirements:

  • paho-mqtt
  • psutil

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.

Screenshots

  • Home Assistant dasboard

image

  • MQTT explorer (see hwinfo topic)

image