Hello Bahnburner,
I am trying to configure harmony the way you suggested but something is not right with my automation. Input select menu is fine, and I also can get the current harmony status fine with sensor, but the automation does not work. I am getting the following errors:
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][‘activity’]. Got None. (See /config/configuration.yaml, line 131). Please check the docs at https://home-assistant.io/components/automation/
Failed config
automation:
- action: [source /config/automation/remote/harmony.yaml:7]
- activity: {% if is_state(“input_select.harmony”, “Watch TV”) %}
28476264
{% elif is_state(“input_select.harmony”, “Watch Apple TV”) %}
10294440
{% elif is_state(“input_select.harmony”, “Watch DVD”) %}
10294462
{% elif is_state(“input_select.harmony”, “Listen to Music”) %}
10294480
{% else %} {% endif %}
data_template: None
entity_id: remote.csizas_harmony_hub
service: remote.turn_on
- data_template: [source /config/automation/remote/harmony.yaml:24]
option: Select Input
entity_id: input_select.harmony
service: input_select.select_option
alias: Set Harmony
hide_entity: True
trigger: [source /config/automation/remote/harmony.yaml:3]
platform: state
entity_id: input_select.harmony
from: Select Input
- action: [source /config/automation/remote/harmony.yaml:33]
- entity_id: remote.living_room
service: remote.turn_off
- data_template: [source /config/automation/remote/harmony.yaml:38]
option: Select Input
entity_id: input_select.harmony
service: input_select.select_option
alias: Harmony Off
hide_entity: True
trigger: [source /config/automation/remote/harmony.yaml:29]
platform: state
entity_id: input_select.harmony
to: PowerOff
- action: [source /config/automation/remote/harmony.yaml:46]
data_template: [source /config/automation/remote/harmony.yaml:48]
entity_id: input_select.harmony
option: {{ states.remote.csizas_harmony_hub.attributes.current_activity }}
service: input_select.select_option
alias: Harmony Update
hide_entity: True
trigger: [source /config/automation/remote/harmony.yaml:43]
platform: state
entity_id: remote.csizas_harmony_hub
And here is my configs:
input_select.yaml
harmony:
name: Harmony Control
options:
- Select Input
- Watch TV
- Watch DVD
- Watch Apple TV
- Listen to Music
- PowerOff
icon: mdi:monitor
harmony.yaml
- alias: "Set Harmony"
hide_entity: True
trigger:
platform: state
entity_id: input_select.harmony
from: 'Select Input'
action:
- service: remote.turn_on
entity_id: remote.csizas_harmony_hub
data_template:
activity: >
{% if is_state("input_select.harmony", "Watch TV") %}
28476264
{% elif is_state("input_select.harmony", "Watch Apple TV") %}
10294440
{% elif is_state("input_select.harmony", "Watch DVD") %}
10294462
{% elif is_state("input_select.harmony", "Listen to Music") %}
10294480
{% else %}
{% endif %}
- service: input_select.select_option
entity_id: input_select.harmony
data_template:
option: "Select Input"
- alias: "Harmony Off"
hide_entity: True
trigger:
platform: state
entity_id: input_select.harmony
to: 'PowerOff'
action:
- service: remote.turn_off
entity_id: remote.living_room
- service: input_select.select_option
entity_id: input_select.harmony
data_template:
option: "Select Input"
- alias: "Harmony Update"
hide_entity: True
trigger:
platform: state
entity_id: remote.csizas_harmony_hub
action:
service: input_select.select_option
data_template:
entity_id: input_select.harmony
option: >
{{ states.remote.csizas_harmony_hub.attributes.current_activity }}
configuration.yaml (line 131 is the group definition)
group: !include groups.yaml
automation: !include_dir_merge_list automation
script: !include scripts.yaml
I would appreciate any help.
Thanks