lovelace-mushroom-themes
lovelace-mushroom-themes copied to clipboard
Add ability to choose light or dark mode in automation
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?
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)
I use an automation for it:
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:
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.
No, the mode option has no effect on Mushroom theme. This is exactly the issue.
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
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 is there any workaround similar to what is proposed here? https://github.com/Madelena/Metrology-for-Hass/issues/5#issuecomment-1120463625
Is it possible to do the same for Mushroom themes?
I think it should work but I can not confirm. Mushroom theme is like every other theme.
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: {}