How to display proper binary_sensor statuses for groups

I have multiple door/window sensors that sit in two groups: ‘window_sensors’ and ‘door_sensors’. Right out of the box these sensors showed statuses ‘on’ or ‘off’. By correctly setting the entity_class to either ‘door’ or ‘window’, the statuses ‘open’ or ‘closed’ are shown for the individual sensors. However, for the groups still ‘on’ or ‘off’ is shown.

2019-06-21%2017_08_12

My question is: how can I configure the groups to properly show ‘open’ or ‘closed’ statuses, instead of ‘on’ or ‘off’?

Group config:

door_sensors:
  name: Deursensoren
  control: hidden
  entities:
    - binary_sensor.openclose_voordeur
    - binary_sensor.openclose_serredeur
    - binary_sensor.openclose_tussendeur_garage
    - binary_sensor.openclose_garagedeur

You may use a template sensor to wrap the door_sensor and use that:

sensor:
  - platform: template
    sensors:
      doors_state:
        value_template: >-
          {% if is_state('group.door_sensors', 'on') %}
            Open
          {% else %}
            Closed
          {% endif %}

Thank you for your suggestion! Using a template would indeed show the correct group status, but would unfortunately also cause the group insight to be lost. Meaning that by selecting the group, I can now see the contained entities. By using the template sensor, I can only see the group status.

Isn’t there some attribute on group level to indicate that it contains ‘door’ entity_class items?

Remember to create a template binary sensor. This can have the door device class. The value is even simpler. It’s always equal to the group value.

No. But you can have both the group and the template sensor.

But why create a group in the first place? You can add a glance or entities card to the UI? For automations other strategies are possible.

I do use it within a glance card. Within this card I would like the proper group status shown (or if not possible, the template binary sensor status). What I want to maintain as a functionality however, is the ability to see the status of all underlying binary sensors of the group. Hopefully below two screenshots explain how I use it.

This is the glance card, where I would like to see ‘Closed’ instead of ‘Off’ (or ‘Uit’ in Dutch):

And this is the group contents I see (and want to keep seeing) when I select ‘Doors’ (or ‘Deuren’ in Dutch) in the Glance card:

Unfortunately in that case I see no other option than showing both the template binary sensor AND the group.

Ok, clear. Thank you for your help!