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:

downstairs_windows:
  name: Downstairs Windows
  icon: mdi:window-closed
  entities:
    - 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’ means.so 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 : -

homeassistant:
  customize:
    binary_sensor.neo_kitchen_window01_sensor:
      device_class: window
    binary_sensor.neo_kitchen_window02_sensor:
      device_class: window
    binary_sensor.neo_kitchen_window03_sensor:
      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:

homeassistant:
  customize_glob:
    "binary_sensor.neo_kitchen_window*":
      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: https://www.home-assistant.io/integrations/group/

Is there a way to override this?

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

binary_sensor:
  - platform: template
    sensors:
      downstairs_windows:
        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