Have lovelace "header_toggle" toggle any groups that are in the card

Basically, I’d suggest that the header_toggle also toggles the entities in any groups that are listed. Currently, this:

- type: entities
  show_header_toggle: true
  entities:
    - group.my_light_group
    - light.my_light

will not toggle group.my_light_group, only light.my_light.

While I would mostly want to use this with the folding_group add-on (see the add-on and details in this issue), it could also make setup of cards a bit easier, enabling the groups.yaml (that I, personally, haven’t used since lovelace came along) to contain “packages of components” that you might want to reuse in different cards.

But mostly for the very cool folding_group.

Thnx, I was wondering about the header_toggle not switching the groups in that card and started to dig a bit through the code. Haven’t found a solution yet, though.

Cool. I’m not really competent enough to look into the code, but if there’s anything else I can do to help, let me know!

I am new here :slight_smile: I just started with Home Assistant yesterday and so far I have to say that I am really impressed! Everything went very smooth.

This topic is the first issue I am having that I can’t seem to fix easily. Is there a particular reason why the head toggle is not switching the enteties in a group?

Could someone lead me into a direction how I could fix this?

Could you post your ui-lovelace.yaml here?

Or you can take a look at mine here. Search for custom:fold-entity-row to see an example.

The one that has head: light.dining_room_lights in it switches all the lights in the group.

Remember the thing under head is what is toggled by the header switch. So I have light.dining_room_lights, which is a light group that includes all the lights within the card.

@Aephir, thanks for your file. I don’t have that head attribute there. Tried that - though that didn’t help me either.

My relevant part looks like this:

entities:
  - entity: light.858786400cc50e450d9dc
  - entity: switch.stehlampe
  - entity: group.o_livingroom_lights
  - entity: switch.20856901cc50e3d077e0
  - entity: switch.2880320284078e9acfc5
show_header_toggle: true
title: Light
type: entities 

The problematic group is the “group.o_livingroom_lights” Could the relevant difference be, that my gtroup is not a light group but just a general group (it contains only plugs)?

Ahhh, I think I misunderstood what you were trying to do. I made this post specifically about wanting this for the custom card “fold-entity-row”.

That said, yes, I’m pretty sure you can’t toggle a group like this. If every entity in the group are lights, then I’d make a light group. Then it will still have a name like light.my_ligh_group, and behave as a single light.

Ahh, I got you! Sorry for hijacking your post.

No problem, let me know if it ends up working for you.

I figured that I can use the light.template as a workaround. Though from a user perspective I still consider this more as a bug than as missing feature. When you switch that toggle, you just expect everything below to toggle and not just the lights.

Thanks for your help, @Aephir. I checked your setup on github. Pretty impressive!

More messy than impressive, but thanks. And good to hear you found a solution!