Maybe this is expecting too much, but as I mainly program i languages where the “set” idea is important, i tend to want to think in sets.
Ok, so if I have a group gOutsideLights that contain all lights outside. Now, some of them are dimmable, so I store these in a separate group also gDimmable. I can get all members of each group using e.g. gOutsideLights.allMembers and do stuff like gOutsideLight.members.forEach(i | i.sendCommand(ON)).
Ok, but some dimmable lights will then go to full blast, and that is not what I want, so it would be preferable to handle dimmable lights separately in my rule. However, what is then the most elegant way of getting the list of items that are members of both groups?