Script to post CPU load and CPU temp to MQTT #1772
tubalainen
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
|
Nice solution... |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Depending on your Frigate setup and how many cameras you are using the machine you are running Frigate on can be tormented with high CPU usage for a long time (if the wind is blowing, lots of movements in the motion areas etc).
Ive created this cron script that posts the CPU temp and CPU usage to MQTT.
EDIT - Or just use Glances instead https://github.com/nicolargo/glances thanks Minglarn!
docker run -d --name glances -e GLANCES_OPT="-w" -v /usr/share/dockers/glances:/glances/conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host nicolargo/glances:latest-fullThe temperature only works if you are running the OS on directly on your machine, not in a VM.
Pre-reqs
apt install lm-sensors mosqutto-clients coreutilsThe script ( i placed it in /root/inform_mqtt_status.sh)
You will need to check that all awk/sed etc are working hence the reporting is different of each machine architecture.
Add it to crontabcrontab -e (as root, in my case) runs every minute*/1 * * * * /root/inform_mqtt_status.shSensors in Home Assistant
I use a custom integration called "average", can be found in the HACS. How ever, it doesnt support
units_of_measurementso thats why ive got the template sensors.Beta Was this translation helpful? Give feedback.
All reactions