Hi everyone,
I’m trying to set up a blueprint automation for some lights. As part of it, I want to trigger every time the lights are toggled. I ask for the lights in the input section and then I have:
mode: single
trigger_variables:
trigger_source: "other"
lights_target: !input the_lights
light_entities: >
{% set entities = lights_target.entity_id if lights_target.entity_id is defined else [] %}
{{ entities }}
trigger:
- id: toggled_outside
platform: template
value_template: >
{% set lights = variables.light_entities %}
{% set changed_entity = trigger.to_state.entity_id %}
{{ changed_entity in lights and (trigger.to_state.state == 'on' or trigger.to_state.state == 'off') }}
This is how the variable looks like:
lights_target:
entity_id:
- light.all_lights_hall_lights
light_entities:
- light.all_lights_hall_lights
At the moment, this isn´t throwing any errors but when I toggle the light the automation won´t trigger. Does anyone have any ideas?
Thanks in advance.