Setup failed for command_line: No setup or config entry setup function defined

Hi I want to try out the command line integration, so following the provided examples I added the following to my configuration.yaml:

# Example configuration.yaml entry
  - sensor:
      name: CPU Temperature
      command: "cat /sys/class/thermal/thermal_zone0/temp"
      # If errors occur, make sure configuration file is encoded as UTF-8
      unit_of_measurement: "°C"
      value_template: "{{ value | multiply(0.001) | round(1) }}"

but after that I got the following error showing up in the logs:

Logger: homeassistant.setup
First occurred: 6:43:41 PM (1 occurrences)
Last logged: 6:43:41 PM

Setup failed for command_line: No setup or config entry setup function defined.

Am I doing something wrong?

Weird indeed, I literally copy/pasted this 100% in my setup and it works fine for me
Only thing I can think of is that your OS does not support the command?

hmm the same happens if I replace cat /sys/class/thermal/thermal_zone0/temp with echo 123 though

What version of home assistant are you on?

That version of configuration for command line sensors was introduced in 2023.6. If you are on an older version it will not work.

As simple as that… I ran docker compose pull and restarted it, now it works :slight_smile:

Sorry for that, and thanks for your help!

This error is back in 2024.1.1 :upside_down_face:

I have the same entry in my configuration.yaml as in the first post of this thread, almost word for word.

Any ideas how to fix this? Or is it just a regression?

Sorry. This was my fault. I did something super stupid and installed the 2023.1 image instead of 2024.1.

Nevermind my previous post.