OpenHAB 5 Semantic Model Proposal

This check will apply to all items, regardless of how they were created (UI, .items, yaml, ruby, etc).

Further extension may be that this information can be displayed in the UI too. For example, if semantic errors / irregularities are detected, it will be displayed in the Model and/or Item Details page. The logic is simple enough that it can be duplicated in MainUI, or sourced from core via REST endpoint. Either way, it would need to be internationalized. But, one step at a time!

Ok. I am more than willing to do this for “my” bindings. Plus perhaps a few more. So can someone please tell me (as a developer) what is needed? I suppose it means adding elements to the thing.xml files. Or??

That’s why I’d like to know which existing bindings have already done this. Then we can just look at how it’s done. If not, that probably means we need to invent the mechanism first.

ROFL :wink:

Could not find a really good example, but just saw that this seems to be implemented well for system channels. So this might be the best first start.
In general, it should just be adding some already defined elements to the thing.xml definition.

I guess that we are referring to tag entries in the channel description xml. Or??

Unfortunately the documentation is (IMHO) the exact opposite of helpful. Indeed I don’t think it is actually real English. .. Certainly not “already defined” I think.

Furthermore the XSD (below) doesn’t really help either..

https://www.openhab.org/schemas/thing-description-1.0.0.xsd

So I am hoping that one of the guys who wrote the “model” can please step up and also write the documentation too.


EDIT: PS the links to the “prefined” tag library are quite broken..

Thanks for digging this out

That seems straightforward enough - you define what the default tag the channel should have.

I did some more digging. Core already provides such tags for system channel types.

I believe I can start adding them to the bindings that I’m using (lgwebos, daikin, fronius, amazonechocontrol)

One more thing we may need: for the bindings to provide a list of custom tags to be created. Does this exist?

I am struggling with your “you define” phrase versus what little the doc says “pre defined” versus “custom specific”. At the moment it implies either of the following .. but not both

  1. Binding authors can put in any ‘s**t’ that they desire
  2. Binding authors can put in tags from a predefined list

Or??


PS if there is (or will be) a “predefined list” then the options should be in the XSD so that the validator can check it at build time. Currently the XSD validator really does accept any ‘s**t’ ..

PPS I think the same should apply to the category element .. the options should be in the XSD so that the validator can check it at build time.

1 Like

The predefined tags are here:

IMO that’s not necessary. Yes you can enter anything, and if you do, it won’t be automatically recognised as semantic tags, just plain tag. Here’s an example for lgwebos, I set the tags for the “Application” channel to: Control, and Application. Since Application isn’t a valid tag, it showed up as:

Then when I added a custom Property tag Application, the item became:

At the end of the day, they are simply added as Tags, because Semantic tags are also just plain old simple Tags.

Thanks. I will make a PR to add that list to the docs.

I guess the message is that developers should add Equipment / Property and Point tags to their binding xml. (In general they probably cannot add location .. except perhaps for things like solar panels “roof” or “garage” door openers).

So the enhancements we need to add here is an extra xml (or just an extra element) for defining custom tags that the binding may need.

Or, better yet, let the bindings define away any tags they want, and core will create them on the fly of they don’t exist. This would apply only to Property though.

As I said above, one can get to this link by googling “semantic tags csv”. It’s the first result.

Adding it to the docs isn’t so straight forward. This list is dynamically generated, so you’ll need to create a mechanism that grabs this file from github and insert it into the docs. You can’t just statically copy paste it.

The doc can just link to the file on GitHub.

1 Like

It could probably misuse the category field for that. It is better than nothing..

Firstly, it’s only Point/Property. Not Equipment and most definitely not Location. Locations are generally virtual Group Items, not linked to a Thing.
Equipments are also virtual Group not linked to a Thing either.

Next, in the process of adding this to Fronius, I paused and realised, wait a minute, I don’t want to add any semantic tags to any of my fronius items. I wouldn’t want it to be auto suggested either. That would be annoying.

IMHO equipment can easily be added (oven, lightbulb, fan etc.)

That would be a good first step, but I think inserting it would be nicer. There is already infrastructure around doing this type of things for other stuff like gathering binding docs, etc. But a link is better than nothing, until someone takes the time to add the insertion.

Could you explain why ?

Yes but again, equipments are not usually linked to an item. They are virtual Group Items that contain Points.

Points are the items linked to channels / binding.

So wouldn’t the equipment tag help the UI to decide which virtual group the respective Item / Channel should belong to?

I don’t need it being in my semantic model. Perhaps lack of imagination? Why would I need it in the model?

I use the semantic model primarily as an improved “Associated items” technique instead of relying on item naming system. Such technique is unnecessary when it comes to fronius because it’s just one thing in the whole house, not associated with a room.

I don’t use MainUI auto generated pages so what show up there is totally irrelevant to me.