Harmony Template Switch Config Error

Hi,

I am currently trying to set up a Harmony Template switch but getting the following config error that I can not figure out:

esting configuration at /home/homeassistant/.homeassistant
Failed config
switch:
- Invalid config for [switch]: required key not provided @ data[‘platform’]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 90).

Here is the relevant config:

switch:
  - platform: template
    switches:
      netflix:
        value_template: "{{ is_state_attr('remote.harmony_hub’, 'current_activity', ‘PowerOn’) }}"
        turn_on:
          service: remote.turn_on
          entity_id: remote.harmony_hub
          data:
            activity: “30338681”
        turn_off:
          service: remote.turn_off
          entity_id: remote.harmony_hub
          data:
            activity: "-1"

Thank you for your help in advance!

entity_id needs to be inside your data:

switch:
  - platform: template
    switches:
      netflix:
        value_template: "{{ is_state_attr('remote.harmony_hub', 'current_activity', 'PowerOn') }}"
        turn_on:
          service: remote.turn_on
          data:
            entity_id: remote.harmony_hub
            activity: '30338681'
        turn_off:
          service: remote.turn_on
          data:
            entity_id: remote.harmony_hub
            activity: "-1"

EDIT: Editing this because it wasn’t 100% correct.

1 Like

Thank you so much, it works!