I’ve installed themes via HACS, but I actually like the Default theme. My problem is, I don’t know how to call it in an Automation.
If I, for example, install Google Theme, I can call it via frontend.set_theme. However, the Default theme is not an option. How do I get the Default theme to be an option I can select in an Automation?
Below is an Automation I created with the Google Theme. How do I get the Default theme as an option in this?
alias: Theme Change
description: ''
trigger:
- platform: state
entity_id: sun.sun
condition: []
action:
- choose:
- conditions:
- condition: sun
before: sunset
after: sunrise
sequence:
- service: frontend.set_theme
data:
name: Google Theme
mode: light
- conditions:
- condition: sun
before: sunrise
after: sunset
sequence:
- service: frontend.set_theme
data:
name: Google Theme
mode: dark
default: []
mode: single
It’s an Edge PWA on a Windows-based PC, but I don’t have the dark mode enabled for the browser.
Edit: As a test, I changed my default Edge browser theme to dark and yeah, the HA theme changed to dark. However, I don’t really like the browser dark theme. Is there anyway to call the Default Theme in an Automation?
Interesting aspect I discovered… I don’t think it’s possible to change themes based on Sun condition anyway. I never did actually try the Google Theme change, but it does not work with the Automation. I’ve actually changed up the Automation and it will not fire; nothing in the logs. And, again, the theme will change if Auto selected and I changed browser theme.
Yeah it does work, but you must have “Backend-selected” selected in your profile.
You are probably going to have to recreate the default themes as there does not seem to be a way to switch them other than automatically by the device’s dark mode.
Hi everyone,
It’s my first post and since this aspect has been driving me crazy for a long time I would like to contribute with my experience.
I would like the appearance to always be Dark without any conditions.
For this reason I set “DARK” between the 3 options and at the precise moment in which I set it the theme correctly changes to DARK color, EVEN in broad daylight.
My problem is that it doesn’t keep this setting saved (… or maybe I didn’t understand if there is a SAVE button…?!?).
In fact, if I execute DISCONNECT and reopen HA I find the AUTO setting again, and in fact it reopens with the light color.
Is there anyone who can confirm that this is indeed an error?
In light mode, even if I want to perform the action manually from developer tools - services - frontend.set_theme - set Home Assistant theme - dark mode - call service - it doesn’t give me errors but visually the theme doesn’t change…
Thanks if anyone can give me some help.
I have the same problem and am exhausted reading all the not helpful responses in all of the different posts of people asking the same thing.
I have a device that will not store cookies. The theme mode setting is reset every day to light mode. I want to be able to hard code the default theme only to dark mode. nothing else. No other options please. I need a global setting so that dark mode is the default setting of the default theme globally. Thank you in advance.