Proxmox CPU+ temp to HA (working guide + files)

I decided to publish working guide with already generated files for proxmox CPU temperatures…

The goal, to see temperatures in Home Assistant:

1. STEP - Set up API access in Home Assistant:

Click on user, then create new long-term token.
Please be careful to write down the API secret string as this you will need later in configuration *.py file (step 3) so that proxmox could connect to HA.

2. STEP - Set up sensors in HA configuration:

  - platform: template
        friendly_name: "Procesor"
        value_template: '{{ states("input_number.proxmox_input_cpu_temp") | multiply(0.001) | round(1) }}'
        unit_of_measurement: °C

  - platform: template
        friendly_name: "ACPI vmesnik"
        value_template: '{{ states("input_number.proxmox_input_acpi_interface") | multiply(0.001) | round(1) }}'
        unit_of_measurement: °C

  - platform: template
        friendly_name: "ISA adapter"
        value_template: '{{ states("input_number.proxmox_input_isa_adapter") | multiply(0.001) | round(1) }}'
        unit_of_measurement: °C
      name: Procesor
      min: 0
      max: 200000

      name: ACPI
      min: 0
      max: 200000

      name: ISA adapter
      min: 0
      max: 200000

In main configuration file you must also add API access, so add line:

After that changes restart Home Assistant.

3. STEP - Upload modified .py files to PROXMOX:

Login to:

Download files:

Edit the files (use Notepad++) and change url (bold) based on your HA static IP address:
url = “http://192.168.X.XX:8123/api/states/input_number.proxmox_input_acpi_interface”
Edit the API key (bold):
“Authorization”: “Bearer HA_API_KEY”,
you get the API key in step 1.

After you change file upload files via WinSCP


You must upload to /root/.

4. STEP - Install dependencies on Debian Linux (proxmox)
Login to proxmox as root via SSH (PuTTy) and enter commands (after every line press ENTER):
sudo apt update
sudo apt install python3-pip
(confirm installation with Y)

5. STEP - Make .py files executable on Debian
Login to proxmox as root via SSH (PuTTy) and enter commands (after every line press ENTER):
chmod +x
chmod +x
chmod +x

6. STEP - Most important step - edit crontab via SSH (PuTTy)
Enter command:
crontab -e
and enter lines the same as seen here:

* * * * * /root/ >/dev/null 2>&1
* * * * * (sleep 30 ; /root/ >/dev/null 2>&1
* * * * * /root/ >/dev/null 2>&1
* * * * * (sleep 30 ; /root/ >/dev/null 2>&1
* * * * * /root/ >/dev/null 2>&1
* * * * * (sleep 30 ; /root/ >/dev/null 2>&1

Do not forget to add “>/dev/null 2>&1”, this means that in case that you will make restart of Home Assistant you won’t get bunch of error e-mails to you proxmox root account :slight_smile:
Also, do not forget to go to new line after last line, or cron job could not be created…

7. STEP - Last step is to add sensor to Lovelace in Home Assistant

That’s it…

Tools which are needed:

Hardware used:
Intel NUC8i7BEH

So that this user guide is possible to make I need to thank to:


Why not use a command line sensor that SSH into the host?
I use the below to get the temp of my NUC, no cronjob or python script needed.

  # Temperature NUC
  - platform: command_line
    name: temperature_cpu_nuc
    command: 'ssh -i /root/.ssh/id_rsa -o StrictHostKeyChecking=no -q [email protected] cat /sys/class/thermal/thermal_zone3/temp'
    value_template: "{{ value | int / 1000 }}"
    unit_of_measurement: "°C"

Same result, completly different approach…


That’s why I’m asking, why all the overhead and scripts for something that can be done with way less steps?

1 Like

This cron job way we can also send HDD disk space to HA etc…
Can be this done via cmd from HA also?

Yes, I took a quick look at your files and they just execute a shell command and send it to HA over the HA API. Also I don’t see why you need three scripts for this, instead of having one script that updates all three or a script that generates one sensor where the other values are attributes.

You are wellcome to modify the scripts…

I could, but I don’t see a reason why I should do that, when there is an easier approach that requires less steps.
Also if I’d write a script for this, I would send the data to HA over MQTT with a discovery mesaage, so that the entities will be created automatically by HA.

1 Like

I created a python script to post ALL lm-sensor value to HA.

It can be used instead of

There is even a way to create all input_number section by using -c flag

python3 /root/ -u -s proxmox -a HA_API_KEY -c

or -d flag to see called url and values but nothing it posted to HA

python3 /root/ -u -s proxmox -a HA_API_KEY -d

the cron job used on my system

* * * * * root python3 /root/ -u -s proxmox -a HA_API_KEY

HA_API_KEY need to be replace by your own.

You will need to write you own sensor section in configuration.yaml

1 Like

Nevermind. I was in the wrong server.

do you have a guide on this one?

A guide for what?

on how to make that work, and what needs to be replaced in order to make it work

Here’s a guide to create ssh keys:

And here’s a guide for the NUC temp sensor


I followed your guide, but it still doesn’t work.

I followed your guide and doesnt work, maybe a i missed a step?

can you please share some details on how to set it ?

Thanks a lot to @kslb for posting this - it helped me a lot

your comand didn’t work - maybe because its a different hardware? (AMD?)
anyway - I took the output of ‘sensors’ and modified it to my needs:"sensors -u k10temp-* | grep 'temp3_input:' | sed -r 's/  temp3_input: //'", shell=True, text=True, capture_output=True).stdout.strip()
#temp = [int(i) for i in temp.split() if i.isdigit()][0]

i do not see it changing over the time