Semantic model on existing file based item

Hi all,

yesterday I changed to OH3 and according to the documentation it is possible to add existing items to the new semantic model when you do the following:

“Existing Items can be added to the model. Browse to the Item in the Items settings, click on Edit and choose an appropriate Semantic Class and Semantic Property. Then add the Point as a member of the appropriate Equipment or Location Group. If the Equipment Group doesn’t exist yet, create a Group and use the appropriate Equipment semantic tag first and add the Equipment to the appropriate Location Group.”

But when I do this and try to save the item I get all the time a message that the “Item cant be saved. Method not allowed”.

Does anybody know how to fix this without creating all the item new?

Merry xmas to all of you

Scuby

1 Like

Hi Scuby,
I cant really help you here. But i can tell you what i know and ask some more questions.

I am also switching to OH 3 and playing around. I found that you can only add things (and their channels) to the semantic model. Via the Settings–>Model. Create your Model there and then add the existing Thing in the Model there.

Also I had some trouble with Groupnames, it seems that you should not have the exact same Groupname defined in the Textual configuration files. If i do that every time the i save the file with the Group definition it the corresponding part of the Modell tree disappears / moves down to the non semantic part…

So here comes my question: Is it possible to define the Semantic Model only in Textual from? If so how do i do that? because if i create Groups they are in the Model but not semantic. Is there a way to get them in the Semantic part of the tree via the text files? - I would much appreciate this!!!

Greetings and Happy Christmas

For clarity: if you have an Item defined in an *.items file, it is read-only in the UI - you cannot modify it.

Similarly, you can’t create new Items in the UI if an identically named Item exists in an *.items file.

It terms of adding semantic information to *.items files, I have this bookmarked as I will also have to do this!

2 Likes

Thank you @hafniumzinc !
reading that helped… so it is possible to build the semantic model in textual files :slight_smile:

This is part of an *.items file.

Group gErdgeschoss "Erdgeschoss" ["Location"]
Group gWohnzimmer (gErdgeschoss) ["Location"]`
Switch  HM_Plug2                    "Weihnachtsbeleuchtung"   (gWohnzimmer) ["Light"] { channel="xx" }

It automatically translates to this in thesemantic model :

So the switch HM_Plug2 is now part of the Semantic Model. Important: it needs a “semantic class” the ["Light"] in my case in addition to the group, also the group needs a semantic class. in my case "Location"]

This might help you as well @Scuby

:slight_smile: Thanks again!
This should be described in the “Semantic Model” part of the Documentation… as probably more people would like to do this in textual form.

Have a nice day

13 Likes

Excellent - I’ve been waiting for someone else to try it… :wink:

@borderbridge @hafniumzinc thanks a lot for your tips this is awesome and is exactly what I need. I will try this during XMAS days and let you know my outcome.
I agree this needs to be added to the doc.

Scuby

1 Like

I’d like to add that you cannot add an item, which is defined in a text file and has semantic tags to an equipment that is defined in the UI. The error is “method not allowed”.
I had to delete the item in the text file and add it in the UI.

1 Like