"Command Line YAML configuration has moved" - needed action

For weeks now I am struggeling with this warning as I could not figure out, how to do it in my configuration.

Is it correct to change these lines:

sensor:
  - platform: command_line
    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) }}'
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
        arg: /home
      - type: memory_free
      - type: memory_use
      - type: swap_use
      - type: swap_free
      - type: load_1m
      - type: processor_use
      - type: processor_temperature

to this?

command_line:
    -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) }}'
        - platform: systemmonitor
            resources:
            - type: disk_use_percent
              arg: /home
            - type: memory_free
            - type: memory_use
            - type: swap_use
            - type: swap_free
            - type: load_1m
            - type: processor_use
            - type: processor_temperature

I hope, someone can assist me on this.

Thanks in advance.

You will need to format the code in your post properly so people can have a look since yaml formating is very important.
Use the double quote symbol at the top of the reply dialog to format your code.
Screenshot_20231014_063611_Chrome

Looks like it is formated right for the post now. The -sensor is definitely not right at the top. Should be - sensor, there may be others but that is definitely wrong.

It’s the </> button or wrap it in two sets of three back ticks ```.

1 Like
sensor:
  - platform: systemmonitor
    resources:
      - type: processor_use
      ...
command_line:
  - sensor:
      name: CPU Temperature
      command: cat /sys/class/thermal/thermal_zone0/temp
      unit_of_measurement: "°C"
      value_template: "{{ value | multiply(0.001) | round(2) }}"