How To: Fast Switch Between Dashboards with Fully Kiosk Browser

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

Yup, you got it! Thanks!

2 Likes

i have tried to use this fast postMessage methode in a rule using the fkb loadURL command, but nothing happens; however, it works fine (but slowly) when using the command with just the url; any idea what i am doing wrong? do i need to first install any javascript or postMessage stuff?

@Claus_Hansen, can you post the javascript postMessaeg link you tried? My quick guess is if it was not url encoded as described in the earlier post.

thanks, had not understood the encoding part, now it works

1 Like

hi,

think i had this working earlier, but now i cant

i have a rule in sharptools call loadURL with javascript%3ApostMessage%28%7Baction%3A%27navigate%27%2C%20route%3A%20%7B%20path%3A%20%27%2Fdashboard%2Fview%2FBhtBMlvfnF3BSzJ8OSPN%27%7D%7D%29

but nothing happens

i can make it work with the url (but slowly) and i can also make it work with the postMessage if done directly in the fully kiosk device over in hubitat (but not as a rule in hubitat or in webcore for hubitat)

any idea what i am doing wrong?

@Claus_Hansen Can you take screenshots and post the URLs you used in the Fully Kiosk device in Hubitat directly and the one used in SharpTools Rule Engine? It sounds weird that it works via the Fully Kiosk Device page in Hubitat but not from any other rule platforms.

you are right, also in device page, it is only the url working

Have you checked the Hubitat’s log page to see what was going on with the loadUrl command sent from the rule yet? You may want to set the Fully Kiosk Device’s logging level to debug before you trigger the rule again.