The frontend supports themes. This category is for sharing themes.
i’m not even sure if this is has been requested or if it’s even an available option… but i’d like to create an input_select list of all available themes dynamically. i know you can select them manually… but i’d like to be able to have one for ‘day’ and one for ‘night’ and have them both populated with all themes and then you can just switch them when you want and the automation will change the theme based on time of day/sun/etc…
i was looking to dynamically have an automation build the input select options… i know there is a service to set them… but this way when you add/remove themes you could just have it rebuilt the options in the input select… but i don’t think this is possible at the moment as i don’t see anywhere it’s technically listing the themes
Experience tells me the themes are fun while setting up and testing, and something like that would be interesting.
After having settled with the themes desired and having things exactly the way I want them, I havent looked at them at all, and the package above does all I need. Set the appropriate themes automatically based on sun state, and give me the option to override them whenever I need, also automated biased on the independent input_select.
Hey folks - not exactly what you’re looking for (re input_select) but thought I would share anyway. This script is tied to a button in my UI, and makes a service call, and assigns a random theme (which I had to manually define in the script - still no idea how to do this dynamically).
thats a very good question on the dynamic generation of themes. I see that there is no “get_theme” although there is a “set_theme” for the frontend service. May be we put this in the feature request?
I’ll poke around and see if it has been submitted already. As someone mentioned above, it clearly is already being generated (for the existing dropdown menu) but I cannot figure out how (or if) this is exposed to the user in a way we can use it.
Honestly, I would settle for knowing how to write a template to get the current theme being used! I’d like to put that template value in my button that calls the random theme script as a title so I know what the name of the theme is.
I made something similar to this a few weeks ago. I also wanted to use the built-in theme selector, but couldn’t find a way, so I made my own. Unfortunately, I have to manually update the list of themes, and a restart of HA is required, but it works for me and works well.
I have 3 options. 1 to change the theme, 1 for daytime theme, and 1 for the nighttime theme.
The 1st one to change the theme is more for if I get bored and want to change things around. The other 2 are pretty self explanatory.
Automations are also available to change as needed. One for the day/night cycle, and the other for when I use the first box to change the theme. The day/night automation will override this one.
This is my frontend. Make sure you have backend-selected in the built-in theme selector. The 2 toggles are to turn on/off the automations.
Drop-down the list of themes
Starting at the end of the last theme name and click down and drag to the top of the list
Ctrl-C
Paste into MS Word
Search and replace...
Ctrl-H
Search: ^p
Replace: @,@
Edit start by adding:
{{ [@
Edit end by adding:
] | random }}
Select all and copy
Ctrl-A
Ctrl-C
Paste into notepad
Search and replace
Ctrl-H
Search: @
Replace: '
Select all and copy
Ctrl-A
Ctrl-C
Back to HA and create the following:
theme_set:
alias: Theme Set
sequence:
- data_template: >
<paste into here>
service: frontend.set_theme