Displaying temperatures of linux system as a sensor

My Home Assistant OS instance is running on a virtual machine on a bigger Ubuntu web server, I want to be able to use “entities” on Lovelace to display system specs like temperature, networks speed and remaining storage. I’m not sure how to do this seeing as Home Assistant is running separated from the main machine.

Is there a way to do this with some sort of integration (like with Synology) or another way

Easiest way is probably writing a script on the Ubuntu server that extracts these measures from the system and sends it to an MQTT broker. Then on the Home Assistant side create sensors that consume these informations from MQTT.

Thank you,
Would you have any knowledge on setting up MQTT or any useful sources you are aware of,
If not I’m sure I can find some myself

Have a look at systemmonitor platform.

Also, as long as you have access to /sys/class/thermal and similar files, you can use command line platform
Check here

Network speed would probably be meaningless (virtualized) but some other stats should work.

But won’t this only display vm stats? I want statistics for the whole machine

Install an MQTT Broker, with Home Assistant OS the easiest option is the Mosquitto Add-On.

Then configure the MQTT integration to connect Home Assistant to the broker.

For the script you can get inspiration from this repo, it’s for a Pi but should be similar for other systems.

This will only give you the stats of the VM, not of the host.

I run HA in docker on debian and the system monitor works fine for processor_temperature and network_in/out at least. It does also work for most of the other stats. I am not sure they’re all system wide though.

I’ve got the broker working but can’t get the sensor to yet

That’s right.
If the VM and the server are on the same subnet, maybe the server can expose these values via snmp to the snmp integration of HA. Have not tried it, I use docker and the /sys/class filesystem is good enough.

All working now with a MQTT Broker.

1 Like