Change user defaults for theme and sidebar

When I log in to HA, my previously set sidebar settings and default theme are reset to HA defaults. I see from my reading this is expected behavior.

For the theme I have added this automation:

- alias: 'Set theme at startup'
  trigger:
    platform: homeassistant
    event: start
  action:
    service: frontend.set_theme
    data:
      name: kibibit-dark-cards

But that does not change the theme when I log in.

What is the proper way to specify sidebar configuration and default theme that will persist when logging out and loggin back in? Or is that not possible?

Thank you!
Eric

2 Likes

You have to have the theme set to “Backend Selected” in your profile for this to work.

Also that trigger only triggers after Home Assistant starts, not when you log in.

Ah yes of course. Now the default theme is being applied after I restarted. Thank you!

What about making my sidebar configuration changes persist? Can that be automated or saved to a config file? Or is that currently not possible.

Unfortunately this is saved in your browser. So if you have the browser set to clear your browser history when it shuts down then you lose the setting.

Got it. I am on a privacy kick so I do have my browser set that way. =)

@erikor - is there a more elegant solution for this problem that you found (another way to default to a certain theme and sidebar settings) or did you just stop clearing the browser cache?

Also how do you hide the sidebar with an automation?

I have never logged out explicitly from HA - so my settings (theme, sidebar) were persistent.
Surely when I cleared a browser’s cache - I had to login again, set a theme, a sidebar etc.
I thought that I have to re-login & re-set settings since cookies are deleted.

Now I realized that if I logout - then after re-login all my settings are “purged”.
Seems that these “local settings” are “purged” after logout - even when I do not clear a cache manually and I do not know anything about settings for “automatically clear settings after logout”.
I find this really inconvenient when several users are using HA.


Discussion: