How To: Fast Switch Between Dashboards with Fully Kiosk Browser

Is the fast switching doable if not using the Fully Browser device handler? I was thinking of running the timers that does the loadURL in node red so my hub doesn’t get too bogged down with too many schedules.

How do you plan on having Node-RED call the desired command?

If you plan on calling the Fully Kiosk Browser HTTP API directly from Node-RED, that should work fine as that’s all the FKB device driver is doing. You’ll probably have to URL encode the parameter though as the driver does that for you.

I haven’t gotten to that part yet lol, but I have done http request node before. The part I’m not sure of is how to format this part:

javascript:postMessage({action:'navigate', route: { path: '/dashboard/view/XXXXX'}})

To something like below…

http://192.168.10.16:2323/?cmd=loadUrl&url=[url]&password=[pass]

If you don’t have a preferred method of URL encoding values, you can use a tool like urlencoder.org to encode the value:

So the URL Encoded result looks something like:

javascript%3ApostMessage%28%7Baction%3A%27navigate%27%2C%20route%3A%20%7B%20path%3A%20%27%2Fdashboard%2Fview%2FXXXXX%27%7D%7D%29

And then you put that value into the spot where you have [url] (and similarly, whatever password you set for the FKB admin UI):

http://192.168.10.16:2323/?cmd=loadUrl&url=javascript%3ApostMessage%28%7Baction%3A%27navigate%27%2C%20route%3A%20%7B%20path%3A%20%27%2Fdashboard%2Fview%2FXXXXX%27%7D%7D%29&password=1234
                                           ↑
                                           Your URL encoded value                              

Edit: Don’t forget that you need Remote Administration turned on in Fully Kiosk Browser for this to work. You should be able to copy-and-paste the final URL into a normal web browser from a device on your network and it should trigger the navigation within your device running FKB.

2 Likes

Ah gotcha, I wasn’t sure I can stuff all that information in there. Something I have not tried before.

2 Likes

6 posts were split to a new topic: Improve navigation time between dashboards

I am trying to set up this fast switching but cannot get the new dashboard. /dashboard/view/xxxx to change on the tablet.

My Rule: javascript:postMessage({action:‘navigate’, route: { path: ‘dashboard/view/xxxxx’}}) (x=the new dashboard to display)

Currently, I am entering the “JavaScript post message Josh referenced in a sharptools rule using a virtual device and the custom FKB DTH with the loadURL command to change my home dashboard to another sharptools dashboard quickly, but no go. I can send other commands such as loadstarturl via sharptools rule but for the life of me, I can’t find where the error is. I can send a rule for the full sharptools url but slow, hence the fast switching.

On the tablet, I have the remote access active.

Any ideas why the new dashboard doesn’t load?

Can you share a screenshot of your rule so we can better understand how it’s configured?

Your example seems to be missing the leading slash on the path. And it might just be the community software formatting the message, but the quotes probably need to be straight quotes rather than curved.

  • Straight: '
  • Curved:

I had to removed the image.

Try fixing the leading slash on the path and see if that helps:

javascript:postMessage({action:'navigate', route: { path: 'dashboard/view/xxxxx'}})

…should be…

javascript:postMessage({action:'navigate', route: { path: '/dashboard/view/xxxxx'}})
                                                           ^
                                      Note the leading slash

That was a no go unfortunately, though the screen sort of dims briefly as if the page is trying to load but it does not change.

Here’s my earlier screenshot.

Have you encoded the argument as @josh mentioned earlier in this thread? The url argument is sent to Fully’s API on your tablet as URL query parameter, so it needs to be encoded.

I did not encode the URL. I encoded and the compiled text URL takes me to the FKB web admin page not the sharptools dashboard.

My code truncated: 192.168.0.22:2323/?cmd=loadUrl&url=%20javascript%3ApostMessage%28%7Baction%3A%27navigate%27%2C%20route%3A%20%7Bpath%3A%20%27%2Fdashboard%2Fview%XXXXXXXXXXXXXXXXXX%27%7D%7D%29%20javascript%3ApostMessage%28%7Baction%3A%27navigate%27%2C%20route%3A%20%7Bpath%3A%20%27%2Fdashboard%2Fview%2Fs1vtXJkBW1OwPfHm9qNP%27%7D%7D%29&password=XXXX

@Michelle_Patterson, sorry if I confused you. You only need the following part to be encoded and filled in the argument field.

From this:

javascript:postMessage({action:‘navigate’, route: { path: ‘/dashboard/view/xHF4pBuWWBQFYu8h3nOc’}})

To this:

javascript%3ApostMessage%28%7Baction%3A%27navigate%27%2C%20route%3A%20%7B%20path%3A%20%27%2Fdashboard%2Fview%2FxHF4pBuWWBQFYu8h3nOc%27%7D%7D%29

You don’t need the FKB’s ip and cmd like below, The loadURL command from the device handler will do this for you, and attach the filled argument as url query parameter in the request to FKB.

1 Like

Thank you so much, that resolved my issue.

1 Like

I tried using this encoding in webcore but it didn’t work as listed above. Anyone know the correct formatting to send this URL via the custom FKB device handler?

Did it work somewhere else, but not WebCoRE?

Is this on Hubitat or SmartThings? I don’t recall needing the encoding when using the driver on Hubitat. I only needed it when manually calling the Fully Kiosk Browser API directly.

You guys are so fast to reply, I love it. I found an error in my piston and the same encoded url works. Thanks

2 Likes

Having a hard time with this… Triggering from Hubitat Rules…

dev:1762021-03-23 14:42:24.629 debug[sendCommandCallback] response.data: {"statustext":"Loading URL javascript:postMessage({action:‘navigate’, route: { path: ‘/dashboard/view/xxxxx’}}) ...","status":"OK"}
dev:1762021-03-23 14:42:24.625 debug[sendCommandCallback] response.data: {"statustext":"Screensaver stopped","status":"OK"}
dev:1762021-03-23 14:42:24.622 trace[sendCommandCallback] response.status: 200
dev:1762021-03-23 14:42:24.618 trace[sendCommandCallback] response.status: 200
dev:1762021-03-23 14:42:22.605 debug[sendCommandPost] [uri:http://192.168.1.76:2323/?type=json&password=yyyyy&cmd=loadURL&url=javascript%3ApostMessage%28%7Baction%3A%E2%80%98navigate%E2%80%99%2C+route%3A+%7B+path%3A+%E2%80%98%2Fdashboard%2Fview%2Fxxxxx%E2%80%99%7D%7D%29, requestContentType:application/json, contentType:application/json]
dev:1762021-03-23 14:42:22.601 trace[sendCommandPost] cmdDetails:cmd=loadURL&url=javascript%3ApostMessage%28%7Baction%3A%E2%80%98navigate%E2%80%99%2C+route%3A+%7B+path%3A+%E2%80%98%2Fdashboard%2Fview%2Fxxxxx%E2%80%99%7D%7D%29
dev:1762021-03-23 14:42:22.598 trace[loadURL] url:javascript:postMessage({action:‘navigate’, route: { path: ‘/dashboard/view/xxxxx’}})
dev:1762021-03-23 14:42:22.589 debug[sendCommandPost] [uri:http://192.168.1.76:2323/?type=json&password=yyyyy&cmd=stopScreensaver, requestContentType:application/json, contentType:application/json]
dev:1762021-03-23 14:42:22.586 trace[sendCommandPost] cmdDetails:cmd=stopScreensaver
dev:1762021-03-23 14:42:22.582 trace[stopScreensaver] 

It says Status ok, but it doesn’t do the navigation. It’s on my main Sharptools dashboard running in FKB, and I turn off the screensaver before, so I’m not sure the problem…

I’m away from a device to test with at the moment, but I would double check the quotes. They look like curly quotes ‘’ rather than straight quotes ''.

1 Like