Label entity dashboard toggle

I have labeled several switches as ‘Xmas Lights’, and would like to toggle the respective switches from one button on my Dashboard.

Sure, I can easily create a Group, though I was hoping to create a toggle of the associated devices/entities via label. I’ve tried creating an Entity, but can’t figure out how to associate the label to the entity. Maybe this requires don’t type of Template?

Suggestions?

Just to clarify, is what you want a button on the dashboard or a toggle?

Both are possible, but if you want a toggle that tracks a summarized state like a Group would, your best bet is a Template Switch.

Thanks; pardon the confusion, I do want a toggle.

In the template, how do I identify a label?

eg, here’s a binary sensor… What would a label look like?

{{ is_state('binary_sensor.skylight', 'on') }}

You would use the label_entities() function.

Building Templates - Labels

If you are setting up a Template Switch, you will use it in multiple configuration variable definitions including state, turn_on, and turn_off. The specific templates will depend on whether you want “all”, “any”, or “proportional” group behavior.

Another option (maybe not so clean looking), but if you’re okay with all the individual entities being listed in the card. You could just use an Auto-Entities Card. It has an option that adds a header toggle that will toggle everything on or off using “any” group behavior.

type: custom:auto-entities
card:
  type: entities
  title: Xmas Lights
  show_header_toggle: true
filter:
  include:
    - options: {}
      label: Xmas Lights
      domain: switch