Virtual switch to control a group (and serve as a status indicator)

I'm trying to make a virtual switch to use on the Hubitat dashboard that does the following:

  1. It controls a group of lights (i.e. Exterior Lights), so that when the virtual switch is flipped to on, all the lights in the group turn on, and when the virtual switch is flipped to off, all lights in the group turn off.
  2. If any light in the group is turned on, the virtual switch turns on (without turning on the rest of the lights in the group)

My goal is to have a switch on the dashboard that both serves as an indicator of any lights in the group that are on, as well as a switch to turn them all off (or on).

I've tried a lot of different conditional rules in rule machine, but can't seem to figure it out. Perhaps there is an easier solution that I'm not thinking of?

Perhaps the following will help.
One approach:
Use groups (and scenes) and create a group with a unique name for the group.
Put that unique name which is created (the group name) on the dashboard.
When you turn it on, all of the switches that make up the group should turn on.

Off may also work (not sure), or you may have to use a RM4 rule.
P.S. in case that doesn't meet your needs, look into switch binding - a great add on program.

1 Like

I must second the group app idea. I have groups for almost every room/area of my house that has multiple devices. I have most of my groups on the dashboard set as a switch. In rooms with dimming bulbs, I have the group tile on the dashboard set as a bulb. That way i can dim all the bulbs at the same time from the dashboard. When any device in the room is on, the group tile indicates that it’s on. I use the group tiles on one of my main dashboards to let me know if anything in on in the rooms. I have individual dashboards and links to them for each room.

1 Like

Thanks for the suggestions!

So I do have a group set for exterior lights, and in RM4 I made two rules:

  1. when virtual switch is turned on/off, turn on/off the group
  2. when one individual switch in the group is changed, pause rule 1, and then if any light in group is on, virtual switch is set to on, else set virtual switch to off. Unpause rule 1.

Problem I'm getting is that when I turn on one of the lights in the group, the virtual switch will turn on, and then all the rest of the lights in the group will also turn on after a few seconds. It seems to be a problem in pausing rule 1, but I have no idea what's wrong with it.

1 Like

What I do is add the group to the dashboard with a switch template. I don't have a virtual device, I just have the group with the switch template (the group tile takes the place of the virtual switch). When I turn on any light in the group, the group tile lights up to let me know that something in the group is on. And the group tile can also be used to turn on of off everything in the group. I also share the groups with Alexa and it makes it much easier to set up Alexa routines.


Ah interesting, so if I add the group to the dashboard as a switch template, it will light up if any switch within the group is turned on? That looks like exactly what I need to do, will give it a try when I get home later!

1 Like

Yup, that’s the way to do it.

1 Like

When you set up the group, there's an option to select "use group device to indicate if any members are on" make sure that you select that.


Ah that was the missing piece! Thank you guys!!! So excited to get this working