Change group icon according to state - old group style

Hi,
I am not that new to HA, but there is something I just can not figure out.
I have a group which contains all binary_sensors of my window contacts.
The style of this group is the OLD one because I like to see the individual entities when I click on it. AFAIK this does not work when I create a group over the Helper UI menu.

This is my OLD group “Fensterkontakte”:

window_contacts:
  name: "Fensterkontakte"
  entities:
    - binary_sensor.living_room
    - binary_sensor.dinning_room
    - binary_sensor.terrace
    - binary_sensor.office
    - binary_sensor.bedroom
    - binary_sensor.kitchen
    - binary_sensor.bathroom

And for comparison, I have created a NEW group via Helper UI “Fensterkontakte neu”.

On my UI it looks like this:
grafik

When I click on “Fensterkontakte” (old group style) I get:


(thats what I want :slight_smile: :+1:)

When I click on “Fensterkontakte neu” I get:


(thats what I DON’T want, because I can not see the state of each sensor :frowning_face:)

Both group types have the ability to change color according to the state :white_check_mark:.
BUT:
only the new group type also changes the icon. Although the old group type also only contains binary_sensors. Here the result:
grafik
Fensterkontakte (old one): still closed-icon (although open/on) :-1:
Fensterkontakte neu (new on): open-icon :+1:

So my question is:
how the heck can I have a group which behaves like the old group style (click on it and see all individual entities) but change the icon according to the state of the group (like the new ones)?
Can’t we have something like “device_class” for groups?

Thanks and greetings!

I bet the icon colour doesn’t change because some of the group members have an unknown state. An alternative would be using auto-generated groups (service: group.set )

Hey, thanks for the reply!
But I think you got my question wrong or I have not made it clear enough.

The unknown entities are not the problem. The group icon color changes correctly for both old groups and new groups. The groups states are set correctly according to the contained entities (last picture).

Only the icon itself does not change for the old group style.

Sorry, careless mistake. I meant the icon itself.
I only use the old-styl for the reasons you mentioned. Everything works as expected as long as the state of the group is binary. Other reason could be that you customized the icons?

Okay, could you specify this a little bit? Do you mean that you have binary-only groups in old-style (like in my case above), that change color AND icon according to state?! How?!

No, at least not in the yaml. The window icon comes from a manual configuration via UI. Otherwise I would have the standard group icon (three dots in a circle).

Those old-style groups also change only between on/off or closed/open.
I think that we would need something like a “device_class” entry for groups as well. :thinking:

Ok, that was all rubbish. I tested it with a “mixed” group in the old style with on/off/unknown/unavailable members and despite this the icons are displayed correctly.

Do you mean the icon itself changes according to state (open/closed window, on/off switch…) OR only the color changes correctly?
I stress this difference so much, because in the first case the error would be in my side because my icons do not change, only the color.
And in the second case we would be sharing the same problem.

I was meaning the icons of the group members themselves. The icon of the group doesn’t change, only its color.

But what I just noticed, is that when I create a group without assigning an individual icon, the standard icon appears (the circle with the three dots in it). With your old-style group a window icon appears.

you are aware we can use the ‘Show as’ in the UI on those new groups?
it doesnt change the icon in the Helpers listing, but they do change in the UI.

cant use Motion (eg on a grouped set of motion sensor switches…) , or Update ( grouped update binaries) on those, but many others are available

We’re talking about the old-style group.

Yes, but this is only because I have changed the icon manually by editing the entry on the card via the lovelace itself.

@Mariusthvdb thanks for the tip! But yeah, this applies only to new-style groups.
I personally prefer to use the old-style groups because of the better access to the individual entities. The only only drawback is that the icon does not change!

Again, a “device_class” feature for old-style groups could solve this. Maybe I open a feature request…

There is already a feature request about that: Group State Display - device-class
Please vote :wink: .

Interesting: the TO gets the tip to create new-style groups via the UI, but he does not want to because of the same reasons as we…

Yes, I read this and had to smile :+1:
I also don’t like the limited nature of the new groups. I want to put entities of my choice in my groups.

Btw, you certainly can iterate the ‘new style’ Ui groups, just like we can the light groups.

That should not be a reason to avoid these

I must confess that I don’t really know what you mean. Could you please describe this a little bit more in detail? What do you mean with “iterate”?
What I (we) talk about is the functionality of the old groups where you can click on the group and see all members with all their states. This is currently not possible with new groups afaik.

You mean in the Frontend and have the More-info window show the members? Id have to check that.
Yes they’re there:

Not pretty, but the members are in the attributes

I meant iterating in a Jinja template where we can list all members and reject/select , manipulate as you wish

Yes, I think most of us knew that you can see the members under attributes (at least I did).

But c’mon, this is definitely not comparable to that what you get when you click on the old groups.
It is not only “not pretty”. You get no information about the individual state und you also can’t modify them.

Compared to the old groups, the new groups are nothing more but a logical sum of their members.
For some cases this might be perfect, no offense!
But currently the old groups have definitely advantages over the new groups. Only the visual feedback (the icon) is not as good as with the new groups.

Afaik the old groups are not planned to be removed so soon.
And I am sure that implementing a better icon behavior (device_class) for the old groups is less complicated than changing/improving the members access for the new groups (if possible/planned at all).

No they are here to stay , have a lot of additional value (mixed groups, groups of more domains) and versatility.

As stated in the docs btw.
So, what are you asking now ? How to change the icon ?

3 ways at least.
Install custom-ui;-)
Use card_mod
Use template-entity-row

There are more ways, like using custom button-card. Or other cards……

Well, what I/we ask for is what the thread title says :slightly_smiling_face:. The icon of the old groups should change according to the overall group state. Automatically as for other entities with a device_class entry.
The overall group state is set correctly, what can be seen in the entire state and in the icon color. Only the icon itself does not change. And that’s what we wish.
Spontaneously and logically I would think about either a device_class entry for old-group-entities (because this already exists for non-group entities) or a new option which could be called “group_class” and does basically the same like “device_class”.

Sidenote: there is a quite old feature request for exactly that. So I am not the only one who wishes for that :wink: