Use group entities instead of group on card

I’d like to have some cards/dashboards get the entities from a group instead of the group itself such that I only have to add the entity to the group and the card updates automatically (or on a refresh of some kind). This seems like the DRY way to do things and doesn’t seem like it should be too hard in the code.

So, say I have a group (from group integration doc):

- binary_sensor:
  - platform: group
    name: "Patio Doors"
    device_class: opening
    entities:
      - binary_sensor.door_left_contact
      - binary_sensor.door_right_contact

Now, I’d like to show those entities individually on an entity-filter card; the current method (as far as I can tell):

type: entity-filter
entities:
  - binary_sensor.door_left_contact
  - binary_sensor.door_right_contact
state_filter:
  - "on"
card:
  type: glance
  title: Doors On

What I’d like is something like this:

type: entity-filter
entities:
  - entity: group.patio_doors
    type: entities
state_filter:
  - "on"

That syntax may or may not make sense, but I think the idea makes sense. Anyone aware of a way to do that already? Anyone that has done any development in Home Assistant, can you provide insight as to how difficult something like that would be to implement? I haven’t dug in yet to see what the code around those things looks like to see if I’m even capable, but I am curious.

Thanks!

Any luck on this? I’m also curious on how to make a card showing all of the entities in a group instead of just the group entity.

{{ expand('light.test_group')|map(attribute='name')|list|join() }}

will give you the list of entities in a group

This allows you to make a template sensor with the list of entities and etc…