Keep receiving notification "Command Line YAML configuration has moved"

Hello,
I keep receiving the following notification:
"Configuring Command Line sensor using YAML has moved.

This stops working in version 2023.12.0. Please address before upgrading

Consult the documentation to move your YAML configuration to integration key and restart Home Assistant to fix this issue."

I only have one sensor that uses command line to fetch currency rates. Bellow is my sensor which is placed inside config/sensor/. The file is called “exchange_rate.yaml”:

platform: command_line
name: 'eur_brl'
command: curl -s -XGET 'https://api.exchangerate.host/latest?base=EUR&symbols=BRL'
scan_interval: 700
unit_of_measurement: 'BRL'
value_template: "{{ value_json.rates.BRL | round(2) }}"

I’ve read the documentation and it seems that I’m using everything correctly, but I still receive the notification. Does anyone know what I have to do in order not to lose this sensor when updating to 2023.12.0 in December?

Thanks,
Airton

Please read it again. You need to change your sensor to this format:

configuration.yaml:

command_line:
  - sensor:
      name: 'eur_brl'
      command: curl -s -XGET 'https://api.exchangerate.host/latest?base=EUR&symbols=BRL'
      scan_interval: 700
      unit_of_measurement: 'BRL'
      value_template: "{{ value_json.rates.BRL | round(2) }}"
1 Like

Thanks! that works!