[OH3] Semantic Model setup via tags in configuration Items files

That’s somewhat a misuse of the model and in not sure you can do that completely. The model is intended to have Equipment, for example an HVAC system. All the setpoints, controls, and sensors are a part of the HVAC equipment.

If you separate the stairs from the actuators you completely lose what is part of what devices, which is kind of the main point if the model in the first place.

Given your unintended way of using there model, I would’ve expect consistent behaviors and assistants in the UI.

You could make a feature request but I don’t know if it would be implemented.

Hmm, actually I have only one equipment/thing and this is KNX with a lot of channels.
This is the reason why I have to create for every room (virtual) equipments like for Lights, Rollershutters (e.g. Kitchen Lights, Kitchen Rollershutters, Living Room Lights, Living Room Rollershutters…). In this way I could make a clear spearation between switch as equipment and sensors as properties.

I would not say this is a misuse, only a straightforward solution in terms of usability.

KNX is a little different in how it represents devices. It may not be a one-to-one Thing to Equipment with KNX.

The key thing is the model should represent the physical layout of your home. If you have a lights with three smart lamps in the living room that are always treated was a unit, then you have one lights Equipment in the Livingroom and each lamp is a point under that. The fact that it’s actually controlled by a KNX module in the closet is not something that belongs in the model.

Creating equipment groups is not a misuse of the model. Separating the sensors from the actuators is.

For example, I’ve a door equipment. This equipment has a Contact as a member as well as a sub equipment for the lock. The lock equipment has a locked/unlocked sensor as well as an actuator to cause the lock to open or close. The sensors and actuators are part of the same equipment.

I fully understand this. My problem is if somebody else wants to use the MainUI how can I explain to him what is under equipment and what under property. Also for me it is not 100% clear.
Maybe the best way is to only use equipments and only in some special cases properties.

That’s the typical approach. The Equipment also adds information to the model. It’s not just a placeholder. Grouping all the stuff that is logically a part of the same equipment in the real world, even if it’s Items linked to different Things from different bindings, is the way to go.

@xela @trumee
that´s right and there´s already an issue.
according to my analysis the problem could be solved as soon as the txt items are loaded AFTER the UI items after a reboot. As a workaround my following rule can be used:

configuration: {}
triggers:
  - id: "1"
    configuration:
      startlevel: 100
    type: core.SystemStartlevelTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      considerConditions: true
      ruleUIDs:
        - 25e67a5f02
    type: core.RunRuleAction

and the appropriate Python script is as following:

import os
import time

item_path = '/etc/openhab/items'
tmp_path = '/etc/openhab/items/tmp'

os.mkdir(tmp_path)

for file in os.listdir(item_path):
    if file.endswith(".items"):
        os.rename(os.path.join(item_path, file), os.path.join(tmp_path, file))
        
time.sleep(1)

for file in os.listdir(tmp_path):
    if file.endswith(".items"):
        os.rename(os.path.join(tmp_path, file), os.path.join(item_path, file))
        
os.rmdir(tmp_path)

Do you know why the big NULL appears on right hand panel?

Presumably your Living Room Light is ultimately a Group item, so it won’t have a state.

Unless you also specifically configure the Group Item to derive its state from one of its members.

Is it also possible to associate the photos for the location cards on the UI?

Not through the Items files, no. That configuration has to be done via the UI.

maybe I’ll find my luck here. I could’t find enything on google & co…

does anybody know how I can integrate the “Group Settings / Members Base Type & Aggregation Function” via tags in the Item file ?

I would like to genrate a Group with all batteries in it and it will show me the lowest stand…

or generate a Group with all lights in it and it will show me if all are off.

It’s better to start a new thread than reopening a year old thread.

No, not through tags. But see Items | openHAB for the reference docs on creating Group Items in .items files.

Neither the semantic model nor tags are involved.

Sorry to open up an old topic, but it’s to the point…

What exactly do you mean with saving “in a[n] Item configuration file”? I tried saving the below text as "semantischmodel.things" (in folder /etc/openhab/things/):

//HOUSE MODEL

//INDOOR
Group gIndoor "Indoor" ["Indoor"]

//OUTDOOR
Group gOutdoor "Outdoor" ["Outdoor"]

But no luck in the MainUI.

Or is that because I’m running openHAB4? Maybe the text files are of (little or no) use in OH4 (as opposed to OH3)?

This is a Things file in the Things folder. You need to save an Items file in the Items folder.

Text files works the same way in OH4.

Top, thanks!

Thanks a lot, this was super helpful! It should really be part of the standard documentation.

I am having one particular problem, I do not understand. I have an LED stripe, which I would like to show up as a “Light” under Properties, and as a “LightStripe” under Equipment. I am using this syntax here:

...
Group gWohnzimmer "Wohnzimmer" (EG) ["LivingRoom"]
...
Dimmer      WohnzimmerStripes   "Wohnzimmer Stripes"        <light> (Licht,gWohnzimmer)  ["LightStripe","Light"]   { channel="knx:device:bridge:light:WohnzimmerStripes" }

The problem is that when I put both “LightStripe” and “Light” then it seems to ignore the “Light” tag: in the UI, the item shows up under Equipment but not under Properties. When I remove “LightStripe”, then it is shown under Properties but not under Equipment. What am I missing? Do they conflict in some way?

You can’t show an Item at different parts in the semantic model-

I see. But why is that? I understand that no item should be at multiple locations at once, but what’s wrong with an item being at a certain location and also resembling some equipment?

Items can only be a point of one equipment in the semantic model, but be members of multiple non semantic groups, So you can have it in a semantic equipment group and a non semantic at the same time.

The semantic model is intended to and built around representing the physical layout of your home automation. No Equipment can physically be in two locations at the same time. No Point (i.e. sensor or actuator) can be in two locations at the same time nor part of two Equipment at the same time. Once you head down that path you are no longer representing the physical layout of your automation.

But as @hmerk indicates, you can model your home automation in other ways (e.g. functionally, involvement in scenes, etc.). You just need to make that model be outside the semantic model.

1 Like