Kiosk-mode users, feedback is needed!

Kiosk-mode users from the Home Assistant community,

Since a long time there is a pull request in kiosk-mode repository which brings Jinja / JavaScript templates support to kiosk-mode options. The usage of templates is optional and one could keep using boolean values if one wants, but there is a breaking change that has been motivated for the limited flexibility that the current entity_settings option has. We have received several feature requests that cannot be achieved with the current entity_settings configuration (check some of them here, here, here, here, or here).

Trying to solve these requests from the community, the proposal is to deprecate the current entity_settings conditional config, and if one wants to make the options react to entity changes, one needs to use templates.

For example, the next config:

kiosk_mode:
  entity_settings:
    - entity:
        input_boolean.hide_sidebar: 'on'
      hide_sidebar: true
    - entity:
        sensor.hide_header: 'on'
      hide_header: true
    - entity:
        input_text.kiosk: 'true'
      kiosk: true

Needs to be migrated to:

kiosk_mode:
  hide_sidebar: '[[[ is_state("input_boolean.hide_sidebar", "on") ]]]'
  hide_header: '[[[ is_state("sensor.hide_header", "on") ]]]'
  kiosk: '[[[ is_state("input_text.kiosk", "true") ]]]'

This allows one to solve more complex cases. For example, if we want the header hidden for everyone and show it only when the entity input_boolean.show_header is on but we want that this change only works if the user is an admin (keep it hidden for non-admin users), we can do it in this way (this is hard to achieve with the current entity_settings config):

kiosk_mode:
  hide_header: |
    [[[
      return !user_is_admin || is_state('input_boolean.show_header', 'off');
    ]]]

Except for the reaction to entity state changes, the usage of templates is totally optional, but even in cases in which entities states changes are not needed, one should consider if the usage of templates will make our lives easier. Check this example shown in the pull request. The next configuration:

kiosk_mode:
  user_settings:
    - users:
      - "ryan meek"
      - "maykar"
      hide_header: true
  non_admin_settings:
    hide_sidebar: true

Can be solved with this more readable version:

kiosk_mode:
  hide_header: '{{ user_name in ("maykar", "ryan meek") }}' # using Jinja templates
  hide_sidebar: '[[[ !user_is_admin ]]]' # using JavaScript templates

So, this thread is just to ask you some feedback as a kiosk-mode user because we don’t want to release this breaking change without knowing if it will disrupt you in some way.

  • I find the usage of templates useful
  • I don’t find the usage of templates useful
  • This change doesn’t affect me as I don’t use entity_settings
0 voters

If your response is not contained in the poll, or you want to extend your response, you can respond to the thread with a comment.

Thanks in advance :raised_hands:

If you would like to try this feature, you can install the beta version available in HACS or directly in the release.

1 Like

You’re missing (a huge) one. The lack of this feature has been a deployment blocker. (read: because you don’t support it I can’t use your software - my vote, I fit into multiple of your mentioned use cases and it’s a deploy blocker.)

For the record ha needs rbac and kiosk to wrap it…

Hey Nathan, I don’t understand well, what is the option that you propose to add to the poll? I think that I can edit it and add it.

“I am not using / cannot use kiosk mode because it does not currently support templates…”

1 Like

Oh, I understand now. I think that option fits under I find the usage of templates useful :slightly_smiling_face:

At the end the poll is just to know if this should be released or not, so your vote is that you would like to have this feature available. :+1:

This is already updated in the post, but if you want to test these changes, they are available in HACS chossing the latest beta version or if you want to install it manually, it is in this release.

using the templates functionality for some time now, I realize this was a 1 time change, which I found less than obvious at the time of migrating from entities.

then again, I use those templates a lot, and they can make control even better, and more fine-grained, built-in the kiosk-mode options.

alternative is to create helpers in the HA backend, and use those as entities in Kiosk-mode.

examples:
binary for

{{is_state('input_select.mode','Kiosk') or
  is_state('input_boolean.kiosk_mode','on')}}

even had a group:

group:
  kiosk_mode_hide_dialog_header:
    name: Kiosk mode hide dialog header
    entities:
      - input_boolean.hide_dialog_header_history
      - input_boolean.hide_dialog_header_settings
      - input_boolean.hide_dialog_header_overflow
    all: true

that however is not possible for javascript templates, an option that has a lot of power because it takes frontend into consideration.

So, I have mixed feelings, and would ideally see an ‘in between’ option.

use entities config for was of Yaml control. Allow parallel use of (javascript) templates for the users that need to consider frontend into the config.

so I voted for templates are useful, but that doesnt mean I find the entities config less attractive. Keep both :wink:

@Mariusthvdb,
I don’t understand well. What specifically is possible to achieve with the entities_config and not possible with JavaScript templates?

Unfortunately, both cannot be maintained because, as I explained, it is easy that one clashes with the other and that is an open door for future bugs and issues. And also as a mater of maintainability and scalability, the most powerful and flexible option is the one that should be kept instead of making workarounds to make it possible to keep the lesser.

But if you explain what you can achieve with the entities config and it is not possible to achieve using templates maybe it can be implemented instead of making workarounds.

no, I didnt say that, or at least didnt want to…

Wat I meant was that to me, the templates config syntax is less straightforward than the entities syntax.

however, by using templates, especially the javascript templates, we get to open more functionality, simply because entities syntax, and even Jinja syntax cant use Frontend properties, like javascript can (eg, view name, or anything you can use in the Console command line for that matter).

I believe I ultimately agree with you here, and to me, that would be javascript templates, as I tried to explain above

just so I am sure: we can use jinja and js templates alongside of each there cant we?

from the documentation:

kiosk_mode:
  hide_header: '{{ user_name in ("maykar", "ryan meek") }}'
  hide_sidebar: '[[[ !user_is_admin ]]]'

is an actual valid config?

Ahh, I understood something wrong then.

Yes, it could be. That is the reason of the poll, to check if being forced to use templates to achieve changes in entities is something that would be hard to some users or at least annoying.

Perfect then :slight_smile:

Yes, you can use JavaScript or Jinja templates. The only thing to take into account is that Jinja templates need a WebSocket call, so it will add a delay on top of the regular delay of kiosk-mode the first time that the dashboard is loaded.

sure.
the way I always explain that to users of custom-ui, is that
javascript is executed in the Frontend, and relies on the power/memory of the device the frontend is running in, like iPhone or Wall panel.
jinja is executed in the backend, and relies on the power of the server computer.

wont be as significant as before but people still run RPI’s and maybe even smaller, so that Jinja power might be something to take into account.

(considering my card-mod themes, with many jinja templates, there is no problem… but yeah, one should stress it nonetheless :wink: )

to illustrate, this is my kiosk-mode configuration, it;s mostly jinja, and I dont notice any delay whatsoever:

Kiosk-mode configuration
# https://github.com/NemesisRE/kiosk-mode
# admin_settings:
#   hide_sidebar: false

# hide_assistant: true

non_admin_settings:
  hide_sidebar: true
  hide_menubutton: true
  hide_overflow: true
  hide_assistant: true
  hide_search: true
  hide_sidebar: >
    {{is_state('input_boolean.unhide_sidebar_for_non_admin','off')}}
  hide_add_to_home_assistant: true

mobile_settings:
  hide_menubutton: true
  hide_overflow: true

#Hides both the header and sidebar.
kiosk: >
  {{is_state('binary_sensor.kiosk_mode_selected','on')}}
# Hides only the header
hide_header: >
  {{is_state('input_boolean.hide_header','on')}}
# Hides only the sidebar. Disables swipe to open.
hide_sidebar: >
  {{is_state('input_boolean.hide_sidebar','on')}}
# Hides only the sidebar menu icon. Does not disable swipe to open.
hide_menubutton: >
  {{is_state('input_boolean.hide_menubutton','on')}}
hide_add_to_home_assistant: >
  {{is_state('input_boolean.hide_add_to_home_assistant','on')}}
# Hides the top right menu
hide_overflow: >
  {{is_state('input_boolean.hide_overflow','on')}}
# Hides the account icon
hide_account: >
  {{is_state('input_boolean.hide_account','on')}}
# Hides notification tray
hide_notifications: >
  {{is_state('input_boolean.hide_notitications','on')}}
# Hides the search icon
hide_search: >
  {{is_state('input_boolean.hide_search','on')}}
# Hides the assistant icon
hide_assistant: >
  {{is_state('input_boolean.hide_assistant','on')}}
# Hides refresh menu item
hide_refresh: >
  {{is_state('input_boolean.hide_refresh','on')}}
# Hides the unused entities menu item
hide_unused_entities: >
  {{is_state('input_boolean.hide_unused_entities','on')}}
# Hides the reload resources menu item
hide_reload_resources: >
  {{is_state('input_boolean.hide_reload_resources','on')}}
# Hides edit dashboard menu item
hide_edit_dashboard: >
  {{is_state('input_boolean.hide_edit_dashboard','on')}}
# Block mouse on empty overflow menu-items
block_overflow: >
 {{is_state('input_boolean.kiosk_mode_block_overflow','on')}}
# Block mouse on overflow menu-items
block_mouse: >
  {{is_state('input_boolean.kiosk_mode_block_mouse','on')}}
hide_dialog_header_action_items: >
  {{is_state('input_boolean.hide_dialog_header_action_items','on')}}
hide_dialog_header_history: >
  {{is_state('input_boolean.hide_dialog_header_history','on')}}
hide_dialog_header_settings: >
  {{is_state('input_boolean.hide_dialog_header_settings','on')}}

hide_dialog_header_overflow: >
  {{is_state('input_boolean.hide_dialog_header_overflow','on')}}
hide_dialog_history: >
  {{is_state('input_boolean.hide_dialog_history','on')}}
hide_dialog_history_show_more: >
  {{is_state('input_boolean.hide_dialog_history_show_more','on')}}
hide_dialog_logbook: >
  {{is_state('input_boolean.hide_dialog_logbook','on')}}
hide_dialog_logbook_show_more: >
  {{is_state('input_boolean.hide_dialog_logbook_show_more','on')}}
hide_dialog_attributes: >
  {{is_state('input_boolean.hide_dialog_attributes','on')}}
hide_dialog_media_actions: >
  {{is_state('input_boolean.hide_dialog_media_actions','on')}}
hide_dialog_update_actions: >
  {{is_state('input_boolean.hide_dialog_update_actions','on')}}
hide_dialog_climate_actions: >
  {{is_state('input_boolean.hide_dialog_climate_actions','on')}}
hide_dialog_timer_actions: >
  {{is_state('input_boolean.hide_dialog_timer_actions','on')}}

# entity_settings:
#
#   - entity:
#       binary_sensor.unhide_sidebar_for_non_admin: 'on'
#     hide_sidebar: false
#
# #Hides both the header and sidebar.
#   - entity:
#       binary_sensor.kiosk_mode_selected: 'on'
# #      input_select.mode: Kiosk
#     kiosk: true
# # Hides only the header
#   - entity:
#       input_boolean.hide_header: 'on'
#     hide_header: true
# # Hides only the sidebar. Disables swipe to open.
#   - entity:
#       input_boolean.hide_sidebar: 'on'
#     hide_sidebar: true
# # Hides only the sidebar menu icon. Does not disable swipe to open.
#   - entity:
#       input_boolean.hide_menubutton: 'on'
#     hide_menubutton: true
# # Hides the top right menu
#   - entity:
#       input_boolean.hide_overflow: 'on'
#     hide_overflow: true
# # Hides the account icon
#   - entity:
#       input_boolean.hide_account: 'on'
#     hide_account: true
# # Hides notification tray
#   - entity:
#       input_boolean.hide_notitications: 'on'
#     hide_notifications: true
# # Hides the search icon
#   - entity:
#       input_boolean.hide_search: 'on'
#     hide_search: true
# # Hides the assistant icon
#   - entity:
#       input_boolean.hide_assistant: 'on'
#     hide_assistant: true
# # Hides refresh menu item
#   - entity:
#       input_boolean.hide_refresh: 'on'
#     hide_refresh: true
# # Hides the unused entities menu item
#   - entity:
#       input_boolean.hide_unused_entities: 'on'
#     hide_unused_entities: true
# # Hides the reload resources menu item
#   - entity:
#       input_boolean.hide_reload_resources: 'on'
#     hide_reload_resources: true
# # Hides edit dashboard menu item
#   - entity:
#       input_boolean.hide_edit_dashboard: 'on'
#     hide_edit_dashboard: true
# # Block mouse on empty overflow menu-items
#   - entity:
#       binary_sensor.kiosk_mode_block_overflow: 'on'
#     block_overflow: true
# # Block mouse on overflow menu-items
#   - entity:
#       input_boolean.kiosk_mode_block_mouse: 'on'
#     block_mouse: true
#
#   - entity:
#       input_boolean.hide_dialog_header_action_items: 'on'
#     hide_dialog_header_action_items: true
#   - entity:
#       input_boolean.hide_dialog_header_history: 'on'
#     hide_dialog_header_history: true
#   - entity:
#       input_boolean.hide_dialog_header_settings: 'on'
#     hide_dialog_header_settings: true
#   - entity:
#       input_boolean.hide_dialog_header_overflow: 'on'
#     hide_dialog_header_overflow: true
#
#   - entity:
#       input_boolean.hide_dialog_history: 'on'
#     hide_dialog_history: true
#   - entity:
#       input_boolean.hide_dialog_history_show_more: 'on'
#     hide_dialog_history_show_more: true
#
#   - entity:
#       input_boolean.hide_dialog_logbook: 'on'
#     hide_dialog_logbook: true
#   - entity:
#       input_boolean.hide_dialog_logbook_show_more: 'on'
#     hide_dialog_logbook_show_more: true
#
#   - entity:
#       input_boolean.hide_dialog_attributes: 'on'
#     hide_dialog_attributes: true
#
#   - entity:
#       input_boolean.hide_dialog_media_actions: 'on'
#     hide_dialog_media_actions: true
#   - entity:
#       input_boolean.hide_dialog_update_actions: 'on'
#     hide_dialog_update_actions: true
#   - entity:
#       input_boolean.hide_dialog_climate_actions: 'on'
#     hide_dialog_climate_actions: true
#   - entity:
#       input_boolean.hide_dialog_timer_actions: 'on'
#     hide_dialog_timer_actions: true

That’s right, but apart from the power of the device, there is a network call delay (it needs to call to the server and then receive a response in an async way) this small delay will be added on top of the regular delay that kiosk-mode has at the beginning.

1 Like

also this, even when using javascript templates, they need to get the state of the entities in that template from the backend state machine. So not sure what the deciding factor would be…

With JavaScript templates, the state is taken directly from the hass front-end object. When Home Assistant loads and the DOM elements are available, the hass object is there, but if you want to render a Jinja template you need to make a WebSocket call and wait for its response (even if the data that you need is already there in the hass object and you can access it at that moment).

I think using templates is very useful.
In general, the whole purpose of Home Assistant is its endless possibilities.
So my answer yes YES !

1 Like

Hi folks, the poll didn’t receive many votes, but from the few votes we can conclude that this feature will be well received by kiosk-mode users. So, we have released a new major version supporting templates.
Thanks to all of you that participated in the poll and gave your input.
Regards

3 Likes

Im lost now today with kiosk_mode…

kiosk_mode:
  entity_settings:
    - entity:
        input_boolean.kiosk_mode: 'on'
      hide_header: true
    - entity:
        input_boolean.kiosk_mode: 'off'
      hide_header: false

This is what i used…
But i got lost in the new update how to fix this
Blegh

You did read the release notes?

There is a huge paragraph on the breaking changes and many examples for you there

Besides that double entity setting for the same entity/optionis not how it should have been in the first place

1 Like
kiosk_mode:
  hide_header: "{{ is_state('input_boolean.kiosk_mode', 'on') }}"
1 Like

I did saw the notes on update…but i could not fi d on web or those notes…so now im lost…lol
What i had came from our fella smart home junkie…
That worked always great. With help of input boolean…
Now i don’t have any clue. But learning tho…ty