I have a command line sensor configured to get my Pi CPU Temp, the sensor works and shows the Temp, but no history is available for the sensor, I have history for all other types of sensors, is this the normal behavior for command line sensors, or is something wrong somewhere, this sensor has been configured for more than a year, and I don’t remember ever seeing any history data.
CPU Temperature
- platform: command_line
name: CPU Temperature
command: "cat /sys/class/thermal/thermal_zone0/temp"
unit_of_measurement: "°F"
value_template: '{{ (value | multiply(0.001) * 1.8 + 32) | round(1) }}'
How do you have recorder and history configured? And where are you looking for its history exactly?
@pnbruckner
No restrictions to both, hopping to see the daily history by clicking on the sensor in the front end.
history:
recorder:
db_url: !secret db_url

Hoping for something like below.
Very strange. I just gave it a try. I copied your sensor configuration exactly and restarted:

FWIW, I’m still running 0.84.6.
To be honest, I’m not sure when or in which version it stopped working, I’m currently on the latest, but did notice there wasn’t any history for the past 2-3 versions, I was only looking for it because the temp has reduced quite considerably after moving from an SD Card to a SSD, I know it works and registers temp changes, because prior to upgrading to a SSD, my automation for temp changes above 135 fired 3-4 times per day.
Weird. I have a test system running a recent dev checkout, but I can’t try this exact same scenario because it’s a different type of machine and there is no /sys/class/thermal/thermal_zone0/temp. I can try to find something else and see what happens.
FWIW, I just tried this contrived example on my recent dev checkout:
- platform: command_line
name: Disk Usage
command: "df --output=pcent / | grep '[0-9.]*' -o"
unit_of_measurement: "%"
It immediately provides history. Is it possible your database is corrupted somehow?
Uncertain, but doubtful, as I have history and log entries for all other sensors, except for system sensors.
Well, I’m totally stumped now, just added a DHT Sensor to my Pi3 and got history immediately.
