Building Pages in the OH3 UI: documentation draft (1/3)

Ahhhhh got it.
Thanks Rich as always your help and knowledge is really appreciated.

Thanks RGroll

I know it, I need the icon name and the label name … they are used in the standard widget-list therefore I suppose can be available also for the custom widget…

In my OH3 just work for the OH-iconset but not for the custom icon … I need to set up something on OH3?

Ok, understand. Which standard widget uses the item-label and the icon-name? Can’t remember seeing that. This would help me, digging a bit depper as I’m also interested in this. :slight_smile:

Hmm, its working for me for all icons that are stored in the mentioned path. I use *.svg files here and I did no extra settings in OH.
You could check the chrome dev tools (F12) and inspect the region, where the image should be, to see what the system is looking for.

Thanks
That’s the point I use png, just look insperct with F12 and is looking for ?svg.
I tried with an svg file and it works.
Lorenzo

I’ll add support for png custom icons after I finish with some other stuff :wink:

1 Like

There’s a user role but it’s not very much advertised, since anonymous users have the right to operate items by default anyway. It will get better.
But you can create a user without admin privileges - openhab:users add <userId> <password> user in the console.

Well… I lost it :disappointed: when I lost the demo instance I set up, sorry.

I had the idea for some time of adding an “expert mode” link to those screens, which would bring you to the “add items as textual definition” screen but it would be populated with items that would otherwise be created by checking the channels and editing the new item info in the forms underneath. That saves you from a lot of clicking around and lets you review quicker if you understand the items textual definition syntax. Probably not coming before 3.1 though.

2 Likes

Ok, understand. Which standard widget uses the item-label and the icon-name? Can’t remember seeing that. This would help me, digging a bit depper as I’m also interested in this. :slight_smile:

The std widget should be : oh-toggle-item for instance … I don’t know where to look for the std widget in OH3.

EDIT: Reordered the flow a little bit. I still feel like we will lose users if we go straight to the YAML so I moved it down to after the presentation of the Page types. I’m still not sure if flows but for me at least it gives me more context to understand the why and what of the YAML stuff. I added some screen shots and more words around the Overview page to further emphasize why to build the model.

Is the discussion of namespaces necessary for the user to understand? It’s not at all clear whether and why we need to know that and I recommend removing that information if it’s more of an implementation detail.

Is it possible to create pages with textfiles stored in the configuration folder, like it is/was possible with sitemaps?
Someting like pages/overview.page or something like that?

no. Just like with HABPanal, the configs get saved in userdata. There is currently no support and I don’t think any is planned to create a language and config parser for Pages. But as with anything, I’m sure if someone steps up to build something like that it would not be rejected.

Where exactly is it stored?
So for openhab3 it is not possible to copy my needed files to my directory? For openhab 2 I could just clone my git repo with all my things, items, rules, sitemaps and so on to my folder and most of it was working. In openhab I have to recreate all my pages?

$USERDATA/jsondb along with everything else that is done through the REST API.

No one is saying that. You just need to include the folders in $USERDATA as part of your git repo. Exclude cache, tmp, jsondb/backups, and probably persistence. If you want to capture your full OH config, you should be saving those files and folders anyway.

I do this myself. All the files in the remaining folders I mention, including those in jsondb are text files too and therefore very git friendly.

And I’m not just saying this theoretically. It is literally how I configuration control my own openHAB 2 and openHAB 3 deployment too. To redeploy I check out my configs from my personal git server.

Ok, thank you for the information.

I just changed some values in my jsondb/uicomponents_ui_page.json as those are the pages and changed some values. But when I check the yaml in the UI then there are still the old values. Is there any action necessary? Even after a restart the values are the old ones.

You do not want to edit the JSONDB manually while OH is running. OH doesn’t reload those files when they change and will write out to those files on any changes through the REST API. So you need to make sure OH is not running if you want to edit the JSONDB manually.

1 Like

Ok, I stopped openhab, changed the file and started it. But no change in the UI.
I even deleted the file /var/lib/openhab/jsond/uicomponents_ui_page.json , cleaned the cache and started but the pages are still visible in the UI.

I haven’t looked into how Pages are stored but I think they are stored in at least one other JSONDB file in that folder. I’m pretty sure widgets are stored separately.

Also, the Overview Page is automatically generated. You can’t delete it.

1 Like

I believe these JSON DB files are restored from the ones in the “backup” directory (userdata/jsondb/backup) automatically if they’re missing.

So if you delete it you’ll have to delete the backup as well.

Yes you are right. Now I’ve understood the behavior. Thank you for your information.

Is it possible to open pages in fullscreen? I’ve created a great Dashboard and I want to have this on a wallmounted tablet but without the openhab menu bar on the left side. If i try to open the page in a new tab it only says: Problem accessing /page/page_b9a60713e4. Reason: Not Found.

Looking for your answers and best regards
Flo