Groups

Have I missed the point on Groups, I thought they were supposed to to be Hierarchical?

I have setup the following in my items:

//Light Groups
Group gall_lights "All Lights" <lightbulb> (gofficelights)

The group gall_lights has the Living Room and Kitchen Lights in it,
The group gofficelights has the office lights in it.

When I run a rule with

gofficelights.sendCommand(100)

in it, the Living Room and the Kitchen lights come on as well?

Is that correct?

Ian

Your config make gall_lights a member off gofficelights, so your sendCommand is correctly switching the kitchen lights.

Oh, I assumed that as it was Hierarchical as described in the docs, it would work top down.
Can it be changed with the aggregation function, or is that only for status?

It does.
Your set up has gofficelights at the top,
gall_lights is a member of gofficelights.
Send a command to gofficelights and it gets passed to any direct members, also to member gall_lights, and so to any of gall_lights members.

You probably meant to make it the other way round.
You tell your Items (including Group types) which groups to be members of.
(Not tell your Groups what they have for members)

Group mySecondLevelGroup "blah" (myTopLevelGroup)

Yes, only for status.

2 Likes

Of course, as in the same syntax as adding an item in to a group, makes sense now.
Any chance of explaining that in the docs for others not to fall in the same trap?

It’s right there in the example

There is a LOT to pick up when setting out with openHAB, but when you get the inevitable unexpected snags it’s worth reviewing the docs and examples (including in these forums) for misunderstandings.

Maybe we could add something visual to that part of the article.

Just a short hierarchical diagramm for example:

We could then fill this with some more openHAB related informations like example item definitions aside of this example house structure.

Maybe someone is interested in providing something with draw.io :slight_smile:

I think for me, this Example needs to be expanded to look like this:


```csv
// Overarching group
Group House
// Location perspective
Group GroundFloor  (House)
Group FirstFloor (House)
Group Livingroom   (GroundFloor)
Group Kitchen (GroundFloor) 
// Functional perspective
Group Sensors      (House)
Group Temperatures (Sensors)

// Example Item
Number Livingroom_Temperature "Temperature [%.1f °C]" (Livingroom, Temperatures)