Switches.yaml

Hi,
I’m in new situation, I’ve issue with switches.yaml file

- platform: template
  switches:
      radiateur_masterbedroom:
        friendly_name: Radiateur masterbedroom
        value_template: "{{ is_state('switch.radiateur_masterbedroom', 'off') }}"
        turn_on:
          service: switch.turn_off
          data:
            entity_id: switch.radiateur_masterbedroom
        turn_off:
          service: switch.turn_on
          data:
            entity_id: switch.radiateur_masterbedroom
        icon_template: "{% if is_state('switch.radiateur_masterbedroom', 'on') %}mdi:radiator-disabled{% else %}mdi:radiator{% endif %}"

I’ve message :

Invalid config for ‹ template › at switches.yaml, line 1: ‹ platform › is an invalid option for ‹ template ›, check: platform Invalid config for ‹ template › at switches.yaml, line 2: ‹ switches › is an invalid option for ‹ template ›, check: switches

And I’m not sure about name if switch.radiateur_masterbedroom.

Thanks

How does your configuration.yaml reference this file? Should be:

switch: !include switches.yaml

but the error reads like it’s seeing

template: !include switches.yaml

Thanks it’s quite easy after all.
I couldn’t understand the error message and remained focused on the switch.yaml