Hi all, thanks for the great community support. My latest learning question: is there a way to something like below to avoid, in this example, having to hard code a list of light entities? Below result is a correct list, but it throws up an error as I imagine its not the expected format for the yaml.
- platform: group
name: "All Lights"
unique_id: all_lights
entities: >-
{{ states.light
| rejectattr('state', 'eq', 'unavailable')
| rejectattr('entity_id', 'match', '.*_group.*')
| rejectattr('entity_id', 'match', '.*_lamp.*')
| map(attribute='entity_id') | list
}}
(I’ve tried variations with | join('\n -')
for example but no success and stabbing in the dark.)