Hi everyone
I have an enOcean switch for which I set a different target (light) to be toggled in case the respective button is pressed. For one button I would like to toggle two lights. Unfortunately, I apparently did not correctly use a list in my template, as the below code only works for the single lights:
service: light.toggle
data_template:
entity_id: |
{% if trigger.event.data.which == 1 %}
{% if trigger.event.data.onoff == 0 %}
light.buro_fernsehlampe
{% elif trigger.event.data.onoff == 1 %}
light.zigfred_wohnzimmer_lampen
{% endif %}
{% elif trigger.event.data.which == 0 %}
{% if trigger.event.data.onoff == 0 %}
light.zigfred_wohnzimmer_dimmer
{% elif trigger.event.data.onoff == 1 %}
- light.buro_tisch_links
- light.buro_tisch_rechts
{% endif %}
{% endif %}
How should I phrase the last bit so that a correct list is returned and both lights (light.buro_tisch_links and light.buro_tisch_rechts) are toggled?
Thank you for any hint.