Fully Kiosk Browser

I just started my HA journey which includes setting up a Fire Tablet w/Fully Kiosk as my control panel. This thread has been very helpful, thank you! I want to share some of my learnings and setup as well.

I noticed the beginning OP uses sensor/platform rest. This calls the Rest API for those sensors but if you also want some binary sensors you have to setup a binary_sensor/platform rest and thus it seems a second API call is required. I saw in the HA docs you can use the Restful rest platform (top level) and place all the sensors under one call. Here is my full setup with some special features like % memory free, statuses, app restart time, etc:

# Load Tablet Sensor Info via API Call
  - resource: !secret ha_tablet_rest
    scan_interval: 20
    binary_sensor:
      - name: Living Room Tablet Kiosk Mode
        unique_id: homtab_kiosk_mode
        value_template: '{{ value_json.kioskMode }}'
      - name: Living Room Tablet Plugged In
        unique_id: homtab_plugged_in
        device_class: battery_charging
        value_template: '{{ value_json.isPlugged }}'
      - name: Living Room Tablet Screen Locked
        unique_id: homtab_screen_locked
        device_class: lock
        value_template: '{{ value_json.screenLocked }}'
      - name: Living Room Tablet Screen On
        unique_id: homtab_screen_on
        value_template: '{{ value_json.screenOn }}'
      - name: Living Room Tablet Screen Saver On
        unique_id: hometab_screen_saver_on
        value_template: '{{ value_json.isInScreensaver }}'
      - name: Living Room Tablet Kiosk Locked
        unique_id: hometab_kiosk_locked
        device_class: lock
        value_template: '{{ value_json.kioskLocked }}'
      - name: Living Room Tablet MQTT Connected
        unique_id: hometab_mqtt_connected
        device_class: connectivity
        value_template: '{{ value_json.mqttConnected }}'
    sensor:
      - name: Living Room Tablet Motion Detector
        unique_id: hometab_motion_detector
        value_template: '{{ value_json.motionDetectorStatus }}'
      - name: Living Room Tablet Current Tab
        unique_id: hometab_current_tab
        value_template: '{{ value_json.currentTabIndex }}'  
      - name: Living Room Tablet Last App Start
        unique_id: hometab_last_app_start
        device_class: timestamp
        value_template: '{{strptime(value_json.lastAppStart+"-0500",
                                    "%m/%d/%y %I:%M:%S %p%z", 
                                    "1/1/1900 00:00:00 AM")}}'
      - name: Living Room Tablet Wifi Signal Strength
        unique_id: hometab_wifi_signal_strength
        device_class: signal_strength
        value_template: '{{ value_json.wifiSignalLevel }}'
      - name: Living Room Tablet Battery Level
        unique_id: hometab_battery_level
        device_class: battery
        unit_of_measurement: '%'
        value_template: '{{ value_json.batteryLevel }}'
      - name: Living Room Tablet Battery Temperature
        unique_id: hometab_battery_temperature
        device_class: temperature
        unit_of_measurement: '°C'
        value_template: '{{ value_json.batteryTemperature }}'
      - name: Living Room Tablet Storage Free Space
        unique_id: hometab_storage_free_space
        unit_of_measurement: '%'
        json_attributes:
          - internalStorageFreeSpace
          - internalStorageTotalSpace
        value_template: '{{(value_json.internalStorageFreeSpace / 
                            value_json.internalStorageTotalSpace *100)|round(1)}}'
      - name: Living Room Tablet RAM Free
        unique_id: hometab_ram_free
        unit_of_measurement: '%'
        json_attributes:
          - ramFreeMemory
          - ramTotalMemory
        value_template: '{{(value_json.ramFreeMemory / 
                            value_json.ramTotalMemory * 100)|round(1) }}'
      - name: Living Room Tablet App Free Memory
        unique_id: hometab_app_free_memory
        unit_of_measurement: '%'
        json_attributes:
          - appFreeMemory
          - appTotalMemory
        value_template: '{{(value_json.appFreeMemory / 
                            value_json.appTotalMemory * 100)|round(1) }}'

This is included via a config file entry of:

rest: !include rest.yaml

I have Fully Kiosk Plus which has built in MQTT which I turned on. I quickly noticed the kiosk was pushing device info messages just like the Rest API provides, but a push vs a pull. So I decided to investigate switching to MQTT. I am glad I did, a couple of cool things:

  • Seems a little easier to setup and manage (you can listen to MQTT topics to debug)
  • Push vs pull model based on changes/events
  • Really cool… I set an expire time for the MQTT connectivity sensor (mine is 60 seconds) so if there is no device info message sent in 60 seconds, then it shows the connection as unavailable. Soon as device is back online a message is sent and shown as available.

Here is the same set of sensors but setup via MQTT (some fields slightly changed):

# All MQTT Sensors
  binary_sensor:
    - name: HA Tablet Kiosk Mode
      unique_id: tab_kiosk_mode
      payload_on: true
      payload_off: false
      state_topic: living_room_tablet/deviceInfo
      value_template: '{{ value_json.kioskMode }}'
    - name: HA Tablet Plugged In
      unique_id: tab_plugged_in
      payload_on: true
      payload_off: false
      state_topic: living_room_tablet/deviceInfo
      device_class: battery_charging
      value_template: '{{ value_json.isPlugged }}'
    - name: HA Tablet Screen Locked
      unique_id: tab_screen_locked
      payload_on: true
      payload_off: false
      state_topic: living_room_tablet/deviceInfo
      device_class: lock
      value_template: '{{ value_json.screenLocked }}'
    - name: HA Tablet Screen On
      unique_id: tab_screen_on
      payload_on: true
      payload_off: false
      state_topic: living_room_tablet/deviceInfo
      value_template: '{{ value_json.screenOn }}'
    - name: HA Tablet Screen Saver On
      unique_id: tab_screen_saver_on
      payload_on: true
      payload_off: false
      state_topic: living_room_tablet/deviceInfo
      value_template: '{{ value_json.isInScreensaver }}'
    - name: HA Tablet Kiosk Locked
      unique_id: tab_kiosk_locked
      payload_on: true
      payload_off: false
      state_topic: living_room_tablet/deviceInfo
      device_class: lock
      value_template: '{{ value_json.kioskLocked }}'
    - name: HA Tablet MQTT Connected
      unique_id: tab_mqtt_connected
      payload_on: true
      payload_off: false
      expire_after: 60
      state_topic: living_room_tablet/deviceInfo
      device_class: connectivity
      value_template: '{{ value_json.mqttConnected }}'

  sensor:
    - name: HA Tablet Motion Detector
      unique_id: tab_motion_detector
      state_topic: living_room_tablet/deviceInfo
      value_template: '{{ value_json.motionDetectorStatus }}'
    - name: HA Tablet Current Tab
      unique_id: tab_current_tab
      state_topic: living_room_tablet/deviceInfo
      value_template: >
        {% if value_json.currentTabIndex == 0 %} 
          Home
        {% elif value_json.currentTabIndex == 1 %} 
          Camera
        {% elif value_json.currentTabIndex == 2 %} 
          Temps
        {% else %} 
          '{{ value_json.currentTabIndex }}'
        {% endif %}
    - name: HA Tablet Last App Start
      unique_id: etab_last_app_start
      state_topic: living_room_tablet/deviceInfo
      device_class: timestamp
      value_template: '{{strptime(value_json.appStartTime+"-0500",
                                  "%m/%d/%y %I:%M:%S %p%z", 
                                  "1/1/1900 00:00:00 AM")}}'
    - name: HA Tablet Wifi Signal Strength
      unique_id: tab_wifi_signal_strength
      state_topic: living_room_tablet/deviceInfo
      device_class: signal_strength
      value_template: '{{ value_json.wifiSignalLevel }}'
    - name: HA Tablet Battery Level
      unique_id: tab_battery_level
      state_topic: living_room_tablet/deviceInfo
      device_class: battery
      unit_of_measurement: '%'
      value_template: '{{ value_json.batteryLevel }}'
    - name: HA Tablet Battery Temperature
      unique_id: tab_battery_temperature
      state_topic: living_room_tablet/deviceInfo
      device_class: temperature
      unit_of_measurement: '°C'
      value_template: '{{ value_json.batteryTemperature }}'
    - name: HA Tablet Storage Free Space
      unique_id: tab_storage_free_space
      state_topic: living_room_tablet/deviceInfo
      unit_of_measurement: '%'
      value_template: '{{(value_json.internalStorageFreeSpace / 
                          value_json.internalStorageTotalSpace *100)|round(1)}}'
    - name: HA Tablet RAM Free
      unique_id: tab_ram_free
      state_topic: living_room_tablet/deviceInfo
      unit_of_measurement: '%'
      value_template: '{{(value_json.ramFreeMemory / 
                          value_json.ramTotalMemory * 100)|round(1) }}'
    - name: HA Tablet App Free Memory
      unique_id: hometab_app_free_memory
      state_topic: living_room_tablet/deviceInfo
      unit_of_measurement: '%'
      value_template: '{{(value_json.appFreeMemory / 
                          value_json.appTotalMemory * 100)|round(1) }}'

Again pulled in via the config file:

mqtt: !include mqtt.yaml

Note: I converted the current tab index # to a label based on what tabs I have setup.

After trying both, I have removed the Rest version and sticking with MQTT.

I created this admin view dashboard for the tablet status:

Clicking on the camera card brings up a live feed of the camera - bonus!

Pretty fun integration.

2 Likes

New users only get one media item per post… so here is my Fully Kiosk MQTT settings:

Be sure to change the Device and Event topic to make them easier to see/use in HA.

I’m not sure if it’s what you’re looking for, but what about using fully kiosk kiosk integration instead of mqtt? It shows all these values in HA and you can alter some things (like lock, screensaver, load start url…)

EDIT: Cancel that. The below does not work as the JSON does not update for some reason.

I found a workaround here. Thanks @atomicpapa

mqtt:
  sensor:
    - name: FKB Tablet JSON 
      unique_id: fkb_tablet_json
      state_topic: "fully/deviceInfo/galaxytab10"
      json_attributes_topic: "fully/deviceInfo/galaxytab10"

Then strip the attributes from the new sensor.

sensor:
  - platform: template
    sensors:
      tablet_charging_status:
        friendly_name: Tablet Charging Status
        value_template: >-
          {% if is_state_attr('sensor.fkb_tablet_json', 'isPlugged', true) %} Yes {% else %} No {% endif %}
        icon_template: >-
          {% if is_state_attr('sensor.fkb_tablet_json', 'isPlugged', true) %} mdi:power-plug {% else %} mdi:power-plug-off {% endif %} 

There may be a way to use json_attributes_template: to strip the actual charging state directly but I can’t figure that out.

Any way we can workaround that? It seems my workaround above does not update correctly so I do need this binary sensor somehow.

The attribute isPlugged does not change state in the sensor.fkb_tablet_json even though it does in the main MQTT path at fully/deviceInfo/galaxytab10

image

Fixed it! Found this here.

Simply remove the quote marks around the payload.

  binary_sensor:
    - name: FKB Tablet Charging Status
      unique_id: fkb_tablet_charging_status
      state_topic: "fully/deviceInfo/galaxytab10"
      payload_on: true
      payload_off: false      
      qos: 0
      device_class: battery_charging
      value_template: "{{ value_json.isPlugged }}"
1 Like

firetoolbox used and it goes to sleep when i tell it too and wakes up when i tell it too.

Thanks for everyones contributions to this. I have 6 tablets set up using Fully Kiosk Browser and it is great. I’ve configured a single switch in my conguration for turning on/off the tablet screen from HA which has worked great. However when I attempted to implement this for more than one tablet, I found it only worked for the 1st defined switch and none of the others. No errors etc but it just doesn’t work.

Is anyone able to advise what I’ve done wrong please?

switch:  
  - platform: command_line
    switches:
      living_room_tab_screen:
        command_on: !secret living_room_tab_screen_on
        command_off: !secret living_room_tab_screen_off
        command_state: !secret living_room_tab_screen_state
        value_template: '{{ value == "on" }}'
        friendly_name: Living Room Tab Screen
        
      games_room_tab_screen:
        command_on: !secret games_room_tab_screen_on
        command_off: !secret games_room_tab_screen_off
        command_state: !secret games_room_tab_screen_state
        value_template: '{{ value == "on" }}'
        friendly_name: Games Room Tab Screen

hard to tell without knowing the command_on, command_off and command_state

Help - how to I do Webview Debugging in Fully Kiosk? I switch it on in settings - then what?

Something on my dashboard is intermittently crashing Fully and it’s driving me nuts trying to work out what it is.

Have you figured out how to do this? I had the same issue, so I updated the software to 1.49.1, that seemed to solve the issue but now I have a memory issue where the firetablet HD10 2021 memory usage drops to under 250 mg and becomes unstable. Restarting is tablet works only to have the same issue in 12 hrs.

Memory usage for FK is 1.5 GB.

I didn’t figure out how to use the debugging, but I did eventually find the issue with my dashboard. First changed the Fully URL to google.com - no crashes - so it was definitely something on my dashboard. Turns out it was the animated SVG weather icons causing the memory leak. I’ve reverted to static icons for the time being, but hoping I can eventually find a solution. Next thing on my list to try is installing an older version of Android Webview.

thanks for sharing.

Just curious, how you found out what card(s) was causing the issue? I’m now at this point because my memory leak is still happening :frowning:

Trial and error I’m afraid. You could check your browser console to see if there’s any warnings/errors that give you an idea of what to try. Otherwise just remove cards one by one and see when the memory leak stops.

For me, the animated svg icons were prime culpit. It’s annoying as I rooted my Fire HD8 with Lineage OS - it’s way snappier and more stripped back, but the webview memory leak is something I haven’t been able to overcome despite many hours trying!

thanks for the tips! I will try this out.

You know, after reading FK documentation on this, they do NOT recommend Amazon tablets for FK Browser. Good to know, because next tablet I will spend a bit more to get a true android tablet, and hopefully avoid these issues.

They don’t recommend it for production use specifically, but there’s loads of people running Fire tablets as wall dashboards with no issues. I don’t even use the kiosk mode. But I agree - it’s worth weighing up whether spending a bit more on the tablet is worth it to avoid potential issues with a Fire.

Just for some horizon widening, i do successfully run two tablets around the house with FKB and HA.
I’m using tablets 7" and 10" from Lenovo. They are fairly priced and work just fine… :wink:

I bought two of cheapest “decent” 10 inch tablets a good year, two ago (Lenovo Tab M10)- i thought they’ll be fine just for HA display. Well… they “kinda” aren’t. They are ok for simple HA lovelace, but when you build a complex lovelace with multiple pages it becomes painfully slow, if you intend to switch pages often.
So, it’s definitely worthed to buy a bit more pricey tablet. Now i have Xiaomi pad 5, it works really fast no matter how complex HA lovelace is. But, it’s appr. double priced as Lenovo…

2 Likes

@fenty17

thanks for the suggestion. I found my leak. I narrowed it down to this frontend integration for my blinds

you can see when I enable it on the green dot, the memory takes a nose dive, and then when I disable it (red dot), the memory recovers.

image

Ok, good to know!

Well done! Can’t see any svg files or animations in the code for that card so maybe a different issue to mine. Haven’t had chance yet but I have a feeling that an older Webview version might fix for me. I’ll report back if it does.

1 Like