First you need to ask yourself what do you want out of the semantic model? Right now all it does is
-
Provide a hierarchy and some nice ways to create and manage Items in MainUI which is irrelevant if you are using .items files
-
Populates the three tabs of the overview page
-
Allows interactions with HABot.
If none of the above apply, don’t bother with the model.
If 2 applies to you, I strongly recommend importing your Items into MainUI and abandon the .items files. The semantic model is only going to be the first complicated thing that will require research on how to use and constant referral to the reference documentation. You will also have to deal with state descriptions and custom default widgets which are all defined using Item metadata and there are lots of options.
When you have your Items in the UI, you get nice forms that present all the options to you. No need to learn all the options and how they are all used. It’s way less work to implement and figure out.
Also, definitely review Semantic Model | openHAB which explains the general concepts of the model. Things I notice so far with your attempt:
- There is no Location Group
- There is no Equipment Group
- “Switch” is a Point tag. The Property is an additional and separate tag. The Point says what the actuator/sensor is and the Property describes what the actuator/sensor represents. For example, Mute would be tagged with “Switch” for the Point and “SoundVolume” for the Property.
- “SoundVolume” is a Property tag. Property tags cannot stand on their own and must be paired with a Point tag. The Volume Item would be tagged with “Setpoint” for the Point and “SoundVolume” for the Property.
One reason why this is better in the UI is you can’t apply a Property to an Item without first setting the Point. And it’s impossible to confuse a Location tag with an Equipment tag with a Point tag with a Properties tag. They are all shown and selected from separately. It won’t let you mess it up, or at least makes it much more difficult. And you never have to look anything up because the list of possible tags are all right there to select from.
If using .items files, you’ll have to constantly watch changes to the source code to be aware when new tags are added, which is happening all the time.
An old list of the tags and their types can be found at the link above.
It is entirely possible that there isn’t an appropriate property tag for all Items. I don’t see anything appropriate for Zone 2. For the Point I’d either chose “Control” or “Switch” and maybe choose SoundVolume as the Property or leave out the Property.
It’s not clear if Input is a status or a control. If it’s just a Status I’d tag it with “Status” as the Point and maybe “Frequency” as the Property, though I’d probably leave out the Property. If you can control the input from this Item I’d use “Control” or “Switch” as the Point.
Note, not every Item needs to be a part of the model. If you have an Item that doesn’t need to be in the overview tabs, don’t include it in the model. Unlike with sitemaps, it’s possible to use more than one Item in a single widget. So you might combine some of these Items into a single widget (e.g. volume setpoint and mute button on one widget) in which case you’d only include on of them in the model, or you’d set the visibility on one of them to false through Item metadata.
Which brings me to reiterate my point. For now, the main reason to use the semantic model at all is to populate and customize the the Overview tabs. Given that when it comes to customization of how the Items appear will require custom widgets that can only be created through the UI, and managing the Item metadata required to apply custom widgets to the Items is way easier through MainUI I just don’t see any reason to bother with the semantic model unless you plan on managing your Items through MainUI anyway.
Frankly, it’s going to be more work to figure out how to do it all in .items files so OH can “automatically” generate those pages than it will be for you to just create custom Pages yourself. So I strongly recommend against trying to retrofit the semantic model to .items files. The effort is simply not worth it. But for UI managed Items, the semantic model makes it really easy to create, organize, and manage dozens of Items with relatively little effort.
Personally, after spending a day trying to import my existing Items into the model, I gave up and just recreated all my Items through the UI using “create equipment from thing”. I was able to recreate about 300 Items and have them all properly in the semantic model with custom widgets faster than it took me to import and retrofit 20 items from .items files.