Using groups with expand filter

I have several labeled thermometers, so am using an expression such as follows to populate a drop down. One of the entities I want in the drop down is a group, which is an average of the other thermometers. When I do:

label_entities('EEVAC Thermometers') | expand | map(attribute='name') | list

the averaging group is removed from the list. I understand that this is part of the behavior of expand, though in this case I don’t want that omission as I want the group itself (the average) to show up and go into the dropdown selection list along with the other thermostats.

Any thoughts how to make that happen?

Is there something else besides besides expand to use there that I don’t know about?

Does expand have options I don’t know about, i.e. some way to avoid the recursive behavior of group expansion? I’ve tried turning on the group Options to Hide members to no avail.

According to the documentation, expand doesn’t have any options to modify its behavior.

Here’s a way to do it that keeps group entities intact.

{{ label_entities('EEVAC Thermometers')
 | map('state_attr', 'friendly_name')
 | list }}
1 Like

Thank you!

You’re welcome!

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.

For more information about the Solution tag, refer to guideline 21 in the FAQ.