Hello and thanks for the support
I would like to create an automation that, after a certain number of seconds, automatically brings me back to a preset screen, for example the home page.
Any suggestions?
Thank you
Hello and thanks for the support
I would like to create an automation that, after a certain number of seconds, automatically brings me back to a preset screen, for example the home page.
Any suggestions?
Thank you
Hi mssimo,
some more information would be required here to help you efficently.
Which device are you using?
Do you have already a sensor in place?
Do you have already a command in place where you can switch to a specific page?
I am personally running a FireHD tablet with FullyKioskBrowser.
FKB can provide a REST sensor with “currentPage” & “startURL” as attributes.
I have created a template binary_sensor which compares boths and switches to “on” if both do not match.
An automation with a FullyKioskBrowser command then resets to the start page.
The following in secrets.yaml (Storing secrets - Home Assistant) :
fkb_deviceinfo_firehd_gang_1: http://192.168.XX.XX:2323/?cmd=deviceInfo&type=json&password=XXXXX
fkb_command_firehd_gang_1: http://192.168.XX.XX:2323/?cmd={{ cmd }}&key={{ key }}&value={{ value }}&type=json&password=XXXXX
The REST COmmand:
rest_command:
fkb_firehd_gang_1_cmd:
url: !secret fkb_command_firehd_gang_1
My Sensors:
sensor:
- platform: rest
name: firehd_gang_1_deviceinfo
json_attributes:
# - altitude
# - androidSdk
# - androidVersion
# - appFreeMemory
# - appTotalMemory
# - appUsedMemory
# - appVersionCode
# - appVersionName
- batteryLevel
# - batteryTemperature
# - BSSID
- build
- currentPage
# - currentTabIndex
# - deviceID
# - deviceManufacturer
# - deviceModel
# - deviceName
# - displayHeightPixels
# - displayWidthPixels
# - foregroundApp
# - hostname4
# - hostname6
# - internalStorageFreeSpace
# - internalStorageTotalSpace
- ip4
# - ip6
# - isDeviceAdmin
# - isDeviceOwner
# - isInDaydream
# - isInForcedSleep
# - isInScreensaver
# - isLicensed
# - isMenuOpen
# - isMobileDataEnabled
- isPlugged
# - isRooted
# - keyguardLocked
- kioskLocked
- kioskMode
# - lastAppStart
# - locale
# - locationLatitude
# - locationLongitude
# - locationProvide
- Mac
- maintenanceMode
- motionDetectorStatus
# - packageName
# - plugged
# - ramFreeMemory
# - ramTotalMemory
# - ramUsedMemory
# - scopedStorage
- screenBrightness
# - screenLocked
- screenOn
# - screenOrientation
# - serial
# - SSID
- startUrl
# - topFragmentTag
# - webviewUA
# - wifiSignalLevel
resource: !secret fkb_deviceinfo_firehd_gang_1
value_template: '{{ value_json.ScreenOn }}'
template:
- binary_sensor:
- name: firehd_gang_1_not_starturl
icon: mdi:web-refresh
state: >-
{{ state_attr('sensor.firehd_gang_1_deviceinfo','currentPage') != state_attr('sensor.firehd_gang_1_deviceinfo','startUrl') }}
The automation:
automation:
- id: fullykiosk_reset_page
alias: fullykiosk_reset_page
description: 'reset '
mode: parallel
trigger:
- platform: state
entity_id: binary_sensor.firehd_gang_1_not_starturl
to: "on"
for: "00:02:00"
action:
- service: rest_command.fkb_firehd_gang_1_cmd
data:
cmd: loadStartURL
If you use the Fully Kiosk app just use the “auto reload on idle” function.
I set up my screen to be on for maximum 20 seconds. In addition I set the comand for returning to 20 seconds, too. As a result you don’t notice the change of the page and when the screen is activated once again the default home screen appears.