NOTE: This driver is no longer being actively maintained. I've have since moved onto another platform but haven't really used FKB for a while now. That being said, it has held up well with very minimal changes required. If somebody would like to take ownership feel free to message me and I can transfer the source or whatever it is we would need to do.
I wrote this quick driver when I found out that Fully Kiosk Browser had a REST API. This way you can use your tablet as a chime or using TTS in your apps.
Features:
- Chime with custom audio file
- Can be used as an Alarm device
- Text to speach
- Command to launch another app via FKB (custom command "launchAppPackage")
- Command to bring FKB back to the front (custom command "bringFullyToFront")
- Commands to turn the screen on/off (custom commands "screenOn/screenOff")
- Command to trigger motion. (custom command "triggerMotion")
- Commands to start/stop the screensaver (custom commands "startScreensaver/stopScreensaver")
- Commands to load the start URL or another URL
- Command to set the screen brightness (setScreenBrightness)
- Commands to mute/unmute FKB
- Commands to play/stop custom sounds (playSound/stopSound)
- Commands to modify any FKB setting (setBooleanSetting/setStringSetting)
- Battery/motion/acceleration/screen/brightness reporting/control.
- Command to restart the app.
- Device events reported directly to Hubitat.
Requirements:
- A device running the latest version of Fully Kiosk Browser with a plus license so you can enable the REST API (Fully Kiosk Browser Lockdown | Android Kiosk Mode App)
- Enable the REST api by launching FKB -> Settings -> Remote Administration (PLUS) -> Enable Remote Administration. Set your password and enable the Remote Admin from Local Network. This will also list the IP and the Port you need.
Driver Installation:
- Copy the code from the GitHub link below.
- In the Hubitat web admin click on Drivers Code -> New Driver
- Paste the code into the new box and save it.
- From the Hubitat main screen click on Devices -> Add Virtual Device
- Fill in the Device Name and Device Network ID (this will be changed) and select Fully Kiosk Browser Controller from the Type drop down box.
- Select Save Device
- Your new device will now be available and you can configure it from there.
- Click on configure to configure the Fully Kiosk Browser install.
Settings:
- Server IP Address: The IP address of the device running FKB.
- Server Port: The port used for the FKB REST API.
- Server Password: The password set in FKB to connect to the REST API
- Tone Audio File URL: URL to a mp3 file to play when beep is executed.
- Siren Audio File URL: URL to a mp3 file to play when the alarm is triggered
- Siren Volume: Volume to set FKB to when alarm triggered. Previous volume will be restored when siren stopped.
- Volume Stream: Volume stream on device to use for setting the volume. You may need to test and see what works for you.
- State Polling: will poll the device every minute and update attributes with device state.
- Logging Level: set to none after everything is working properly to avoid extra logging
Notes:
- I was also able to save an MP3 file directly to my tables sdcard and reference the audio file like this "file:///storage/sdcard1/mysound.mp3". This should cut down on any delay when using an URL.
- Clicking configure will configure settings on the device and overwrite any custom javascript code you have configured in FKB. This is required to enable device reporting back to the driver.
- The battery/motion/accessleration/screen/brightness reporting will not work if you are using a dashboard with https (for example sharptools). This is a security feature. It does work with the built in dashboards.
Driver source on my GitHub:
History:
[1.0]: Initlal version
[1.02]: Added commands screenOn,screenOff,triggerMotion,startScreensaver,stopScreensaver. Added import url in metadata.
[1.03]: Added actuator capability so you can create custom commands in Rule Machine.
[1.04]: Added commands loadURL and loadStartURL
[1.05]: Added setScreenBrightness command
[1.10]: Implement mute/unmute commands
Added volumeStream setting to choose what volume to control.
Added alarm capability. Includes settings for alarm volume and file.
Changed the volumeStream setting to a drop down with names (streams 1-10).
Changed lauchAppPackage command to accept the package as parameter to allow more flexibility.
Made adjustements to setVolume to properly test for volumeStream value
Added playSound/stopSound commands.
Added the AudioVolume mute attributes.
Set default attributes when installed.
[1.20]: Changed the speak command to use the Hubitat TTS methods. Has faster response and allows voice changing via the Hub Details settings page.
[1.21]: Changed the importUrl to the proper URL.
[1.22]: Updated sendcommand calls to have the parameters properly encoded.
[1.24]: Added setBooleanSetting,setStringSetting
[1.35]: Added 'Battery' capability to track the ... battery.
Added 'Switch' and 'SwitchLevel capabilities to turn the screen on/off and adjust the brightness
Added 'AccelerationSensor' capability which triggers when tablet is moved.
Added 'updateDeviceData' method to record device settings when the preferences is saved.
Added 'MotionSensor' capability to monitor motion via the tablet camera.
Added 'Configure' capability.
: When you select configure it will configure FKB on the device to send events back to this driver.
: Configure should be run when making configuration changes.
: WARNING: selecting this will overwrite any custom javascript code you currently have setup in fully.
If using the FKB TTS Engine, starting text with "!" will cause all messages to be stopped and the new message to play. Otherwise the message is added to the queue and will play when others are finished. (Requires FKB v1.38+)
Sending a "!" TTS message will stop all currently playing messages to stop. (Requires FKB v1.38+)
Updated to use "{ }" instead of "< />" for SSML tags.
Added option to select the TTS engine used.
: Hubitat (Amazon): Supported SSML Tags - Amazon Polly
: Fully Kiosk Browser (Google): Speech Synthesis Markup Language (SSML) | Cloud Text-to-Speech Documentation | Google Cloud
[1.36]: Added restartApp command (thanks to @TMLeafs)
[1.37]: Added State Polling option to allow the driver to poll the device for updates.
: This solves the issue where the start page is SSL. Reporting will not work back to a non SSL endpoint.
: This will gather the screen brightness,screen state and battery levels only. Motion will not work.
[1.38]: Fixed switch reporting.
[1.39]: Added attribute "currentPageUrl"
: This attribute is updated with the current page during polling (every minute).
[1.40]: Requires Fully Kiosk Browser 1.43.1 or newer.
: Added auto configuration of webviewMixedContent
: This allows FKB to report in device status to HE from dashboards that use https.
: After upgrading click configure so all the settings get applied.
[1.41]: Fixed speak command. Was broken with Hubitat firmware 2.9.0.