frontend
frontend copied to clipboard
Light/Dark Theme mode not working as expected
Checklist
- [X] I have updated to the latest available Home Assistant version.
- [X] I have cleared the cache of my browser.
- [X] I have tried a different browser to see if it is related to my browser.
Describe the issue you are experiencing
I have got Backend-selected on my profile page.

Calling the service from Developer Tools does not do anything.
service: frontend.set_theme
data:
mode: dark
name: Github Dark Theme
Also, the theme stays either on Light or Dark mode. It does not seem to switch between the modes or themes. I have an automation that sets the theme but it does not seem to switch.
automation:
- alias: Set Day/Night Theme
id: set_daynight_theme
initial_state: true
trigger:
- platform: state
entity_id: sun.sun
to: above_horizon
- platform: state
entity_id: sun.sun
to: below_horizon
- event: start
platform: homeassistant
action:
- choose:
- conditions:
- condition: state
entity_id: sun.sun
state: above_horizon
sequence:
- service: frontend.set_theme
data:
name: oxfordblue
- conditions:
- condition: state
entity_id: sun.sun
state: below_horizon
sequence:
- service: frontend.set_theme
data:
mode: dark
name: Github Dark Theme
default: []
Describe the behavior you expected
I expect the themes to switch based on the automation.
Steps to reproduce the issue
- Set theme to
Backend-selectedin profile page - Call
frontend.set_themeservice for a theme with dark mode. Before doing so, use a light theme.
...
What version of Home Assistant Core has the issue?
core-2022.4.1
What was the last working version of Home Assistant Core?
core-2022.3.5
In which browser are you experiencing the issue with?
Chrome Version 99.0.4844.84 (Official Build) (64-bit)
Which operating system are you using to run this browser?
Windows 10 Enterprise 20H2
State of relevant entities
No response
Problem-relevant frontend configuration
No response
Javascript errors shown in your browser console/inspector
No response
Additional information
No response
To add further information for this ticket:
The selected theme has a dark mode only.
According to the documentation, the selected theme should behave like described here: https://www.home-assistant.io/integrations/frontend/#dark-mode-support
Especially:
Since this example theme only has a `dark` mode defined, this mode will automatically be used.
Now, independent of the dark only mode, it seems the OS light mode overwrites some of these behaviors.
By the way, in my testing, everything worked fine once the OS light setting has been changed to Dark.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Has this been addressed?
same problem here. both followed by system and followed by HA, it stays white, even in the night.
same problem here.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
same problem here.
Same issue with them mode not working
I have this same issue. It looks like the theme mode preference is always overridden by the Personal Profile theme mode (which cannot be disabled)
Still same problem with theme mode setting.
Same problem here
I think this is likely duplicate of #11405. I did try to explain a bit there how I believe that this works, it was not intuitive to me at first. Perhaps we can keep all the discussion on one thread.
Duplicate of #11405