I wonder if I’m asking something impossible or just can’t figure it out.
The goal is:
- you select any # of lights
- automation triggers when any of those lights turn on
What I’ve tried:
blueprint:
name: Corey Motion Test
description: Automate light with motion and timer.
domain: automation
input:
target_lights:
name: Lights
description: Multiple lights to keep in sync.
selector:
target:
entity:
domain: light
variables:
light_data: !input light_data
aux_motion_sensor: !input aux_motion_sensor
target_lights: !input target_lights
target_lights_are_on: "{{ expand(target_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0 }}"
trigger_variables:
aux_motion_sensor: !input aux_motion_sensor
target_lights_are_on: "{{ target_lights_are_on }}"
trigger:
- platform: template
value_template: "{{ target_lights_are_on }}"
id: lights_on
Template variable error: 'target_lights_are_on' is undefined when rendering '{{ target_lights_are_on }}'
Anyway to achieve this in a blueprint? Thanks a ton for any help!