Template light group

Hi,

I’m struggling to create a light group for all lights in a specific area.
The objective is to be able to control the light in a certain area as a group.

This is the code im using:

- platform: group
  name: "Livingroom Lights"
  unique_id: light_group_livingroom
  entities: >
    {{ area_entities('Livingroom') | select('match', 'light.') | list }}

When i check the configuration i get this message:

Configuration warnings
Invalid config for 'group' from integration 'light' at light.yaml, line 4: Entity ID {{ area_entities('Livingroom') | select('match' is an invalid entity ID for dictionary value 'entities', got "{{ area_entities('Livingroom') | select('match', 'light.') | list }}"

If someone can point me into a direction an solving this i would really appreciate it!

Unfortunately the entities list for groups does not allow templates. So your only way out is to create a ‘regular’ template light and implement the group logic yourself. Or just name the entities here.

The docs help you to see where templates are supported. If supported, the parameter is explicitly named as type template.