Expected a dictionary for dictionary value

Good Morning,
I’m trying to set up a configuration to give my climate entities a switch for turning on a device. I found code from another thread, and modified it to fit my needs, however after adding the code to my configuration.yaml, and checking the yaml configuration, I am getting the Configuration Warning below:

Invalid config for ‘template’ from integration ‘switch’ at configuration.yaml, line 64: expected a dictionary for dictionary value ‘switches->living_room_heating->turn_on->0->target’, got [{‘entity_id’: [‘climate.living_room_heater’]}]
Invalid config for ‘template’ from integration ‘switch’ at configuration.yaml, line 71: expected a dictionary for dictionary value ‘switches->living_room_heating->turn_off->0->target’, got [{‘entity_id’: [‘climate.living_room_heater’]}]

Below is a copy of the code as it has been added to my configuration.yaml. This code starts at line 57 and ends on line 75

  - platform: template
    switches:
      living_room_heating:
        friendly_name: Living Room Heating
        value_template: "{{ is_state('climate.living_room_heater', 'heat') }}"
        turn_on:
          - service: climate.set_hvac_mode
            target:
              - entity_id: 
                  - climate.living_room_heater
            data:
              hvac_mode: 'heat'
        turn_off:
          - service: climate.set_hvac_mode
            target:
              - entity_id: 
                  - climate.living_room_heater
            data:
              hvac_mode: 'off'

Get rid of the hyphens in front of two entity_id keys.

- platform: template
    switches:
      living_room_heating:
        friendly_name: Living Room Heating
        value_template: "{{ is_state('climate.living_room_heater', 'heat') }}"
        turn_on:
          - service: climate.set_hvac_mode
            target:
              entity_id: 
                - climate.living_room_heater
            data:
              hvac_mode: 'heat'
        turn_off:
          - service: climate.set_hvac_mode
            target:
              entity_id: 
                - climate.living_room_heater
            data:
              hvac_mode: 'off'
1 Like