I’m trying to hide all tabs and make the alarm tab the only allowed tab when my alarm is in a certain state e.g. armed_away, but I only want to do this for a specific user (e.g. UserX, this is the name, not the username).
I can’t get it to work. I’ve gone through the documentation, but I’m probably not interpreting it correctly. This is what I have right now:
...
exceptions:
- conditions:
user_agent: Mobile
config:
menu: show
options: show
# user specific configuration.
- conditions:
user: UserX
config:
default_tab: lights
hide_tabs: tab_x,tab_y
hide_unused: true
disable_sidebar: true
conditional_styles:
- entity: alarm_control_panel.alarm
condition:
state: armed_away
tab:
lights:
hide: true
tab_x:
hide: true
tab_y:
hide: true
tab_z:
hide: true
What am I doing wrong? Also… is there maybe a better way to accomplish this?
mayker
(maykar (pronounced "maker" with a southern accent))
1243
The exception’s conditional_styles should be indented to be part of UserX’s config:
Thanks for putting me into the right direction. I indeed had to place conditional_styles under config, but it didn’t work with all of the tabs under tab like that.
Conditionals can for sure use some improvements, but they currently fit under the “working” category so aren’t high on the priority list. They will get some love when I get the time.
Thanks! That works perfectly with a lot less code. Didn’t think of using it like that at all.
I can totally understand that. At least it is working now with the least amount of code.
I might even try to put the repeating code into a separate template file, so I can reuse it. Not sure whether it will work, but I’ll try in a bit and if it doesn’t I’ll just use this.
mayker
(maykar (pronounced "maker" with a southern accent))
1247
In it’s current form it won’t work like that, but that is one of the first thing’s I’ll be adding to conditional templates: a way to create variables that can be accessed by all templates. A close second on the list would be allowing tab lists or groups in conditionals/templates.
You could cheat it a bit now by using global variables, but it would be much better to add something like that to config.
It doesn’t appear to hide the header, and the config bar seems to be missing. I made sure type: js, what else am I missing? I see that on my browser debug has the warning:
compact-custom-header.js?v=0.0.3:1 Uncaught SyntaxError: Identifier ‘LitElement’ has already been declared
at compact-custom-header.js?v=0.0.3:1
mayker
(maykar (pronounced "maker" with a southern accent))
1250
What does your resources section look like?
Edit: Updated the legacy version. Give it a shot. Also, make sure you don’t have CCH twice in your resources.
After updating to 1.4.3, the sidebar and menu don’t show on mobile unless I remove the exception I have for mobile. Here is the config of the mobile exception:
- conditions:
user_agent: Mobile
config:
default_tab: []
hide_tabs: 'Kiosk,Calendar,media-players,Github,Test'
menu: show
notifications: show
options: show
show_tabs: []
voice: overflow
compact_header: true
It also shows all tabs and doesn’t hide the tabs listed in hide_tabs.
Is there something wrong with my config? This was working previously.
Edit: My Home Assistant version is 0.99.3
mayker
(maykar (pronounced "maker" with a southern accent))
1255
Should be fixed in the latest pre-release. I had changed the structure of CCH a bit which is why this round of updates are still in pre-release. I have a fair few different configs that I cycle through for testing, but they don’t always catch some issues. Thanks!
however, i have found an issue. the hide tab / show tab feature dosent work on my rpi running chromium web browser. is this known? is there a way around it?
BR Mathias
mayker
(maykar (pronounced "maker" with a southern accent))
1258
What does your config look like? Any errors in HA or in your browser’s dev tools?
https://XXXX.XXX/community_plugin/compact-custom-header/compact-custom-header.js:1302:17 Uncaught TypeError: ranges.flat is not a function
Anslutning tappad. Ansluter igen...
it works perfectly on Chrome ( MAC) Android phone, and IOS APP.
also noticed that the clock dosent work on the Chromium either.
BR Mathias
mayker
(maykar (pronounced "maker" with a southern accent))
1260
You must be using an older version of Chromium. Either update to the latest or, if that’s not possible, use the legacy version of CCH found here: CCH for older devices & unsupported browsers