Lightgroup missing in states.light listing

I’ve created a lightgroup in the gui.
Checking the state in the Template editor like this:


The result is: 'on'

But when using

{{ expand(states.light) | selectattr('state', 'eq', 'on') |
    map(attribute='entity_id') | list 

the entity light.spotlights_eingang (in fact all lightgroup entities) are not in the list.

What`s the reason for that?
Thank you in advance

Btw. In Template Editor on the very right side, it is stated that the whole domain light (including the entity light.spotlights_eingang) is being watched for changes

Because you’re expanding the light domain. Don’t expand it, you already have the state objects.

{{ states.light | selectattr('state', 'eq', 'on') |
    map(attribute='entity_id') | list 

expand is specifically designed to expand grouped entities into a list of their state objects.

quick and simple. Thank you @petro