frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Light/Dark Theme mode not working as expected

Open kaizersoje opened this issue 3 years ago • 9 comments

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.

image

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

  1. Set theme to Backend-selected in profile page
  2. Call frontend.set_theme service 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

kaizersoje avatar Apr 08 '22 11:04 kaizersoje

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.

einschmidt avatar Apr 08 '22 11:04 einschmidt

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.

github-actions[bot] avatar Jul 07 '22 12:07 github-actions[bot]

Has this been addressed?

kaizersoje avatar Jul 08 '22 06:07 kaizersoje

same problem here. both followed by system and followed by HA, it stays white, even in the night.

snickers2k avatar Jul 26 '22 23:07 snickers2k

same problem here.

victorvcunha avatar Aug 20 '22 14:08 victorvcunha

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.

github-actions[bot] avatar Nov 18 '22 15:11 github-actions[bot]

same problem here.

kaizersoje avatar Nov 23 '22 07:11 kaizersoje

Same issue with them mode not working

Torrecilla avatar Dec 01 '22 21:12 Torrecilla

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)

cdemi avatar Dec 18 '22 21:12 cdemi

Still same problem with theme mode setting.

irovder avatar Jan 25 '23 22:01 irovder

Same problem here

gmarchett avatar Jun 13 '23 21:06 gmarchett

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.

karwosts avatar Jun 14 '23 22:06 karwosts

Duplicate of #11405

karwosts avatar Jul 01 '23 14:07 karwosts