Compact Custom Header

Yep and you can use default_tab_template with any of the conditions as well.

So far the latest update doesn’t have the previously mentioned problem with the login screen. I will test out tab groups later today.

Thanks for your hard work.

1 Like

FIXED thank you


Also the new tab template will be awesome for Spotify :grin: if music playing switch to media tab :ok_hand: thanks again

1 Like

Exactly this templating stuff is great as it will save me from using state-switches and/or browser_mod to achieve this.

Really great work. Just a wild question which has nothing to do with your custom card @mayker, would it be possible to do the same for backgrounds? As in lovelace wallpaper with a template like the header?

hoped this would have solved my issue with the navigation to the out of view tab, but it hasn’t unfortunately: Compact Custom Header - #1150 by Mariusthvdb still as it was

btw, I see this (unrelated?) error:

local/lovelace/resources/compact-custom-header/compact-custom-header.js?v=1.3.7:1033:13 Uncaught ReferenceError: above is not defined

1 Like

That was my mistake, just pushed 1.3.8 to fix and also make default tab respect redirect settings. It’s likely that error was preventing the view from being shown as well.

not just yet…now see this:

/local/lovelace/resources/compact-custom-header/compact-custom-header.js?v=1.3.8:1110:42 Uncaught TypeError: Cannot read property 'querySelector' of undefined

and see the tab in view for a second, and then see it sliding out of view 1 tab again…

What does your config look like?

# https://github.com/maykar/compact-custom-header/wiki/Main-Config-Options
#type: custom:compact-custom-header
#main_config: true
header: true
menu: show
options: show
swipe: true
swipe_animate: none
chevrons: true
exceptions:
  - conditions:
      user_agent: iPhone
    config:
      menu: hide
      notifications: hide
      header: true
      options: hide
conditional_styles:
  - template:
      - tab:
          'alarm':
            icon: >
              var alarm = entity['alarm_control_panel.ha_main_alarm'].state;
              if (alarm == 'disarmed') 'mdi:shield-check';
              else if (alarm == 'armed_away') 'mdi:shield-lock';
              else if (alarm == 'armed_custom_bypass') 'mdi:security';
              else if (alarm == 'armed_home') 'mdi:shield-home';
              else if (alarm == 'armed_night') 'mdi:shield-home';
              else if (alarm == 'pending') 'mdi:shield-outline';
              else if (alarm == 'triggered') 'mdi:bell-alert';
              else 'mdi:shield-check';
      - tab:
          'phones_tablets':
            icon: >
              var family = entity['sensor.family_home'].state;
              if (family == '0') 'mdi:account-off';
              else if (family == '1') 'mdi:account';
              else if (family == '2') 'mdi:account-multiple';
              else if (family == '3') 'mdi:account-multiple-check';
              else 'mdi:account-group';
      - tab:
          'weer_klimaat':
            icon: >
              var weer = entity['sensor.weather_icon'].state;
              weer;
  - entity: notifications
    condition:
      state: false      # When there are no notifications...
    button:             # hide notifications button.
      notifications:
        hide: true

it’s the tab weer_klimaat I am navigating to.

If you’re using HA version 0.96 or above remove this:

  - entity: notifications
    condition:
      state: false      # When there are no notifications...
    button:             # hide notifications button.
      notifications:
        hide: true

I’ll make an exception for it in the next release, but there is no longer a notifications button in the header so that code does nothing, except cause an error.

I’ve made the template to switch to the music tab if Spotify is playing which is great, One question though is it possible for it to switch to that tab when HA is already open? I’ve noticed it will only go to that tab on opening HA. Great update mate :grinning:

1 Like

Hi I just upgraded to HA 99.1 and my menu button has stopped working. I have tried to update to 99.2 on docker but it keeps downloading 99.1
:

  main_config: true
  swipe: true
  background: 'rgba(46, 45, 45, 1)' 
  menu: overflow
  options: overflow
  clock_format: 12
  clock_date: true
  date_locale: true
  clock_am_pm: true
  hide_help: true
  hide_config: true
  hide_unused: true
  compact_header: true
  voice: hide

Any help please thanks.

I created a new user, i’m running the latest version of hassio.
my question is how can i configure that the user will see only one tab, i want to hide everything else.

can someone help can i do it?

See https://maykar.github.io/compact-custom-header/Exception-Config/
And https://maykar.github.io/compact-custom-header/Main-Config-Options/

1 Like

See https://maykar.github.io/compact-custom-header/Exception-Config/

And https://maykar.github.io/compact-custom-header/Main-Config-Options/

Where i need to add the following?
under configuration.yaml ?

When i trying, i’m receiving cch integration not found

That is expected, it is not an integration, this is for your frontend and needs to go in your Lovelace configuration.
https://www.home-assistant.io/lovelace/

I have changed

options: show
No difference

And the other thing I updated was my iPhone to iOS 13.

Edit: Just tried the menu on my pc using chrome and the menu works just fine.

So it looks like a iOS problem.

To get Lovelace to switch to a tab while open you should use thomasloven’s browser-mod. I’d like to avoid feature overlap as much as possible. It has some amazing features and definitely worth checking out.

Is it your menu button image or your options button image ?

If it’s your menu button try using menu: show or just removing the menu item as show is it’s default. The options button will ignore “overflow” as it cannot be inserted into itself. I’ll have an iOS device to troubleshoot with this weekend and will check it out more when I get it.

Hi ,

i tried and it’s working only if i’m login from cellphone, i want it to hide the tab from any device,

user : Test2

cch:
  menu: overflow
  options: clock
  voice: hide
  clock_format: 12
  exceptions:
    - conditions:
        user: Test
      config:
        voice: show
        options: clock
        clock_format: 24
    - conditions:
        user: Test2
        user_agent: Mobile
        media_query: "(max-width: 600px)"
      config:
        options: clock
        clock_format: 12
        hide_tabs: 0,1
    - conditions:
        query_string: kiosk
      config:
        kiosk_mode: true