Switch error on existing (unmodified) config


I did not change this config, but now I’m getting errors on this switch:

  - platform: command_line
        friendly_name: EVSE activeren
        command_on: "curl"
        command_off: "curl"
        command_state: "/usr/bin/curl -X GET"
        value_template: '{{ value_json.list[0].evseState == True}}'

Invalid config for [switch]: required key not provided @ data[‘platform’]. Got None. (See ?, line ?). Please check the docs at https://home-assistant.io/components/switch/

What is wrong with it?

Sort off solved it. There is actually nothing wrong with this switch.

I have switch: configured like this in configuration.yaml:

switch: !include_dir_merge_list include/switches

But I also have several switches defined in packages which are included like:

  packages: !include_dir_named packages

I deleted a (the last) switch from /include/switches so there where no more files in that folder.

That is wat caused the issue.

I now just put one file with a dummy template switch back in /include/switches/ and the error is gone.