In openhab I need to display some alert messages on the ui of the main page, how do I do it, I can’t seem to find a widget that can do it, does anyone know, thanks a lot guys!
Oliver2
(Oliver)
December 2, 2024, 2:43pm
2
Welcome to openHAB!
You can send UI commands to a browser of a device which navigate to a different page or open a popup for example.
Create an item which is not linked to a thing.
Then open MainUI on the device you wish to receive a display message.
Click on „Help&About“ in the left lower corner, scroll down and add the item to „Listen to UI command“
From your rule simply send a command to that item:
items.UICommand.sendCommand("navigate:/page/alerts");
openhab:main
← digitaldan:command-item
opened 06:03PM - 04 Sep 23 UTC
This allows the local running instance of the UI to listen to an item for comman… ds. Specifically it will understand the following commands.
- navigate
- popup
- popover
- sheet
- close (closes all popups/sheets/popover)
- back
- reload
- notification
Commands with arguments use a colon delimiter, mirroring widget actions in the UI, for example
`navigate:/pages/page`
`popup:widget:customWidget`
`notification:Text:Title:Sub Title:Title Right:5000`
~I have this as a WIP~ as i play with this some more, but its very handy for tablets i have mounted around the house, i can easily pop up a camera, or a SIP call when the doorbell rings, trigger a reload when i have made UI changes or after a system update/restart, etc.....
users can select the item in the about menu, since we have other local options set there its seemed to be the best place.
<img width="919" alt="image" src="https://github.com/openhab/openhab-webui/assets/1903737/2a223eec-815a-4c16-bf52-0b49499770e8">
You need at least openhab v4.1