I have a pretty reliable method of knowing when I am in my bedroom. I would like to make it so that when I open the Home Assistant app on my phone, it immediately opens the “Bedroom” view of my main dashboard (instead of the default view for the main floor).
I use yaml to configure all of my dashboards/views and I know how I can switch it up there if I hardcode it, but I’d like to be able to do it dynamically based on my “binary_sensor.in_bedroom” sensor, or via an automation triggered by that sensor.
This is possible using the Custom Header card by maykar. It has a feature called default_tab: which does exactly this. Here’s a copy and paste from my config for an example:
Oh wow, that’s awesome. Thanks for pointing that out! It looks like Custom Header also has per user/device options too. Time to dig in. I appreciate it!
Well, I got things working pretty well how I wanted… my only question is have you figured out a way to prevent the “flash” of the old header prior to replacing it with the Custom Header version?
I doubt it, as someone asked the same question on that thread just 2 days ago, and the author said it’s unavoidable.
I understand why Custom Header can’t control this, due to the shadow DOM and separation between the core and each component… but not sure if you’ve figured out anything a little “outside of the box”.
The flash of the old header isn’t so bad on a computer but on a phone it makes the whole UI “jerk” for a second every time you change tabs. Maybe I’ll get used to it but at the moment it’s making me wonder if the tradeoff is worth it.
I messed around with changing these variables in my theme:
At first it seemed better but I quickly realized it caused the header not to show on non-lovelace cards.
I am a full-time web developer and while I appreciate the component based setup… sometimes I am just longing for a classic “overrides.css” file that would let me do whatever I want!