Hello everyone, I’m encountering an issue with openHAB 5.2.3 Main UI (running on openHABian):
I created a dashboard page that, among other things, fetches a snapshot from a ZoneMinder monitor and displays it within a widget. This works perfectly on the custom page I created. I then copied the entire code for this page and pasted it directly onto the “Overview” page. Everything displays without any issues while in edit mode or in the simulation; however, as soon as I log out or open the homepage in a new browser session, this specific widget fails to appear. Interestingly, if I navigate to my custom dashboard page (where the widget always displays correctly) and then return to the homepage, the widget suddenly appears as it should.
The reason I copied the code from the dashboard page to the Overview page is that I want this specific layout to be the first thing I see when starting a session. I haven’t found any other way to achieve this, as it seems there is no built-in option to set a page other than the “Overview” page as the homepage.
Is there a solution to this problem? Please let me know what additional information you might need (perhaps some code snippets?).
A much better approach would be to copy it and paste it into the Developer Tools → UI Widgets → + and set some properties if necessary. Then you can add that custom widget to both places by name instead of copying and pasting the code. See Pages - Custom Widgets | openHAB for details.
I suspect there is something that has gone wrong when copying and pasting the whole page. Something got messed up, a misaligned indentation or something like that. What I would do is build up the layout on the Overview page as you want it (rows, columns, etc.) and copy over the widgets individually, one by one. Even better I would create each widget as a custom widget instead of copy and paste. That makes the widgets independent units which makes future edits and manipulation much easier.
Beyond that, all I can recommend is posting the code for the ZoneMinder widget itself and someone better at UI widgets hopefully will be able to help, assuming the problem is with the widget instead of the layout.
Thanks for your reply! My dashboard page consists entirely of custom widgets; the code copied from the dashboard page actually works on the overview page as well—with one limitation: when the openHAB URL is first accessed, this particular widget displays no output. It only begins to work after the dashboard page has been visited (where the exact same widget functions correctly on the very first load) and one then immediately returns to the overview page. From that point on, everything works perfectly.
I have also checked the indentation; to me, everything looks correct.
There are a couple of different possibilities. Please show all the relevant yaml.