Semantic and items definition - location and other pages empty

Hi,
I’m very confused, something looks easy to do via UI, something via file definition. And I don’t know why in my OA looks like the one don’t work good toghether. I try to explain my issue and doubts.
I build in the UI the model of my house:
immagine
then I define one items (a light) via files

Group  pippo (gCamera_matrimoniale) { ga="SpecialColorLight" [ colorUnit="kelvin", colorTemperatureRange="2600,6999" ] }
Dimmer brightnessItem       (pippo) { channel="deconz:colortemperaturelight:00212E02482D:7cb03eaa00a95bf503:brightness", ga="lightBrightness" }
Number colorTemperatureItem (pippo) { channel="deconz:colortemperaturelight:00212E02482D:7cb03eaa00a95bf503:color_temperature", ga="lightColorTemperature" }

but as you can see in the Camera Matrimoniale Location there isn’t a light called pippo. But if I open the camera matrimoniale items pippo apear as Direct Group Members

and the pages with equipment location etc. is totally empty. Someone can help me to solve this issue and doubt?
Thank you.

It not really recommended to try and mix file-based items and UI-based items for exactly this reason. It’s really best to use just one or the other. See this thread for a lengthy discussion:

I’ll second @JustinG said, it is very much recommended against mixing UI and file based configs.

But the specific problem you have here is your Items defined in the text files do not have any static tags applied. pippo needs to have an Equipment tag and the other two Items need Point and Property tags.

Without valid tags, these Items are not considered to be a part of the semantic model at all.

I’ll go one step further and say if you want to use the semantic model, I recommend against using text barred Items at all. You’ll spend way more time getting the tags and syntax right than any minor discomfort you’ll experience working on the UI.

ok @rlkoshak and @rlkoshak thanks a lot. But if is not raccomended to mix why the documentation is half with UI and half with files configuration?
Then please, I want to do all with files, where I can find for example how to define the semantic model with files and how I can find how put the valid tags in my items?

Thanks a lot!

Both are supported. Both need to be documented.

Adding tags to items is covered in the Items reference pager in the docs.

The structure of the semantic model is covered in the Semantic Model page of the Getting Started Tutorial. For the specific tags that are currently supported, I recommend using the Model page in MainUI to see the list of curly supported tags. There’s no guarantee that the list in the docs is kept up to date with changes in the list of supported tags.

Having dinner it both ways myself, I can say it took a little more than twice as long to get it done and correct in .items files than using the UI, and that’s before I even started messing with custom default widgets.

Note, if your concern is that UI configs are not human readable, that’s not the case. All UI configs are in $OH_USERDATA/jspndb in human readable JSON formatted text files.

Sorry @rlkoshak I don’t understand. I look in the Semantic Model | openHAB but there isn’t reference how to do it via file…where I can find the documentation how to create semantic model via file? Thank you.

1 Like

This thread gives explanations and examples: [OH3] Semantic Model setup via tags in configuration Items files

1 Like

Thank a lot! I will look at it. But why don’t integrate it in the documentation if both UI and file needs to be documented?

Sorry I try some tests but something looks not clear.
For example why the three point are not inside LuceApplique also if I define as point of luce applique?

//SECONDO PIANO

//CAMERA MATRIMONIALE

//APPLIQUE
Group  gLuceApplique "Applique" (gApplique) { ga="SpecialColorLight" [ colorUnit="kelvin", colorTemperatureRange="2600,6999" ] }
Switch sLuceAppliquePower <light> (gLuceApplique) ["Switch"]  { channel="deconz:colortemperaturelight:00212E02482D:7cb03eaa00a95bf503:brightness", ga="lightPower"  }
Dimmer gLuceAppliqueBrightnessItem <light> (gLuceApplique) ["Control"] { channel="deconz:colortemperaturelight:00212E02482D:7cb03eaa00a95bf503:brightness", ga="lightBrightness" }
Number gLuceAppliqueColorTemperatureItem <light> (gLuceApplique) ["Control"] { channel="deconz:colortemperaturelight:00212E02482D:7cb03eaa00a95bf503:color_temperature", ga="lightColorTemperature" }

and also why if I put a switch inside Luce Camera Su Su that is in the location Camera Matrimoniale, from location view I see nothing? In the @rlkoshak posts appear in the card the light on for example?

Thank you!

immagine

Sorry guys,
I try to delete the contents of the points.items file, save and write again and looks like works, but still in the location pages I don’t see for example the badge of the light…how I can solve it?

If you think I have to create a new post with a new more pertinent title I will do it! Thank you.


You have two different tabs. One for locations which shows the different ‘top’ level locations and you have an other tab which shows the badges by equipment category e.g. light. There you should find your lights.

Sorry @Wolfgang_S , according to @rlkoshak example here A Deep Dive into the Semantic Model, he is able to see the status of the points in the Location cards and me no :smiling_face_with_tear: . How can I also realixe it?

Thank you.

immagine

From Getting Started Tutorial:

  • A Point is not a Group, but represents any other type of Item and is usually linked to a Channel.
  • A Property is an additional tag on a Point Item that indicates what sort of point it is. For example, a thermometer might be a Point of type Measurement with a Property of type Temperature.

and most specifically from the Badges section:

Badge Type Equipment Point Property
Lights Status Any Control, Switch Light

You’ve not applied any of the Property tags to your Items and the table shows you must have a Light property tag.

I wish you luck in your endeavors but I’m done on this thread. @Wolfgang_S is very capable and can continue to help. How much time has already been wasted on this thread trying to get the syntax and tags right in the text files when in the UI it’s obvious and difficult to get wrong?

Because no one has volunteered to do it.

Sorri @rlkoshak, your suggestion is then to use the UI? Because I undestand that the text files have more pro then UI configuration…and also a good part of documentation is with files…sorry if I ask you something of obvious.

The fact of the matter is that UI-based configuration and text-based configuration have different pros and cons; one is not absolutely better than the other. It depends on your use case. For your use case, using the semantic model in your setup, the UI is the much better option.

The reason is, as you have personally seen, the semantic model is an information layer and it’s a lot of information. That gives the user lots of places to make mistakes and struggle to get the configuration correct when using text files. The UI will guide you through most of that setup and prevent most of those mistakes making it a significantly better option if you want to use the model.

You don’t have to use the model. It provides some benefits to some users, but other users don’t find it as helpful. For some of those users, text file configuration may be the better option.

That is because text file configuration is complicated and requires far more documentation to help users get it correct. The UI configuration handles much of that for you. It will fill in sensible automatic values for pieces so you don’t always have to fill in every single piece of information. It will validate the values you fill in or only offer you valid options so that items cannot have invalid settings. It will automatically produce the structure required for the semantic model if you use the available semantic model features. In many cases this means far less documentation is required.

Yes. That has been the suggestion from the beginning of this thread. You asked about how to get the semantic model working in your setup and the overwhelming response from the beginning has been: the easiest way to get the semantic model to work is to set up all your items using the UI.

It is possible to have a completely text-based configuration with a working semantic model, but that really requires a complete understanding of the concepts and structure of the model, meticulous organization of your items in the files, and many hours of debugging. This is just not feasible for most beginning users, and not worth the effort even for most advanced users.

2 Likes

I couldn’t have said it better than @JustinG. The only think I’d add is another reason why less documentation is required for the UI is because the UI is self documenting. In addition to all the stuff mentioned, there will be a sentence or two under the field explaining the purpose of that field. You need go nowhere else beyond the UI most of the time to not only know what’s valid but also what’s possible.

In an OH context, these features of the UI are the most important when it comes to defining Things, the Semantic Model, and default widgets.

So yes, I recommended it up front and I still recommend it. If you are going to use the Semantic Model, you are better off doing so in the UI than text files. Then you can spend your time working on your home automation rather than syntax errors.

If you are going to use the semantic model, I also recommend against trying to retrofit your existing Items into it. Instead use “add equipment to model” to recreate bunches of Items all in one go automatically situated in the model.

1 Like