Group items & forEach loops

That is the equivalent to the following code:

if(gLightAll.allMembers != null)
    gLightAll.allMembers.forEach[ ...

It is a shortcut to test for null and if it is null skip over the statement. I personally don’t use ? in this context any longer because I want an error if for some reason allMembers is null when I expect it to not be null.

In what way did it not work?

I don’t really use subgroups so have no experience to draw upon but it seems like it should work. However, you might need to define the subgroups as Switches too.

Group:Switch:OR(ON, OFF) LowerGroundLightA (AllLight)
...

Short of using the Groups directly, the forEach loops are probably your best bets.