I have a blueprint with a target input. The input can have 3 domains, see below.
light_switch:
name: Lights Switch
description:
selector:
target:
entity:
domain:
- light
- switch
- scene
We then have some variables. In the input target above we can input the domains light, switch, scene we are trying to create a list of only light domain from the input. The variable below called “light_entities” is our attempt to get a list of lights in the domain light but it is not working.
variables:
light_switch: !input light_switch
light_entities: "{{ expand(light_switch.entity_id) | selectattr('domain', 'eq', 'light')|map(attribute='entity_id')|list }}"
we then use the “light_entities” in our target.
sequence:
- service: light.turn_on
target: "{{light_entities}}"
data:
brightness_pct: !input light_brightness
But it is not working.
Would anyone know how to generate a list for a particular domain (light) from a target list that has multiple domains and use that list in a target?