Command-line sensor not showing up in entities

I am following this Github guide to get live weather data from my local area, to compare my basements humidity to the outside humidity.

I am aware that in 2023.06 the use of platform: Command-line was depreciated so I rewrote the script to look like:

command_line:
  - sensor:
  - name: local_weatherstation_dmi
    command: >
      curl -s "https://dmigw.govcloud.dk/v2/metObs/collections/observation/items?stationId=06181&period=latest-10-minutes&api-key=APIHIDDENFORPRIVACY"
    scan_interval: 600
    command_timeout: 30
    value_template: >
      {% if value_json is not none %}
        OK – {{ as_timestamp(value_json.timeStamp) | timestamp_local }}
      {% else %}
        Unavailable
      {% endif %}
    json_attributes:
      - features
      - timeStamp

This sensor is living in a separate sensors.yaml which I point to in my configurations in this way:

sensors: !include sensors.yaml
For some reason it still wont show up in entities under Developer tools, no matter what I try. Any suggestions?

You have too many spaces in front of - sensor: remove 2. You may also need to replace the dash in front of name with a space.

if your command_line sensor is in that file, it is still in the sensor domain and not the command_line domain. Put it in configuration.yaml , or create a

command_line: !include command_line.yaml

Thank you for the input, I have done this now, however now it throws me an error: Setup failed for ‘command_line’: Invalid config.

It does not do that when I had it in sensors.yaml

If you put it in command_line.yaml, you have to remove command_line: from your sensor

Post what you got now

I managed to get it to work. Turned out i Mixed up command_line: and Sensors and I had a - too much in fron of name. In addition I missed out on how to make helpers. I am new to the platform, but now that I understood it, it works perfectly.