Hi!
I have a temperature sensor for the Raspberry Pi4 CPU and sometimes it becomes unavailable, its entity simply does not exist anymore. After the restart it reappears and sometimes disappears again. The sensor is in the sensors.yaml file.
sensor:
- platform: command_line
name: CPU Temperature
command: "cat /sys/class/thermal/thermal_zone0/temp"
unit_of_measurement: "°C"
value_template: '{{ value | multiply(0.001) | round(1) }}'
scan_interval: 10
Mind that the command_line format and options you use are now deprecated. Try re-typing it as the new format and let’s see.
PD: In my case i also have a RPi4 but instead I use the System Monitor - Home Assistant integration to retrive temperature (and others) and had zero issues in years.
Try casting the value to a float first , before the multiply, as I’m not sure the command_line sensor by default parses any retrieved value as a numerical time but rather as a ‘generic’ string.
If that doesn’t work either, try retrieving the ‘value’ first, then working from there in the template.
I don’t use glances so you might need to collect how it checks both integrations.
Assuming is not a delay thing, my bet is that it might be related with one being the ‘Core’ temperature and another being the ‘package’ temperature. I see multiple temperature sensors as well available when using Libre Hardware Monitor on my PC.