Home Assistant Community

Compact Custom Header


1 Like


Is it possible to hide the menu based on user_agents? I’m looking to make a faux user privileged feel by making it so certain users can’t see the menu to be able to adjust any settings. But I don’t want to hide it for my main admin account. It’d be something like this, maybe not done exactly this way, but you get my point:

- type: custom:compact-custom-header
  user_agent: admin, guest
    - menu,1,2,3,4
    - 2,4


This is already a feature, check out the readme for more options and use:

- type: custom:compact-custom-header
  menu: false, true      # first option is default, second is for admin...
  user_agent: admin
    - 2,4                # tabs shown by default
    - 1,2,3,4            # admin tabs

First option will always be default, next one is the first user agent, next one is the second user agent and so on. Every config option can be set per user agent this way.

1 Like


I have on iOS sometimes a strange behaviour.
Some clicks on the second tab are not recognized and I have to click the next tab before I can select my second tab (see attached video)



Hmm. Can you confirm that this doesn’t happen without the custom header?



sorry. need to take it back
it happens also without custom header
just now



Looks like it’s broken in 0.86.0b2.
Seeing the normal Header in FF and Chrome.

EDIT: Back in 0.86.0b1, everthings OK.

1 Like


Yeah I concur… it is broken with 0.86.0b2. (But they broke a bunch of stuff in b2 so I think this will be fixed in next beta or release)



@DavidFW1960 & @VDRainer

No errors? Anything being reported for the card in Chrome DevTools (F12)?



TypeError: Cannot read property ‘querySelector’ of null
at VM1345 compact-custom-header.lib.js:18




Looks like either something has been renamed or moved. Will check it out when I can get on the beta



Perhaps… they did break a few things… dunno if it’s anything you need to fix or if HA will fix it…



0.86.0b3 and it’s still not working… They fixed the other issue so I don’t know if that means a change is needed for this card or not. 0.86 is a couple of days to release I think.

1 Like


Updated to fix the 0.86 issue. Should be reasonably future proof in case things move around again.

Also fixed an issue for single tab layouts.



Custom Updater is not showing an update yet?



@mayker, views starting with 0 now?
Have to use 0,1,2,… to see my first view.

1 Like


Oops, didn’t mean to put in that breaking change in this release, but I guess I did!

Breaking Change!

To fall in line with default lovelace URL numbering, views now start with 0 instead of 1.

1 Like


Thanks for the heads up. Just updated readme to reflect the changes

1 Like


I always wondered why they were different! :wink:

1 Like


I, for one, welcome this breaking change! :smiley:

1 Like