Harmony Remote Automation

Hi perhaps someone can point me to what i am doing wrong here, but the below automation does not work. I have followed the syntax of the example here https://home-assistant.io/components/remote.harmony/

but I get an error when trying to parse?
2017-06-02 13:00:06 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: expected a dictionary for dictionary value @ data[‘action’][0][‘data_template’]. Got None
extra keys not allowed @ data[‘action’][0][‘command’]. Got None
extra keys not allowed @ data[‘action’][0][‘device’]. Got None. (See /root/.homeassistant/configuration.yaml, line 1318). Please check the docs at https://home-assistant.io/components/automation/

automation:
- alias: Someone is at the front door
trigger:
  platform: state
  entity_id: binary_sensor.ring_front_door_ding
  state: 'on'
condition:
 - condition: state
   entity_id: group.people
   state: 'home'
action:
  - service: remote.send_command
    data_template:
     # using a data template to have if brances for relavant device
     # Always the same entity_id - the harmony hub
    entity_id: remote.lounge
     # Always the same command - the Pause key
    command: Pause
    # select device based upon the activity being undertaken.
    device: >
        {% if is_state("sensor.living_room_remote", "Watch SKY") %}{% raw %}
         20014676
        {% raw %}{% elif is_state("sensor.living_room_remote", "Watch Media") %}
         20009633
        {% elif is_state("sensor.living_room_remote", "Watch a BluRay") %}
        20009628
        {% endif %}

Please use the preformatted text option: </>
so that we can check if your Yaml is valid

done sorry thought i had, yaml parses fine here http://yaml-online-parser.appspot.com/
but HA throws the error…

The lines under data_template should all be another 2 spaces in.

(in fact everything under -alias: should be, with the lines under data_template having an additional 2 spaces, but I’m guessing that was a copy and paste error in the forum as it’s not reflected in the error message you got)

this is what it looks like in my text editor for some reason it wont paste in the same format…

Yeah, all the lines from 14 onward need to be indented a further 2 spaces. :thumbsup:

im sure I tried that but i get a different error now…

2017-06-02 15:46:40 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: invalid template (TemplateSyntaxError: Missing end of raw directive) for dictionary value @ data[‘action’][0][‘data_template’][‘device’]. Got None. (See /root/.homeassistant/configuration.yaml, line 1320). Please check the docs at https://home-assistant.io/components/automation/

Yeah, I can’t help with that error I’m afraid, it’s something to do with your template and I’m only just getting my head round them myself. The error message says it’s something to do with the syntax of ‘raw’ tags if that helps you?

Basically the error is saying that when it parses your template it’s not getting anything back that it can use.

humm ok after removing the raw tags it seems to parse fine… not sure why they are needed? or in the example at all. i will test to see if this works when I get home. thanks for your input!

1 Like