I’m having some problems with creating groups and how they aggregate. I’m trying to report in my UI how many lights are currently on. Now, that seems easy and it is indeed. But my difficulty is that I have multiple lights in one lamp. And I want to count those lights combined as 1.
Here you can see my 5 items. There are 4 lights (hue binding switch item) and a group item.
The group item has the same base type as the individual items and it is grouped with an aggregation function "if one is on, then the status of the group item is ON (else OFF).
So far, so good. The 4 individual items belong to the group of course. This all functions as it should.
Now I have a final group item which has a number base type to report the number of lamps that are on. In this group I have put the group item of the lamp as seen above. Please see my config:
Now what I expected how it would work is that when the group item of the lamp is ON it counts ‘1’. Instead, OpenHAB seems to ‘deep dive’ into the group item which is in the ‘count’ group item and reports ‘4’.
Is this behaviour by design? Workaround that comes to mind is create a rule which counts the group items as 1 but maybe I misconfigured something and need to think different. That’s why I created this topic.
Thank you all for your replies.