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

I started from scratch with OH3 on a Raspberry Pi 4 and build a complete semantic model from my environment. But now I want to start using this in Basic UI so I need a Sitemap.
There is where I get confused !

  1. How can I easy create a sitemap?

  2. Is it correct that I need to do this in a text file?

  3. What is the easiest way to do this and use the same Names, labels, Types, Categories and Semantic classes?

I donā€™t think basicUI is going to be useful. You have to find posts by rlkoshak showing examples. As far as I know documentation is not complete yet so you have to figure out how to proceed by looking at posts in the forum. I am also in the process of trying to understand how to display the model in the MainUI.

I basically copied my OH2.5 sitemap into OH3.
To do so I created the sitemap using the Pages Settings option and then used the code view to do it.

Example result below:

  1. Itā€™s under pages. You could create a sitemap

  2. Semi :slight_smile:

  3. I did it based on the groups I have.

sitemap Sitemap_Haus label="Haus" {
    Group icon="house" label="Orte" {
        Group icon="cellar" item=Keller label="Keller"
        Group icon="groundfloor" label="Erdgeschoss" item=Erdgeschoss
        Group icon="firstfloor" label="Obergeschoss" item=Obergeschoss
        Group icon="garage" label="Garage" item=Garage
        Group icon="garden" label="Garten" item=Garten
        Group icon="temperature" label="AuƟen" item=Aussen
    }
    Group item=Funktionen label="Funktionen" icon="receiver"
}
2 Likes

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 https://www.openhab.org/docs/configuration/sitemaps.html.

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.

7 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.