i have this automation that on condition of the MQTT message turns on a specific script:
trigger:
- platform: mqtt
topic: 'zigbee2mqtt/double_switch_keuken_schuifdeur_links'
action:
- service: script.turn_on
data_template:
entity_id: >
{%- if "\"left\"" in trigger.payload and is_state("light.light_spots_kozijn", "off") -%}
script.light_spots_kozijn_on
{%- elif "\"left\"" in trigger.payload and is_state("light.light_spots_kozijn", "on") -%}
script.light_spots_kozijn_off
{%- elif "\"left_double\"" in trigger.payload -%}
script.light_brightness
{% else %}
script.nothing
{%- endif -%}
How do i add a variable that contains the specific light i want to turn on/off our change brightness
light: >
“{{light.light_spots_kozijn}}”
is valid YAML but not accepted in Hass when it’s triggered.
I don’t get this…