Tablet UI: switch pages based on reading

Begonnen von roelb, 09 September 2019, 23:04:58

Vorheriges Thema - Nächstes Thema


I've been looking all over the documentation, source and the german pages in this forum, but I can't seem to find an easy way to automate a simple task in the tablet UI frontend: switch a page whenever a certain reading changes.

My use case is simple: I use the "pagebutton" widget to seperate functionality onto different pages. It's one page per room, and some generic pages that are available everywhere.

The normal view in a room is the page with all controls for the room that the tablet is in. But for example, whenever the doorbell rings, I want TabletUI to switch to the page that contains the video feed from the door. Or whenever someone enters the house when the alarm is armed, I want to display a special page. I've been thinking about creating a "javascript" widget that would subscribe to a reading and run an arbitrary piece of code whenever the reading changes. But I can't shake the feeling that someone must have thought of this already and I'm just not seeing the obvious way to do this.


You are are looking for a solution on the frontend but maybe this suggestion is also helpful:

If you are running Fully as the browser on your tablet this can be remote controlled using the FULLY module.

So one can use a notify/DOIF/... to react on the changed reading and execute a

set fully url [url of the page to show]

to change the displayed page.
Banana Pi, Add-On Board mit 1.8" TFT LCD und IR-Sender, CULFW V1.61, div. Homematic Komponenten, Pollin Funksteckdosen, Selbstbau CUL433 MHz, Jeelink Clone, EC3000
Selbstbau CUL868MHz für Wireless M-Bus, SIGNALduino mit Logilink Temp.-sensoren und Auriol Wetterstation


<div data-type="pagebutton" data-url="#page1.html" data-load="#page1" data-off-background-color="transparent" data-off-color="#606060" data-on-background-color="blue" data-on-color="#222222" data-active-pattern="(.*index.html||.*#page1.html)" data-icon="fa-home" data-device="d_ftui" data-get="state" data-get-on="1" class="default"></div>
<div data-type="pagebutton" data-url="#page2.html" data-load="#page2" data-off-background-color="transparent" data-off-color="#606060" data-on-background-color="blue" data-on-color="#222222" data-active-pattern=".*#page2.html" data-icon="fa-lightbulb-o" data-device="d_ftui" data-get="state" data-get-on="2" class="prefetch top-space"></div>

I'm switching the pages by means of the state reading of the dummy d_ftui.


Cool, thanks! I was indeed missing the obvious here..