Is it possible to read the CPU temperature on an Intel-nuc running HassOS?

Oh! @tom_l, in terminal/ssh what do get if you enter:

cat /sys/class/thermal/thermal_zone*/temp

I’ve also tried:

cat /sys/class/thermal/thermal_zone0/temp
cat /sys/class/thermal/thermal_zone1/temp
2, 3, 4

I always get:

cat: can’t open ‘/sys/class/thermal/thermal_zone*/temp’: No such file or directory

The examples I posted above are from my system. I have zones 0, 1 and 2.

So, presumably you have used the thermal_zone2 element and set your sensor as : -

- platform: command_line
  name: CPU Temperature
  command: "cat /sys/class/thermal/thermal_zone2/temp"
  unit_of_measurement: "°C"
  scan_interval: 240
  value_template: '{{ value | multiply(0.001) | round(1) }}'

For Centigrade.
Or for Farenheit, follow Mark’s example above

It seems, from obesrvation (please correct me if I’m wrong, but the posts I’ve read seem to agree) that Pi’s use zone 0 and Intel’s use zone 2 ???
I’ve also noticed that : -

  value_template: "{{ '%.1f' | format(value / 1000) }}"

Does NOT work at all, strange !
:thinking:
Maybe the filter to multipy() implicitly makes it a number

1 Like
 _    _                                         _     _              _   
| |  | |                          /\           (_)   | |            | |  
| |__| | ___  _ __ ___   ___     /  \   ___ ___ _ ___| |_ __ _ _ __ | |_ 
|  __  |/ _ \| '_ ` _ \ / _ \   / /\ \ / __/ __| / __| __/ _` | '_ \| __|
| |  | | (_) | | | | | |  __/  / ____ \\__ \__ \ \__ \ || (_| | | | | |_ 
|_|  |_|\___/|_| |_| |_|\___| /_/    \_\___/___/_|___/\__\__,_|_| |_|\__|
                                                                         
Welcome on Home Assistant command line.

For more details use 'help' and 'exit' to close.
If you need access to host system use 'login'.

ha > login
# cd /sys/class/thermal/
# ls
cooling_device0  cooling_device1  cooling_device2  cooling_device3
# cat /sys/class/thermal/cooling_device*/type
Processor
Processor
Processor
Processor
# cd /sys/class/thermal/cooling_device2/
# ls
cur_state  device     max_state  power      subsystem  type       uevent
# 

I don’t have any “thermal_zone” in /sys/class/thermal/ only “cooling_device” and these don’t list a temperature.

FWIW, this is a screenshot from my test system running Home Assistant 0.110.0 on an RPI3 (installed from disk-image; meaning it uses HassOS).
Screenshot from 2020-05-24 11-21-57

It contains just one thermal zone and no cooling zones.

Out of curiosity, is your RPI cooled passively or actively (i.e. does it have a fan)? My RPI3 is passively cooled (Flirc case).

Hey, it’s an Intel-nuc, not an RPI and it’s passively cooled.

This one: https://www.jetwaycomputer.com/JBC311U93.html

Issue is very similar to this thread: CPU Temperature for quad core CPU

Perhaps that explains the differences between what you are seeing and what people are suggesting you use.

Thanks @123, but @tom_l is using a nuc and it’s working for him. So don’t think that’s the problem. Maybe a BIOS setting? Or a hardware quirk?

The link describes the product as “Intel NUC form factor”. Is it truly a clone of an Intel NUC in all aspects? The fact you don’t see thermal_zone, whereas other Intel NUC owners do, suggests there are subtle differences.

@123 I completely agree that there’s probably a difference. It’s strange that this previously worked when my install was Supervised on Ubuntu.

I am running HassOS in a VirtualBox VM on an Intel NUC running Windows 10 Pro and the sensors don’t exist. I only see cooling_zone0 and cooling_zone1 directories with no data files representing any kind of temperature. The NUC CPU is actively cooled. It has a fan.

Did anyone find the solution to this?

Open Hardware Monitor on the Windows HostPC:

I will take a look at that.

I just did a sneaky edit ofmy post because I wasn’t sure Glances could run on Windows. It can. Though OHW would probably be easier.

1 Like

I use Open Hardware Monitor to monitor my windows server disks, temperatures, fan speed, CPU, memory etc in Home Assistant and it works really well. I used to use the Pulseway service but never use it at all anymore.

1 Like

Open Hardare Monitor works great! Thanks!

Thanks but I’ve tried Glances - there’s no CPU temperature listed. Open Hardware Monitor is not applicable to my use case.

Is there an easy or straightforward way to get OpenHardwareMonitor to display it’s sensor temperatures in Celsius, despite my HA global settings being Fahrenheit? Thanks in advance!

It stops to work on the HA core-2021.6.0 version.
Do you know how to solve it?

It’s running fine here.

Upgrade the custom component version: GitHub - custom-components/sensor.ssh: SSH Generic Sensor

1 Like