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
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 ![]()
If you would like to try this feature, you can install the beta version available in HACS or directly in the release.