Group of open/close sensors shows on/off state instead of closed/open

I created a group with all my window sensors to easily see if they’re closed or open:

  name: Downstairs Windows
  icon: mdi:window-closed
    - binary_sensor.openclose_35
    - binary_sensor.openclose_37
    - binary_sensor.openclose_36
    - binary_sensor.openclose_38
    - binary_sensor.openclose_32
    - binary_sensor.openclose_33
    - binary_sensor.openclose_34
    - binary_sensor.openclose_30
    - binary_sensor.openclose_31

However, the group doesn’t have the same states as the sensors. the sensors have open/closed whereas the group has on/off. Is there a good way to change it so the group also shows open/closed?

btw, I currently use the fold-entity-row card.

Set the device class in customisation

Can you apply device classes to groups?

I get that and they’re all binary sensors but the group “Downstairs Windows” does not have a device class.

No, I meant apply them individually and the group will follow suit

the devices are all set to binary sensors. but the group itself isn’t showing the right attributes.

You can use the customize section.

The problem is that the entities are on or off, so the group follows. The UI displays Open and Closed because of the device class.

There’s no easy fix for what you’re doing I’m afraid.

Apologies, I was going for a drive by solution and did not check on your familiarity with HA.
As Tinkerer above points out ALL binary sensosors are just that, they are either ‘on’ or ‘off’
The device class applied to that sensor allows the front end to interpret what ‘on’ means and what ‘off’ that can be presented in the front end.
They are still just on and off.
The way to use device class is (as @KTibow says) add a customisation: customize: key to your configuration (it has to go under the homeassistant: key and indented 2 spaces)
Then just follow the examples in the link I posted above.
The documentation covers all sorts of these golden nuggets

If you include a random selection (given settings) of devices in a group, unless they are the same ‘device class’ you will get what you observed.

Here is a section from one of my files : -

      device_class: window
      device_class: window
      device_class: window

You will need to add each of your devices in a similar fashion.
Then when you group them they will all be singing the same tune.

Note: the spacing is important
homeassistant: has no spaces before it
customize: has 2 spaces before it
binary_sensor.whatever has 4 spaces bofore it
device_class: whatever has 6 spaces bofore it

None of this helps asdas. His sensors are fine. The group is the problem.

Also just fyi you can simplify your customisations to:

      device_class: window

Correct tom_I. My sensors are fine as shown on the screenshot. However groups only have the values on/off/home/ and not open/close as per:

Is there a way to override this?

Instead of using a group you could use a template binary sensor:

  - platform: template
        friendly_name: "Downstairs Windows"
        value_template: >-
          {{ is_state('binary_sensor.openclose_35', 'on') or
             is_state('binary_sensor.openclose_37', 'on') or
             is_state('binary_sensor.openclose_36', 'on') or
             is_state('binary_sensor.openclose_38', 'on') or
             is_state('binary_sensor.openclose_32', 'on') or
             is_state('binary_sensor.openclose_33', 'on') or
             is_state('binary_sensor.openclose_34', 'on') or
             is_state('binary_sensor.openclose_30', 'on') or
             is_state('binary_sensor.openclose_31', 'on') }}
        device_class: window
1 Like