alias: 'Adjust Google Home volume based on Lighting mode'
trigger:
- platform: state
entity_id: input_select.lighting_mode
state: 'Evening Normal'
- platform: state
entity_id: input_select.lighting_mode
state: 'Evening Dim'
- platform: state
entity_id: input_select.lighting_mode
state: 'Movie'
- platform: state
entity_id: input_select.lighting_mode
state: 'Lights Off'
condition:
condition: or
conditions:
- condition: state
entity_id: media_player.kitchen
state: 'idle'
- condition: state
entity_id: media_player.kitchen
state: 'paused'
- condition: state
entity_id: media_player.kitchen
state: 'off'
action:
- service: media_player.volume_set
entity_id: media_player.kitchen
data_template:
volume_set: >
{% if trigger.state == 'Evening Normal' %}
0.7
{% elif trigger.state == 'Evening Dim' %}
0.3
{% elif trigger.state == 'Movie' %}
0.5
{% elif trigger.state == 'Lights Off' %}
0.2
{% endif %}
So I get an odd error regarding the key for volume set here. Anyone see whats wrong?