Best way to check and turn off numerous entities

Hello all.

Question about the most efficient way to turn off a lot of entities. Currently, I have around 120 devices spread across a number of rooms. I’ve created groups for each room and its devices, primarily so I can build a Good Night routine that turns off each group when run. This works fine, though it probably takes around 20-30 seconds to complete everything, as it seems to move sequentially through the rooms rather then in parallel. The time is not really a problem, but it did get me wondering if there is a more efficient way to do this.

In reality, most of the entities are probably already off when this routine runs, so is there a better way to do this, maybe by checking their state before trying to turn them off? Does this matter at all, or is there no real difference in HA checking vs just trying to turn off devices that are already off. In particular, how does this work with Z-Wave, as that’s what most of the devices are. Does HA determine what devices are on and off first and then only tell the Z-Wave integration what to turn off, or does it try to turn everything off and let the device determine that it’s already off so there’s nothing for it to do?

Thanks in advanced!

Z-Wave supports the concept of native groups and scenes (not to be confused with Home Assistant’s groups and scenes). If you have a Z-Wave group, consisting of 25 devices, a single Z-Wave command can be used to turn them all on or off (all 25 devices receive the command simultaneously).

In comparison, when you turn off a Home Assistant group, each member of the group is sent a ‘turn off’ command.

Thanks for the information! So it sounds like turning off Home Assistant groups will send unnecessary commands via Z-Wave then. I assume that Z-Wave doesn’t care about device ‘type’ like Home Assistant does, correct? For example, Home Assistant separates lights, switches, and fans into seperate domains, I’m guessing Z-Waze just reconize the same command between those device.

Does zwavejs support Z-Wave groups or is that a feature still to be added? How would the Z-Wave group show up in Home Assistant, just as another enitity? Thanks.