Help with Groups

Hi all

I have a stack of lights inside and outside the house.

Ive created a group for them and use SUM to determine if any 1 of the group is on, this works fine for the individual inside, outside groups.

My question is, now im writing a rule that will switch off everything in the house when I leave - to do this, I used a new group, gAllLights, which has child gInsideLights and gOutsideLights.

For some reason, my state of gAllLights is off, despite gInsideLights being ON.

Clearly ive missed something. I found this doco - https://www.openhab.org/docs/configuration/items.html#item-definition-and-syntax but it wasn’t overly clear to me on how to do this.


Group:Switch:SUM gInsideLights (gAllLights)
Group:Switch:SUM gOutsideLights (gAllLights)
Group gAllLights


Thanks!

I try to avoid nested groups. It makes it harder to see what’s happening
In your case, just add all the lights to the new group

And loose the inside/outside differentiator? I could do that…

Keep the existing groups and add the lights to the new group
This way you keep your inside/outside and have the functionality you are looking for
Something about stones and birds comes to mind

1 Like

Or

You could do this:

Group:Switch:OR(ON, OFF) gInsideLights (gAllLights)
Group:Switch:OR(ON, OFF) gOutsideLights (gAllLights)
Group:Switch:OR(ON, OFF) gAllLights
1 Like

Hi Vincent, I think ill just make the lights part of both groups. My network is small, it may be even overkill to do inside and outside groups! Who am i kidding :smiley:

You have to give gAllLights a type.

Group:Switch gAllLights

That was the source of the original error.

But I too recommend having the Items be members of both groups instead of setting up a hierarchy. I find that thinking about Groups as sets rather than a hierarchy results in simpler configurations over all.

2 Likes