Blurb for Blueprint Page
Fully Kiosk REST API + MQTT Automation
Easily integrate and automate multiple Fully Kiosk Browser devices using REST API for screen control and MQTT for real-time sensor updates. This blueprint supports automatic device discovery and allows for custom brightness control, motion-based screensaver activation, and dynamic UI adjustments based on ambient conditions.
Features
Automatic Device Discovery β Finds and lists FK devices via MQTT.
Adaptive Brightness β Adjusts screen brightness based on light levels.
Motion-Activated Screensaver β Turns on when no motion is detected.
Multi-Device Support β Works with multiple FK tablets seamlessly.
No YAML Editing Required β Uses RESTful Commands via the Home Assistant UI.
Prerequisites
Before using this blueprint, make sure to:
Enable MQTT in Fully Kiosk Browser
β’ Set MQTT Device Info Topic β fully/deviceInfo/$deviceId
β’ Set MQTT Event Topic β fully/event/$event/$deviceId
Add the RESTful Command Integration in Home Assistant
β’ Update configuration.yaml
to add the following**
β’ Search for RESTful Command and add the following commands:
rest_command:
fk_set_brightness:
url: "{{ fk_url }}/?cmd=setStringSetting&key=screenBrightness&value={{ brightness }}&password={{ fk_password }}"
method: GET
fk_screensaver_on:
url: "{{ fk_url }}/?cmd=screensaverOn&password={{ fk_password }}"
method: GET
Ensure Your FK Devices Are Reachable via Local Network
β’ Verify each tabletβs IP address and port (default: 2323) in FK settings.
I wanted to be able to set up automations in HA using sensors from Fully Kiosk that werenβt exposed through the Fully Kiosk Browser native integration - so I attempted to create this blueprint to make it easier to work with several FK devices that I have around the house.
blueprint:
name: "Fully Kiosk REST API + MQTT Automation"
description: "Automatically integrate multiple Fully Kiosk Browser devices using REST API for screen control and MQTT for real-time sensor updates. Supports automatic device discovery."
domain: automation
input:
fk_devices:
name: "Fully Kiosk Devices"
description: "Automatically discovered FK devices will be listed here. Select the devices you want to configure."
selector:
object:
options: "{{ states('input_text.fk_discovered_devices').split(',') if states('input_text.fk_discovered_devices') else [] }}"
device_info_topic:
name: "MQTT Device Info Topic"
description: "Define the topic where Fully Kiosk sends device info (default: fully/deviceInfo/#)."
default: "fully/deviceInfo/#"
selector:
text:
event_topic:
name: "MQTT Event Topic"
description: "Define the topic where Fully Kiosk sends event data (default: fully/event/#)."
default: "fully/event/#"
selector:
text:
brightness_dark:
name: "Brightness - Dark Room"
description: "Set screen brightness when the room is dark."
default: 2
selector:
number:
min: 1
max: 100
step: 1
brightness_dim:
name: "Brightness - Dim Room"
description: "Set screen brightness when the room is dimly lit."
default: 20
selector:
number:
min: 1
max: 100
step: 1
brightness_normal:
name: "Brightness - Normal Room"
description: "Set screen brightness when the room has normal light."
default: 50
selector:
number:
min: 1
max: 100
step: 1
brightness_bright:
name: "Brightness - Bright Room"
description: "Set screen brightness when the room is well-lit."
default: 80
selector:
number:
min: 1
max: 100
step: 1
brightness_very_bright:
name: "Brightness - Very Bright Room"
description: "Set screen brightness when the room is extremely bright."
default: 100
selector:
number:
min: 1
max: 100
step: 1
motion_timeout:
name: "Motion Timeout Before Screensaver"
description: "Time (in minutes) after motion stops before screensaver activates for the specific device."
default: 2
selector:
number:
min: 1
max: 10
step: 1
description: |
## Setup Instructions
1. **Set Up RESTful Command Integration** (Required to send commands to Fully Kiosk)
- Go to **Settings β Devices & Services**
- Click **+ Add Integration** β Search for **RESTful Command**
- Add the following commands:
```yaml
fk_set_brightness:
url: "{{ fk_url }}/?cmd=setStringSetting&key=screenBrightness&value={{ brightness }}&password={{ fk_device_password }}"
method: GET
fk_screensaver_on:
url: "{{ fk_url }}/?cmd=screensaverOn&password={{ fk_device_password }}"
method: GET
```
2. **Click the 'Discover Fully Kiosk Devices' button in HA UI**
3. **Wait for 60 seconds while Home Assistant listens for MQTT messages on the user-defined topics.**
4. **Detected FK devices will appear in the dropdown list.**
5. **Select the FK devices you want to configure.**
6. **Restart Home Assistant & Verify MQTT Messages in Developer Tools β MQTT β Use the custom-defined topics.**
trigger:
- platform: mqtt
topic: "{{ input.device_info_topic }}"
- platform: mqtt
topic: "{{ input.event_topic }}"
action:
- service: system_log.write
data:
message: "Received MQTT message: {{ trigger.topic }} - {{ trigger.payload }}"
level: debug
- variables:
device_id: "{{ trigger.topic.split('/')[-1] }}"
event_type: "{{ trigger.topic.split('/')[-2] if 'event' in trigger.topic else '' }}"
- repeat:
for_each: "{{ input.fk_devices.items() }}"
sequence:
- variables:
fk_device_url: "{{ repeat.item[1].url }}"
fk_device_password: "{{ repeat.item[1].password }}"
fk_device_id: "{{ repeat.item[1].device_id }}"
- condition: template
value_template: "{{ device_id == fk_device_id }}"
- service: system_log.write
data:
message: "Processing FK device {{ fk_device_id }} for event {{ event_type }}"
level: debug
- choose:
- conditions:
- condition: template
value_template: "{{ event_type == 'onDarkness' or trigger.payload_json.screenBrightness | int < 10 }}"
sequence:
- service: rest_command.fk_set_brightness
data:
fk_url: "{{ fk_device_url }}"
fk_password: "{{ fk_device_password }}"
brightness: "{{ brightness }}"
- conditions:
- condition: template
value_template: "{{ event_type == 'onMotion' }}"
sequence:
- service: system_log.write
data:
message: "Motion detected on {{ fk_device_id }} - Resetting timeout."
level: debug
- delay: "00:{{ input.motion_timeout }}:00"
- condition: template
value_template: "{{ event_type != 'onMotion' }}"
- service: rest_command.fk_screensaver_on
data:
fk_url: "{{ fk_device_url }}"
fk_password: "{{ fk_device_password }}"
input_button:
fk_discover_devices:
name: "Discover Fully Kiosk Devices"
icon: "mdi:tablet"
input_text:
fk_discovered_devices:
name: "Discovered FK Devices"
initial: ""
automation:
- alias: "Fully Kiosk Device Discovery"
trigger:
- platform: mqtt
topic: "fully/deviceInfo/#"
action:
- service: system_log.write
data:
message: "Discovered FK device: {{ trigger.payload_json.deviceId }} at {{ trigger.payload_json.ip4 }}"
level: debug
- service: input_text.set_value
data:
entity_id: input_text.fk_discovered_devices
value: "{{ states('input_text.fk_discovered_devices') + ',' + trigger.payload_json.deviceId if states('input_text.fk_discovered_devices') else trigger.payload_json.deviceId }}"