How to add custom semantic classes?

Given the fact that OpenHAB2 has been abandoned, I tried to look into migrating to OpenHAB3, including its semantic modeling. Alas, there are no suitable semantic classes for a lot of my stuff and I can’t seem to find where to define new ones, so how do I add custom semantic classes to it?

You cannot (well you can, but the model would not pick it up).
But I doubt OH3 is missing the proper classes for your purpose.
Did you really check what’s available?
BTW, semantic model is optional and you can aggregate it however you want to, e.g. you can have separate tags for devices to be a “washingmachine” and a “dishwasher”, or you can tag both of them to be "white good"s. And any device can still remain to be a generic “equipment” or “point” when you assign property tags.

Maybe you could share what is missing so that, if it is really missing, the OH team could think about adding them?

They won’t. Many of the devices I’d have added do not make any logical sense to be lumped together within the constraints of the existing semantic classes and they are custom-built devices, test-equipment and such that the average person doesn’t have or wouldn’t be adding to OpenHAB.

That renders OpenHAB3’s semantic modeling useless, then.

I think with your previous answer, you showed, that the model will suite for the average user.
For me it fits very well…

Again, if you could share some examples, maybe someone could help.
If you do not, then we cannot…
There might be even workaround to some things, i.e. could a testing equipment be tagged as a network device?

I asked how to add custom semantic classes; I did not make any claims, whatsoever, as to whether the existing ones suit the average user or not.

No, because it doesn’t make logical sense. I have plenty of different kinds of networked devices and lumping them all together is as useful as not giving them any semantic class at all. It does not bring out any of the benefits of a semantic model.

In that case, your generalized answer

I absolutely incorrect. It might be useless for you, but it definitely is not for others.

2 Likes

sigh Where did I claim that it’s useless for others?

Speak for yourself only, please.
You can also apply non-semantic tags to your whatsoever-great-but-yours-only-and-unique devices and code whatever functions on top.
But if that’s what they are, they don’t belong into a common semantic model anyway, and that does not render the model any less useful than it is.

1 Like

Jesus Christ. This entire thread is about my needs, my usecase! In an effort to defend OpenHAB, you people lash out at me and try to put words into my mouth that I never said!

When even a moderator does that, I have no interest in participating any further.

FWIW it’s pretty useless for me too. That’s fine, I didn’t need it having already done what I want in OH2 using Groups etc.and just carried that forward. Could all be rejigged with custom tags in OH3 (as highlighted already) if I wished, those are a new feature of value to me.

You have clarified your intent at this point, but I would suggest that you also accept (given the building evidence) that the way you phrased your initial claim reads to many (most?) others as a general dismissal. Furthermore, it reads as a general dismissal that could easily influence less experienced users who come across this public thread and therefore many, rightfully, felt the need for a rebuttal. But that all aside…

You’ve established that you don’t feel the model fits, that’s fine; I’m with rossko57 in this case. I’m a huge proponent of the semantic model, but I don’t really use it all that much myself. That doesn’t really mean that this conversation should end here. What part of the semantic model were you expecting to find useful? Were you planning on interacting with these custom devices via HabBot? Did you just need custom (non-semantic) tags? Those are plenty easy to utilize.

That’s great. We encourage such threads. Interesting new uses and edge cases are very welcome topics. This could still turn into a very productive thread for you and others if you were willing to go into more detail about this unique usecase. Many users here make their own custom sensor and actuators, I’m sure they’d be interested in learning about yours. Maybe even, in the end, your use isn’t such an edge case after all and a productive discussion could help steer OH and the devs in a new useful direction. There’s only one way to find out…

5 Likes

It’s worth considering where the semantic model came from and what it’s used for in OH becuase far too many assume that it is more and does more than it can. The model was initially developed to give the information needed by HABot to know which Items were where and part of what equipment. This information is needed so one can, for example, as HABot to “turn off the lights in the kitchen”.

In OH 3, this same semantic model is used to drive the population of the Locations, Equipment and Properties tabs of MainUI.

There are also some Semantic Actions that can be used in rules to see, for example, what location an Item is in.

That’s it. That’s all the semantic model is used for in OH as of this writing. If you don’t care about any of that, the semantic model is not something worth spending time on for you.

So where did the semantic model come from? It was initially build based on the BrickSchema Ontology.

What’s an ontology? It’s a way to model the meanings and relationships of meanings of symbols. It’s all but required to enable a computer to understand natural language (the initial reason the model was added to OH in the first place, remember).

Why can’t end users just create their own semantic tags? Because those tags won’t carry meaning. It takes more than just defining a new word to make a tag. It has to be situated into the ontology so it can be included in the model used to process the natural language statements in HABot.

However, I think we all here can agree that the current set of semantic tags leaves much to be desired. It can definitely be improved. And there are work arounds possible that can make it work in lots of different use cases.

But without more information, this is an XY Problem. We can’t help you get to a workable solution because you are fixated on solving your problem in a specific way, a way which isn’t possible right now.

5 Likes

I noticed that walk-in wardrobe is missing. Is it possible to add?