Thank you all for your replies and advices.
The rule work around works fine with item labels but what I am trying to do is somewhat different as it has to do with “badges” and not labels.
It is going to be a long post but let me try to explain my problem in case somebody else has tried this already.
As you all know OH3 has a fantastic feature where at the “Locations” tab in the main overview page, you can see little “badges” on the location photo showing at a glance how many lights, or doors, windows etc, are open at any time. (Please don’t mind the Greek language).
All this is all very nice and works very well for the individual locations.
My problem is that I want to have on top of all the individual rooms (locations) a central location, representing the house AS A TOTAL, showing at a glance "all the lights in the house that are currently ON, together with “all doors” , “all windows” etc.
This works very well for LIGHTS, temperatures etc , that in the semantic model do not require a description as “equipment”. It is only necessary to specify “Point” and “Property” and then all these will appear on the “Properties” tab for the “House” location. Off course first you have to create a “House” location and include all your lights in the “House” location (Group) in addition to the individual room groups.
In my screen shot above you can see that in total I have 4 lights ON (in different rooms) and the “Outside temperature” and in the brackets is the “Average temperature” of “All the rooms” in the house. If you click on the temperature group you can then see the temperature in each individual room.
This a all very nice and fantastic work from the designers of OH3.
The problem starts when you want to include other item groups that require to be specified in the model with an equipment type. Like doors, windows, HVAC, blinds, etc.
It would be very nice if you could see with a glance how many windows are open and by clicking on the group, to see which windows are open. All this is trivial and unnecessary for an apartment or a place with only few doors or windows but for a big establishment this would be very helpful, for example if you want to leave the premises and can not activate the alarm because some windows are open.
The problem is that OH3 behaves somewhat arbitrarily when any equipment is included in MORE THAN ONE location.
I understand that physically it is not possible to have a “refrigerator” in two separate rooms at the same time, but in programming it is possible to have a refrigerator in the “Kitchen” location and at the same time in the “House” location.
OH3 allows you to have any equipment in more than one locations (Groups). The problem is that in one location the “Members of the Group” will be all listed as soon as you click on the location photo, where as on the second location “only the group name” will be shown when you click on the location photo, and in order to see all thee individual group members you have to click on the individual group name.
In the screen shot below you can see that the two doors in the dining room are listed as soon as you click on the dining room photo.
But in case of the “House” location only the “Door Group” is listed in the first page and you have to click on the group in order to see al the doors.
This is very important because the badges work only for the items that are shown on the first page and do not take into considerations the state of the items in groups, when only the group name appears in the first page.
Normally the state of any group itself will be NULL irrespective of the state of the individual members of the group, therefore since only the state of the group itself is shown on the first page (which is always NULL) there is nothing shown as a badge.
The work around is to use Group aggregate functions in order to define the state of the Group item itself. In this case it should be:
Group:Contact:OR(OPEN, CLOSED) gDoors “Open Doors”
This will set the state of the Group item to OPEN if any door is open or to CLOSED if all doors are closed.
This is reflected on the badge feature, which will show an open door if any of the doors is open because the state of the Group item is open.
Then you have to open the Group to see which individual door is open.
This is fine and will show when ANY door or window etc are open but will NOT show the number of open doors.
Hence my first question and the creation of this Topic.
This is not a big problem and I could leave with this solution as long as there is a indication of any open doors or windows.
However there is a big problem in the behavior of OH3 because the decision as to which location will show the full list of group members in the first page and which location will show only the group name in the first page, IS ARBITRARY (or at least I could not find out how it works.
Where in the case of doors the behavior is as described above but in other cases (windows, garage doors etc) it is quite the opposite.
The full list on the first page appears on the “House” location and the list with the main Group name only appears on the individual room locations.
Unfortunately this is unpredictable or until now I did not find out when the first or the second case are happening.
To make it even worse, for the same equipment Group (eg Doors) the groups will some time appear as in first case and another time as in the second case and this is driving me crazy…
It appears that there is some connection with the order in which the Groups are defined or included in the model but I have not been able to accurately recreate or predict the behavior. It appears to be arbitrary.