How to create a sitemap from a Semantic Model (OH3)

Tags: #<Tag:0x00007f433c7221b8> #<Tag:0x00007f433c721f60> #<Tag:0x00007f433c721e98>

you do need one for the Android/iOS App, so there’s that! :wink:
But as the semantic model is based on groups, you can easily do like Björn just posted (Thanks @bjoernbrings, saves me doing it! :stuck_out_tongue_winking_eye: )

1 Like

As far as I understood so far, the model is a way to organize items in nested groups in a standardized way. In particular, it allows you to add predefined “tags” to these groups and items so that it is possible (but I have to figure yet how) to have the mainUI build pages for you. These pages are, in principle, viewable also from the browser of a cell phone.
Sitemaps display Groups that you have to explicitly specify and it seems to me that they ignore the tags, but I may be wrong as I’m still learning.

Or you can use the browser for the mobile friendly Main UI and have a shortcut on your menu to open that.

Hi Lionello; that is also my question: :grinning: :wink: :thinking:

it allows you to add predefined “tags” to these groups and items so that it is possible (but I have to figure yet how) to have the mainUI build pages for you.

You’ve had some good answers already here.

For clarity: the Semantic Model is used by the new MainUI to auto-generate interface pages. It is also used by Habot. It is not used (automatically) by Sitemaps for display in BasicUI - if you want to have a ‘Semantic Model’ style display in BasicUI, you will have to write the Sitemap yourself: it is not done automatically.

2 Likes

1 and 2. There is a sitemap builder built into MainUI. Go to settings -> Pages -> + and select
“sitemap” as the type of page to create. There are a few things that are not supported such as color and visibility. Alternatively you can write it in a .sitemap file.

  1. The sitemap knows nothing about the semantic model which is wholly encoded using tags and Group membership. However, the sitemap knows all about Items and Groups are Items so some of the semantic model stuff can be used on a sitemap. By default the sitemap will use the label and category set on the Item it’s showing. Or you can override those in the sitemap itself.

Sitemaps have been around since OH 1. The docs are complete and unchanged for OH 3. See Sitemaps | openHAB.

Are you thinking about Pages which is completely different. And in that case the Overview Pages get automatically populated based on the model and at least for basic stuff it’s pretty easy to create custom pages just by clicking around. Only if you want to create custom widgets does it get hard.

And I’m not the one who has examples for those. I don’t know much about building widgets.

No you don’t, unless support is only in the beta Android app. I’ve been using MainUI through the Android app for several weeks now. I don’t even have a sitemap anymore.

When you have a model defined:

The Locations, Equipment, and Properties tabs of the Overview Page gets automatically populated.

You can customize these by editing the page (little pencil icon in top right corner) and by setting the Default X widget metadata on the Items. If I wanted to change how that row for the Garage Door looks in that Family Room card, I’d set it in that Item’s Custom default list widget.

That’s correct, it doesn’t know anything about tags. But it does support Groups.

5 Likes

This is helping a lot … Thanks Rich.
just one question;
If i Build the model i can add a “type” and there i see “Location” and “Group” as a type. But what is the difference in behavior for the model?

The Location Item type is a latitude/longitude coordinate and has nothing to do with the Model Location tag.

1 Like

Is it possible to define a grid for the location rectangles? I notice you have a high resolution, so, perhaps therefore more such rectangles fit on your screen.
Or is it configurable?

The number of riws and columns adjusts based on the screen resolution. This is not configurable in the auto generated tabs.

1 Like

I see, and, it looks like in the manually designed Overview Layout Page one can define grids in each block.

Locations only gets populated if you have equipment in a room. If it is empty or the room just has points then it is not shown in locations. Why can a room not just be a collection of points?

If you have a power switch you only need on/off so a point would do without having to include the tree structure that is equipment.

Also, there is a bug, if you run a copy openhab from a folder not called openhab, lets say openhabcopy, you end up with a folder structure in your openhab folder called openhabcopy that is for the userdata folders (all empty) this is in the same drive partition - It looks like someone has left a hard path in.

This win10 & openhab3. Sorry newbie so don’t know how to report bugs.

I really like the semantic model approach :+1:and I build the model representing my home. As I understands this model will be stored in the OH database. It is also very easy to import a items file into the model. But is it also possible to distract or export a kind of item file from the database? It believe that it would be easy to maintain the model via a text file if you have a large model. So extract -> maintain -> import.

No, this is not possible, and won’t be unless some writes the code to give openHAB the ability to do this.

You can start from an Items file though:

Hello,

I would like to know how you managed to have “Equipment” and “Properties” tab, when you open Family Room? When I open my “GF Bathroom” location, I see only what you may see on screen:

There are no “Equipment” and “Properties” tabs.

It depends on what you have as direct members of the Location. If you only have Equipment as direct members of the Location, it won’t show the tabs. If you have one or more Point Items that are direct members of the Location, it will show the tab and show all the Equipment in one tab and all the Point Items that are not part of an Equipment in the other.

Thanks for quick reply! !

Screenshot_20210421-173856_openHAB_Beta|242x500

Got like this, looks similar to your model of Living Room, but I might missing something.

Right, everything directly under the room is an Equipment. On if you add a Point Item directly under the location will the property and equipments tab appear. And in that case the equipment will be shown in one tab and only the Point Item that isn’e a member of any Equipment will appear on the properties tab.

What you have is:

Location
   |_ Equipment 1
   |    |_ Point 1
   |    |_ Point 2
   |_ Equipment 2
        |_ Point 3
        |_ Point 4

To have the tabs you need

Location
   |_ Point 5
   |_ Equipment 1
   |    |_ Point 1
   |    |_ Point 2
   |_ Equipment 2
        |_ Point 3
        |_ Point 4

Notice Point 5. It’s not a member of any Equipment. It’s a direct member of the Location.

And the Location card will show Equipment 1, Point 1, Point 2, Equipment 2, Point 3, and Point 4 on the Equipments tab and only Point 5 on the Properties tab.

Oh, missed point5, all is clear now!! Thanks!!!