Command line for CPU temp

I am using this sensor for CPU Temp in HASS.io setup, it works flawless. However I Gould like it to state the temperature in rounded number instead of .xyz. How do I do that?

  - platform: command_line
    name: CPU Temp
    command: "cat /sys/class/thermal/thermal_zone0/temp"
    unit_of_measurement: "°C"
    value_template: '{{ value | multiply(0.001) }}'

cpu1

Easier and what you want?

@Stimo try this:

value_template: '{{ value | multiply(0.001) | round(0) }}'

@anon43302295 the System Monitor platform does not seem to provide info on CPU temperature.

1 Like

^ you’re right. Ignore me, sorry!

@namadori Thanks, that worked!

round ?

‘{{ value | multiply(0.001) | round(2) }}’

Edit : too late :stuck_out_tongue:

Didn’t support CPU Temp.

Anyone know if you can pull the cpu temp running HassIO on Proxmox?

If not, maybe someone could help me pull it from the host via ssh or something? I’m not a coder and don’t really know my way around the Proxmox command line very well.

Running the following command in the host shell gives me a result of 62000:

cat /sys/class/thermal/thermal_zone0/temp

Maybe the Glance add on could work?

That’s pretty interesting. I currently don’t have InfluxDB installed, but was considering it for other purposes, so I may hold off until I have that in place.

Based on the following, I’m not sure it will provide CPU Temp, however:

Not all platforms are able to provide all metrics. For instance cpu_temp is requires installing and configuring lmsensors in Ubuntu, and may not be available at all in other platforms.