Control Power to Light Group with Switch

Imagine a setup where a series of smart lights are connected to a smart outlet/switch. In HA, it’s currently possible to add all of the lights to a group. The lights within this group can be all turned on/off simultaneously via the group.

However, it may be the case where one wants to use the smart outlet/switch to control the power to all of the lights. In this case, the outlet/switch can be added to the group by first converting it to a light via the “Change the device type of a switch” helper. In this case, the group will still try to turn on/off all of the lights and the switch when turning on/off the group.

The feature request is to add the ability to specify a switch as part of a group of lights where only the switch is turned on/off and the other light controls (dimming, color, etc.) are only sent to the lights within the group.

You can do this, fairly easily, with automations unless I’m missing something.

If you want a sensor on the position of the switch only, just add a helper that is tied to the switch state, then use the helper do do whatever you want.

That would completely separate things.

There are so many ways to do this it is not a valid [FR].

I would like to have a single entity for a collection of lights in my dashboard were I can control their on/off state as well as their other attributes. However, when turning them off, I only want to turn off the main switch that controls them and not send off commands to the individual lights.

I’m certain I can make automations to make this happen, but my request to to make this a feature of the groups helper so that I don’t have to go through the pain of creating a bunch of automations.

This doesn’t seem like a very obscure use case, either. Consider a ceiling fan with multiple smart lights and a smart switch. If using a group to control the lights and the switch, sending an off command to all of them could result in only some of the lights receiving the off command before the switch receives the off command. If the user then manually turns the switch on, the lights that didn’t receive the off command may turn on and the others may stay off.

I understand that there may be other ways to do this, but that doesn’t make asking for a simpler way to be an invalid request.

For most smart lights, this is determined by the default power on behavior which may or may not be configurable. I have Sengled bulbs that turn on when power is restored (e.g. main switch flipped on) regardless of their previous state. I have Hue bulbs that can be configured. The point being, it’s more than just a simple “track the status of the switch”. The group would have to keep track of the bulbs and constantly check to make sure they’re in whatever state HA thinks they should be.

Another thing to consider is flipping your approach. If you have z-based bulbs, they likely act as repeating devices (I think Sengled is one of the only manufacturer’s that do not do this by default) where cutting power could cause mesh instability. Instead of killing power to the switch, typically the more desired approach is to leave the bulbs powered but turned off and not mess with power at the switch.

As you’ve stated, there are lots of possible scenarios, so it seems like having flexibility to allow the user to accommodate their particular situation would be beneficial. I’m not suggesting that a group be required to have “master switch” entity (I realize that’s not the best name, but that’s the idea), but that could be an optional entity that could be configured for a group. By doing so, controlling power to the lights via the group in home assistant can be exactly the same as using the switch on the wall.