I wrote a DTH that was similar to a solution Fully Kiosk Browser Controller (DTH) but of course over time it merged into my own ‘thing’. My target was initially to just get FKB into a driver so I could change the brightness and screensaver timer then I figured out you could inject your own javascript into FKB and have it notify SmartThings of motion and more (photo capture).
Enter your IP address and it should be DHCP reserved. Note: I also found Fire HD tables do not handle WiFi channel jumping very well - so you might lock that too in the WAP.
The port is 2323 and set your own password.
The Allow Screen Off Command is used for Fire HD tablets since when they shut the screen down it is difficult to get back to FKB without jail breaking the device.
You can run the DTH on its own - but the real fun is when you add the webCoRE piston on a licensed version of FKB.
PISTON SPLIT: My first post had one large piston but users had problems with chunk size loading. I have split the piston into two with the first doing daylight and nighttime changes to the brightness and motion detection & the other the event piston.
PISTON 1 (Timer):
There are booleans to turn motion detection on during the day (myTurnMotionDetectionOnDay) and night (myTurnMotionDetectionOnNight) and screensaver timeouts and brightness values (0-255).
PISTON 2 (Events):
Select your Fully Kiosk Browser Device, save the piston then capture the External URL and go back and edit the piston saving that to the ‘myEndpoint’ variable.
INITIALIZE THE PISTON: Once you have the piston loaded you need to load the JavaScript by pressing the test button. This will execute piston and load the JS into FKB.
OR you can go back to the configuration screen of the DTH and ‘save’ the configuration again. That should trigger the touch and reload the the piston.
Once it starts working you should see the logs pulling back the report:
And the piston should update the Piston state with the ‘onUrlChange’ report back:
You can also see the JavaScript loaded correctly in the web browser of FKB:
Once the JavaScript injected triggers are working well it does function good as a motion sensor in a room during the day, not so much at night, but I also turn off the motion so it doesn’t wake people up without touching the pad.
You will see a lot more in the DTH about AWS. If you get this far with success we can talk about AWS and image uploads and using AWS Lambda, AWS API Gateway, and AWS S3. That is for AWS Rekognition to attempt facial matching. (you need a good working knowledge of AWS) and a different piston.
I really only tested on HD Fire tablets so your mileage my vary on Android.
One more thing, as of now - you should be running 1.39.3 or newer. There was a change in 1.35+ that put the WebView in FKB to pause/sleep and you need to turn off ‘Pause Webview while in Background’ if it was enabled. The setting is under 'Advanced Web Settings".
For those that are using Amazon Fire tables with the screensaver, it is best to update the brightness to 0 as shown below:
Updated: June 3, 2020: FKB 1.39.3 was released. updated instructions.
Updated: June 12, 2020: 9:00AM EDT - splitting the one piston in two.
Updated: July 5, 2020: Updated DTH to allow for screen brightness to be configured as ‘auto’.