Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to choose light or dark mode in automation #27

Closed
welcoMattic opened this issue Sep 8, 2022 · 9 comments
Closed

Add ability to choose light or dark mode in automation #27

welcoMattic opened this issue Sep 8, 2022 · 9 comments
Labels
question Further information is requested

Comments

@welcoMattic
Copy link

I would like to automatically switch from light to dark mode depending on the sun position, via an automation. But actually, there's no way to do it with this theme.

Could you consider adding such a feature?

@piitaya piitaya added the question Further information is requested label Sep 8, 2022
@piitaya
Copy link
Owner

piitaya commented Sep 8, 2022

You can select "auto" in your profile and the theme will be automatically adapt with your mobile/computer.
There is no service for now in Home Assistant to choose the theme mode (light or dark)

@welcoMattic
Copy link
Author

I use an automation for it:

image

This automatically change the theme to use, depending on the sun position.

But in the "Set theme" service, there is an option to choose light or dark mode:

image

@TheFes
Copy link

TheFes commented Oct 27, 2022

The Blueprint needs to be adjusted to support modes. Contact the blueprint creator for that, or create the automation yourself using the state of sun.sun as the trigger and using the serivce call shown in your screenshot as an action.

@welcoMattic
Copy link
Author

No, the mode option has no effect on Mushroom theme. This is exactly the issue.

@piitaya
Copy link
Owner

piitaya commented Oct 27, 2022

The "set theme" service is not to choose which mode to use. It set a theme for this mode. The mode is managed by your phone/computer, not home assistant.
Documentation : https://www.home-assistant.io/integrations/frontend/#service-set_theme

@TheFes
Copy link

TheFes commented Oct 27, 2022

Well, it works on my desktop, If I use

service: browser_mod.set_theme
data:
  theme: Mushroom
  dark: dark

the Dark theme gets selected, when using dark: light the light theme gets selected.

However, it doesn't do anything on my mobile.

@piitaya piitaya closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2023
@sviperz
Copy link

sviperz commented Apr 6, 2023

@piitaya is there any workaround similar to what is proposed here? Madelena/Metrology-for-Hass#5 (comment)

Is it possible to do the same for Mushroom themes?

@piitaya
Copy link
Owner

piitaya commented Apr 6, 2023

I think it should work but I can not confirm. Mushroom theme is like every other theme.

@sviperz
Copy link

sviperz commented Apr 6, 2023

OK, but what do I need to put instead of *metro-common-dark / *metro-common-light from the example above?

I've tried this, but it doesn't work, both themes still have Auto/Light/Dark modes:

Mushroom Dark:
  modes:
    dark: {}

Mushroom Light:
  modes:
    light: {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants