I have a script field entity type with multiple entities selected. I am passing in two groups (each group contains one or more light entities) into the script field. In the script when I expand the field I get a list of all the lights.
alias: test Automation
description: ""
trigger: []
condition: []
action:
- service: script.test_script
data:
light_groups:
- group.fr_z1_lights_group
- group.fr_z2_lights_group
mode: single
alias: test script
sequence:
- repeat:
sequence:
- service: logbook.log
metadata: {}
data:
name: testx for each
message: "{{ repeat.item }}"
for_each: "{{ expand(light_groups) | map(attribute='entity_id') | list }}"
fields:
light_groups:
selector:
entity:
multiple: true
name: Light groups
required: true
Log result:
light 1
light 2
light 3...
However, I want a list of the groups not the lights. How do I get a list of the groups?