Virtual Device/Combining Devices for on/off control as a group

I am sure there is an easy way to do this…but I did not see the answer in my searches.

I have 3 outside lights (Front, Back and Side Landscape lights).

If I want to turn them all on…Instead of turning them each on/off… is there a way to combine into one virtual switch that when I turn it on all 3 turn on and when I turn it off all 3 turn off.

I still want to be able to turn them on individually if needed, but want to save time with a virtual switch?

Is this done thru a group function or some other way?

There’s many different ways to do this. You can group them. You can list all entity_id’s to the service call. You can put them in a single area. The choice is yours

The group function does not appear to work as expected. If one of the switches is on then the group is on. That was not my intent. If I want to turn them all on or off at once can I create a switch to do that. I do not want the switch to be on if only one or two of the switches are on. Not sure I described it well enough.

I defined the group as follows:

outside_lights:
  name: Outside Lights
  entities:
    - switch.outdoor_appliancelinc_14_44_1a
    - switch.outdoor_appliancelinc_14_44_2b
    - switch.outdoor_appliancelinc_14_44_3c

When I turn on one of the switches “Outside Lights” says its “on”. Not really what I intended.

Add all: true to the group config then. Take a moment to read all the group configuration options.

1 Like

Then turn on “all entities” for the group, but either way there is no switch that can accurately represent mixed states unless you create a tri-state control. If the group is only on when all lights are on, you cannot turn all off if only one light is on.

If you create groups in yaml, the details page for the entity will list all separate entities though, so if you open that you can control the individual lights in the group.

So I suggest you use scenes or scripts to turn all lights off or all lights on. You can start these regardless of the states of all lights. I have a script for all kinds of lighting arrangements: standard, work, eat, game, soft, sleep,… You can create buttons in the dashboard to trigger them (click, not toggle).