Made a fresh HA install, created 31 tabs ( 0 - 30 ) and added an input select named “mode” with 2 options:
input_select:
mode:
initial: Developer
options:
- Developer
- Not Developer
Using this config:
custom_header:
show_tabs: >-
{% if is_state('input_select.mode','Developer') %}0 to 29{% else %}0 to 3,5 to 22,27,29{% endif %}
exceptions:
- conditions:
user_agent: Chrome
config:
show_tabs: >-
{% if is_state('input_select.mode','Developer') %}0 to 30{% else %}0 to 3,5 to 22,27,29,30{% endif %}
Results:
- In Chrome and “Developer” selected: All tabs are shown
- In Chrome and “Not Developer” selected: tabs 4, 23, 24, 25, 26, and 28 are hidden.
- In Safari and “Developer” selected: tab 30 is hidden.
- In Safari and “Not Developer” selected: tabs 4, 23, 24, 25, 26, 28, and 30 are hidden.
Using Templates:
Keeping everything else exactly the same, but only changing the condition from user_agent: Chrome
to template: "{{'Chrome' in userAgent}}"
produces exactly the same results. While using template: "{{'Chrome' not in userAgent}}"
produces the opposite results as expected.
This all seems to be behaving as it should. Is there anything I’m missing? Anything else you’d like me to test while I have it set up?
Gif from results of template: "{{'Chrome' in userAgent}}"
in Chrome: