Multiple group membership

I’m building the semantic model of my home in OpenHAB 3.0.1 and can’t figure out how to add an item to multiple groups. I want to create “vertical groups” like in Figure 2 of the Semantic Model tutorial, so that I can trigger rules from related devices without having to specify them one by one.

In the file-based configuration this seems to be possible by tagging an item with multiple groups like (group1,group2). How can this be done in the UI?

  • Platform information:
    • Hardware: Raspberry Pi 4
    • OS: Ubuntu 20.04
    • Java Runtime Environment: Zulu Java 11
    • openHAB version: 3.0.1

You can easily use the UI to add the item to a group in two ways:

  1. From the item’s page click on edit in the upper right-hand corner then click on the Parent Groups box and select all the groups you want that item to be a member of.
  2. From the group’s page click on the Change link at the bottom of the Direct Group Members box and select all the items you want to add to that group.

An item can be a member of as many groups as you need. Note, however, that if you try to add an item to more than one semantic group (e.g. location or equipment), then that will not be displayed properly on the semantic model page; that item will only be displayed in one place on the model even though it will actually be a member of all the assigned groups.

If you use HABot then adding a Point to more than one semantically tagged Groups also breaks down. The semantic model is supposed to represent the physical hierarchy of your home automation. A Point can’t physically be a part of two or more Equipment. A Point or Equipment can’t physically be in two or more Locations at the same time.

Trying to overlay a functional model on top of the semantic model ultimately breaks the semantic model. As the semantic model is used for more than just driving the overivew tabs, that breaking will become more and more pronounced. So I recommend against adding “vertical Groups” which I usually call “Function Groups” to the model. Definitely please do create a functional model where needed, just do it outside of the semantic model.

@JustinG , thanks a lot for your answer! I didn’t know that I have to go through the Items view rather than the Model view.

@rlkoshak I have now separated the semantic and functional groups. This is how my model looks (showing non-semantic items):

1 Like

I’d like to extent that question further.

I’m currently rebuilding my entire openHAB setup, coming from v2.*, trying to stick as close as possible to the OH3 tutorial and the semantic approach.

If I understand it correctly, the vertical groups are derived automatically depending on the location and the relationships between the locations. So it would be sufficient for HABot, to have all rollershutter’s blind controls in their respective locations (eg. house -> first floor -> living room -> rollershutter, etc etc), and ask something like “close all rollershutters in the house”, since all floors are childs of the house, all rooms are childs of the floor and so on. It will figure it out because of the semantic model, right?

To accomplish the same via Alexa though, I need an seperate group of all rollershutter’s blind controls where I can add the metadata. How do I do it without interfering with the semantic model?
Even if I remove the semantic properties, like location and category, from the item, it still interfers with the model @JustinG pointed out.

For example I have the Metadata for Alexa on these kind of groups for the rollershutters, with a members base type set to rollershutters:
Bildschirmfoto 2021-03-11 um 14.48.33

The same goes for the “Rollos im Wohnzimmer” Equipment, where I had all of the blind controls from all the rollershutters in the living room. That works fine and I can control the blind controls via Alexa.

But then it struck me… To stay true to the model, wouldn’t I need one equipment for every single rollershutter, so I can have all channels in it which the rollershutter z-wave thing offers? And then an enclosing equipment on top of it?

Ideally I would only have the single rollershutter equipments with all the channels in it in the model and several “functional” groups which are completely independent of it, to control those via Alexa Metadata.

But how?! I couldn’t figure it out so far… Thanks for the help :slight_smile:

Yes, the idea behind the model is that an equipment group should represent a single physical device (or set of closely integrated devices - for example, I have several different sensors close together on my patio that are performing the function of a single multisensor, so I have all the items from those different sensors in one sensor equipment). But there are several ways to get around the conflict here. The easiest is probably just to just give your model that “expected” one-to-one device-to-equipment group setup and then have a separate group for the alexa function. I have a several similar arrangements in my setup (I don’t use alexa, but this is a common requirement for many functions). All my lights are assigned to their appropriate location and equipment via the semantic model, but those light “points” can also be treated just like regular items (indeed, they are just items with a few extra tags) and so I also have a plain, old, non-semantic group that all those light points are also members of to keep track of the number of lights on at a time. You can add semantic items to as many non-semantic groups as you’d like and this won’t confuse the model. It just breaks down if you try to make a semantic item a child of more than one equipment group or put one equipment group in more than one location.

As you point out, however, your alexa groupings are by room and so it makes a certain amount of sense if they are included in the model, so there’s a second option for this. Groups don’t just have to be equipment or locations. Because a group is just another type of OH item, a group can also be a point. So the room-based groups that you make for Alexa you can create by selecting the add point button for a location, make that point a group instead of some other item and then populate that group with the control points from all of the blinds equipment in that room.

Here’s and example where I’ve done something similar with the lights in my master bedroom suite because I have some rules that function based on the states of light across these two related spaces.


There is no reason this group has to be a part of the model, it doesn’t add any functionality to the model, but it also doesn’t interfere with any of the model functions (* Can’t say for habbot, I almost never use it). It just makes sense to me personally so that’s what I’ve done.

1 Like

Thanks for the great answer, appreciate it.

So, how do I create a plain, old, non-sematic group!? ^^

The problem that I have is, that if I have a second group or more groups, in which the Points are members of, they’ll only appear in one group in the semantic model‘s tree representation. Is this only a graphical problem or a structural one?

Go to the Items settings, create an Item and make it a Group type Item, presumable with a type and aggregation function as well. Refrain from giving it any semantic tags.

The model is a way to view and organize some of your Items. It is not intended to be comprehensive. You can’t do everything Item related from there.

A little of both. Anything that uses the model is going to assume that a Point Item will only be a direct member of one semantically tagged Group. Period. That means, in the Model view the assumption is that any Item can only appear once in the tree. Therefore it’s a UI problem because it won’t show any Items in the model more than once. But it’s also a structural problem because anything that currently uses the model or will use the model in the future also has the same assumption. Since a sensor can’t be in two physical places at once, it can’t be a part of two Equipment or two Locations at once either. It can only show up in the model in one place.

But, this limitation does not apply to stuff that is outside the model. Your Item can appear in as many other Groups as you need. For example,

This is a smart outlet that controls a lamp. Notice it is semantically tagged as a Switch/Light Point Item and it is a member of the FrontroomLamp_Equipment Equipment which is tagged with the Equipment Lightbulb tag.

But you will also see it’s a member of seven other Groups. But none of those Groups are semantically tagged.

In the model view everything shows up as expected. It only appears once in the actual Model (since that is all that is allowed):

If I try top add the Item to another Group that has an Equipment or Location tag though the Switch will only appear in one of them because the assumption is that a Point can’t physically be a part of more than one Equipment or Location at the same time.

But, that restriction doesn’t apply to stuff outside the model. And indeed, if I check the box to show the stuff outside the model, my Switch appears everywhere it should.

But, the Model view really isn’t designed or intended to see, manage, and create anything outside the model. So setting up all that would be handled from the Item’s settings instead, not from the Model. IMO, the only reason to check the “show non-semantic” in the model view is if you have some Item you want to add to the model. Everything else is better handled through the Items Settings pages.

2 Likes

hello, so to see if i comprehend this in terms of a rule. To create a group of battery levels from a variety of devices in the semantic model and in order to not break the semantic model I would need to create a group, not give any semantic property and add the items to the group. doing this would keep the devices as semantic but give me the ability to use the group to say check all devices battery levels daily?

Exactly. Items that are organized into the model are still just items and should be treated that way. You can add them to whatever other groups your usage requires.

1 Like

Note, however, that if you try to add an item to more than one semantic group (e.g. location or equipment), then that will not be displayed properly on the semantic model page; that item will only be displayed in one place on the model even though it will actually be a member of all the assigned groups.

Is this a know limitation or a bug, which will be corrected ?

It’s a known limitation. Viewing ‘semantic model’ as imparting the meanings “this temperature measurement belongs to that thermostat”, or “this light is in that room”, they can’t be in two places at once.