Slow to turn off a light group of large number of lights

I grouped the lights in each room into a light group, and also created a downstairs group to including all room groups on the first floor. The downstairs group is used to turn off all the lights before I go to bed in the night. Although there are 10+ lights in the group, when turning off the group, there are usually only 2 or 3 lights on.

I noticed after turning off the group, it takes quite a long time (tens of seconds to minutes) to start seeing the actual lights off. My guess is that HA actually sends the command to every lights one by one including the lights are already off. If so, maybe an optimization can be to send the command only to the lights that are currently on.

What kind of light switches are these (zwave, wifi, bluetooth?), and how many switches in a group?

I have a Good Night automation that turns off all of the lights in the house. Maybe this is stupid, but I turn them off in small groups of 5ish, then add a half second delay and move to the next group. The thought being that I don’t want to bombard HA (or my Lutron Caseta bridge or my Hue bridge) with a bazillion commands at once. I wonder if doing it that way would help you?

They are all zwave, a mix of dimmer switches (recognized as lights) and simple switches (I have set them as lights). The downstairs group contains 4 room groups of the public area: family room (6 switches), garage (2 switches), kitchen (8 switches), and living room (7 switches). There is one switch for a ceiling strip shared by 3 rooms. So there are actually 21 lights in total.

@_Mike thanks for the good suggestion. I know there are alternatives to turn off all the lights. But I hope the simplest way (using light group) can just work efficiently. So I wonder something can be optimized.

I also use zwave and changed from using groups to zwave scene’s.