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:
sensor:
- platform: template
sensors:
proxmox_cpu_temp:
friendly_name: "Procesor"
value_template: '{{ states("input_number.proxmox_input_cpu_temp") | multiply(0.001) | round(1) }}'
unit_of_measurement: °C
- platform: template
sensors:
proxmox_acpi_interface:
friendly_name: "ACPI vmesnik"
value_template: '{{ states("input_number.proxmox_input_acpi_interface") | multiply(0.001) | round(1) }}'
unit_of_measurement: °C
- platform: template
sensors:
proxmox_isa_adapter:
friendly_name: "ISA adapter"
value_template: '{{ states("input_number.proxmox_input_isa_adapter") | multiply(0.001) | round(1) }}'
unit_of_measurement: °C
input_number:
proxmox_input_cpu_temp:
name: Procesor
min: 0
max: 200000
proxmox_input_acpi_interface:
name: ACPI
min: 0
max: 200000
proxmox_input_isa_adapter:
name: ISA adapter
min: 0
max: 200000
In main configuration file you must also add API access, so add line:
api:
After that changes restart Home Assistant.
3. STEP - Upload modified .py files to PROXMOX:
Login to:
https://www.vseznalec.si/homeassistant/Proxmox_CPU_temp/
Username:
homeassistant
Password:
virtualclone2020_weeWX%
Download files:
proxmox_cpu_temp.py
proxmox_isa_adapter.py
proxmox_acpi_interface.py
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 proxmox_cpu_temp.py
chmod +x proxmox_acpi_interface.py
chmod +x proxmox_isa_adapter.py
6. STEP - Most important step - edit crontab via SSH (PuTTy)
Enter command:
crontab -e
and enter lines the same as seen here:
* * * * * /root/proxmox_cpu_temp.py >/dev/null 2>&1
* * * * * (sleep 30 ; /root/proxmox_cpu_temp.py) >/dev/null 2>&1
* * * * * /root/proxmox_isa_adapter.py >/dev/null 2>&1
* * * * * (sleep 30 ; /root/proxmox_isa_adapter.py) >/dev/null 2>&1
* * * * * /root/proxmox_acpi_interface.py >/dev/null 2>&1
* * * * * (sleep 30 ; /root/proxmox_acpi_interface.py) >/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
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
sensor.proxmox_cpu_temp
sensor.proxmox_acpi_interface
sensor.proxmox_isa_adapter
That’s it…
Tools which are needed:
WinSCP:
https://winscp.net/eng/download.php
PuTTy:
https://www.putty.org/
Notepad++:
https://notepad-plus-plus.org/downloads/
Hardware used:
Intel NUC8i7BEH
https://www.intel.com/content/www/us/en/products/boards-kits/nuc/kits/nuc8i7beh.html
So that this user guide is possible to make I need to thank to: