Light Groups control order

Light Groups are awesome. However I’m finding that the control order of the individual lights within a group is non-deterministic. Assuming I have lights 1, 2 and 3 in the group, if I turn the group ‘on’, sometimes the order will be 2, 1, 3 or 3, 2, 1. Same with off.

Is there a way I can force light 1 always to be the first on and off?

Use case:
I have three- and four-way switches that I’ve replaced with smart switches. In these physical groups, only one switch actually switches a load; the others are basically just remotes. The switches are linked with each other so that when one physically turns on, the rest do the same. Because of protocol limitations (Insteon), the group doesn’t stay in sync when a single device is commanded by a controller, and the group doesn’t support brightness/dim commands. I’m relying on HA’s light group feature to overcome these limitations, so that I can keep all switches in sync and still easily command a group to dim/brighten. However, because only one switch carries a load, if either or both of the remotes are commanded first, there is a noticeable lag between when the command executes and when the light turns on. I’d rather have the remote switches lag.

Alternative:
Is there a way I can achieve the same functionality by avoiding light groups, and commanding just the load switch directly, but then subsequently get the other remote switches in sync?

Open to ideas.

Many thanks in advance.

I don’t think you can do that with a Light Group, but you could do that with a script. It would look something like:

script:
  turn_lights_on:
  sequence:
  -  service: light.turn_on
     entity_id: someid
  - delay:
      seconds: 1
  -  service: light.turn_on
     entity_id: some_other_id  

and so on.

The lag issue seems to be harder. I guess you will have to live with it. Zigbee for e.g. allows what is called binding of switches and bulbs. That way, the switch and the bulbs communicate in a peer to peer fation. Thus the lag is as small as it gets. Insteon has its own custom protocol I would start looking there for a solution.

Thanks. Some clarification.

The source of the lag is from Home Assistant, not the protocol. Controlling the load switch alone via HA is near-instantaneous and certainly within acceptable tolerance. Controlling the group however gives the impression of extreme delay when the load switch is not the first to be turned on or off. That is because HA (or perhaps the ISY994 integration) is randomly choosing the order to control the individual switches. Watching the sequence, it’s almost as if each control request is sent and blocks while waiting for an acknowledgement before moving onto the next (although it’s unclear if the blocking is HA or the ISSY994 simply queueing up messages; insight from other users about their systems’ behaviors would helpful). Controlling the entire group seems to take upwards of n-1 seconds, where n is the number of devices in the group, so up to 2 seconds in a switch group of 3. A group of 1 behaves almost exactly the same as an individual switch in terms of timing. It seems like strange behavior–not sure if this would qualify as a bug or feature request; either to send control requests asynchronously, or to be able to specify the order of control so that at least the load switch can be the first to turn on or off.

The script sounds promising in theory, but how do I attach that to a switch? I guess I would have to write a unique script for each light group, and then for each control action (including dim and brighten)? Can it support variables to reduce duplication?

Via an automation that triggers when ever the switch changes.

yes but maybe a blueprint could hep out.

Yes they can.

It confirms my finding. While it’s not crucial in my case, I also noticed delays between lights being part of the light group. But never did analysis to draw such conclussion.

Maybe it’s worth to report it to github.

Isn’t a group some form of list?
In that case one could order the list (alphabetically?) and then switch off/on each element in the list.
I would be interested in how to code such a thing.