Reduce logging or turn it off for CPU temp

Dear people in the forum, I have setup a sensor in configuration.yaml:

command_line:
  - sensor:
      name: CPU Temperature
      command: "cat /sys/class/hwmon/hwmon0/temp1_input"
      unit_of_measurement: "°C"
      value_template: "{{ value | multiply(0.001) | round(1) }}"

It works well but I believe it records and logs it’s value many times a minute and I would like to reduce the logging or stop it, to reduce disk write.

I don’t see how. The default is once a minute: Command line - Home Assistant

You can increase it (5 minutes in this case):

command_line:
  - sensor:
      name: CPU Temperature
      command: "cat /sys/class/hwmon/hwmon0/temp1_input"
      unit_of_measurement: "°C"
      value_template: "{{ value | multiply(0.001) | round(1) }}"
      scan_interval: 300 # seconds

Thank you for your reply. I mean I see in the history that the sensor has been recorded many times a minute. I have an automation that warns me if temperature is above a certain temp which will give me a warning, so I want it to be active whenever it changes. I just want to minimize the history that is written to the logs.

Please share a screenshot of this. As I said the default is 60 seconds.

I trust you, i thought it logged everytime the temperature changed. This is a screenshot, but I excluded it from recorder today and it seems like it’s just a line now more or less.

If you exclude it from the recorder then you have no saved history to plot.

I think it work as I want it now :slight_smile: Thank you very much!