Then on the root folder of home assistant, I have a folder called themes with a yaml file for each themes.
For instance, I have the following file: dark_theme.yaml
which is a heavily based on a theme posted on this forum by user @GreenTurtwig (post 37).
I will try to clean up all my codes and uplaod them to github this week-end, as you seems to be interested in all the same stuff as me, it might be helpful for you
So when I put your theme code in my configuration.yaml under frontend and themes, I should expect the theme colour to change automatically? Or do I have to select it manually?
Because like I mentioned in my previous post, when I upload the theme code under frontend and themes, I don’t see any change in the colour of my theme.
then you just add it to a group in order to have both the input_select and the script show in the frontend. You select the right theme, then click activate just next to the script and tadaaa it works.
The automation I have given previously in post 73 automatically changes the theme when the sun sets/rise (so no direct change otherwise)
You can also call the service manually using the dev-services tools like I did on the image below
Instead of using a script that requires you to click activate, I recommend using an automation that changes the theme based on input_select.current_theme:
I have the following alternative to @ahs solution. I implemented an input_boolean to control enable/disable the automations (if auto_darktheme is off, the theme will not change automatically)
# Set dark theme for the night
- alias: 'Set dark theme for the night'
initial_state: True
trigger:
- platform: sun
event: sunset
condition:
- condition: state
entity_id: input_boolean.auto_darktheme
state: 'on'
action:
- service: frontend.set_theme
data:
name: 'dark_theme'
# Set default theme for the day
- alias: 'Set default theme for the day'
initial_state: True
trigger:
- platform: sun
event: sunrise
condition:
- condition: state
entity_id: input_boolean.auto_darktheme
state: 'on'
action:
- service: frontend.set_theme
data:
name: 'default'
I have setup all the themes and everything works fine. However, whenever I restart HA my themes reload to the default one. My config is below but I have no joy:
- alias: 'Automation for Theme HA Restart'
initial_state: True
trigger:
- platform: homeassistant
event: start
action:
- service: frontend.reload_themes
Hi, for some reason i didn’t get it to work. I can select a theme from the input_select in the frontend but nothing happens. When i tried with my iPhone using the Home Assistant app it worked. The app connects by IP and on my computer i use hassbian.local:8123 address. I tried on my computer to connect with ip and everything works. Any idea why it does not work with hassbian.local:8123?
Realy like the theme, Just a small fix for tables not looking right, I added the following to the end of the theme file (not sure if both lines are needed):
Can anyone please tell me which line affects the developer tools icons? Also, has anyone been successful with changing the initial color (unselected) of the icons to the left of overview, map, logbook, history, etc.
i need some help with this im getting the following error:
Configuration invalidCHECK CONFIG
Invalid config for [frontend]: expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘accent-color’]. Got ‘#E45E65’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘dark-primary-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘disabled-text-color’]. Got ‘#7F848E’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘divider-color’]. Got ‘rgba(0, 0, 0, .12)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘google-green-500’]. Got ‘#39E949’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘google-red-500’]. Got ‘#E45E65’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘label-badge-background-color’]. Got ‘#2E333A’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘label-badge-border-color’]. Got ‘green’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘label-badge-red’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘label-badge-text-color’]. Got ‘var(–primary-text-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘light-primary-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘midnight’]. Got None expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-card-background-color’]. Got ‘#434954’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-card-header-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-dialog-background-color’]. Got ‘#434954’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-grey-200’]. Got ‘#414A59’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-grey-50’]. Got ‘var(–primary-text-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-item-icon-active-color’]. Got ‘#F9C536’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-item-icon-color’]. Got ‘var(–primary-text-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-item-icon_-color’]. Got ‘green’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’]['paper-item-selected-_background-color’]. Got ‘#434954’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-listbox-background-color’]. Got ‘#2E333A’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-listbox-color’]. Got ‘var(–primary-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-slider-active-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-slider-container-color’]. Got ‘linear-gradient(var(–primary-background-color), var(–secondary-background-color)) no-repeat’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-slider-disabled-active-color’]. Got ‘var(–disabled-text-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-slider-disabled-secondary-color’]. Got ‘var(–disabled-text-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-slider-knob-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-slider-knob-start-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-slider-pin-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-slider-secondary-color’]. Got ‘var(–secondary-background-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-tabs-selection-bar-color’]. Got ‘green’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-toggle-button-checked-bar-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-toggle-button-checked-button-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-toggle-button-checked-ink-color’]. Got ‘var(–accent-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-toggle-button-unchecked-bar-color’]. Got ‘var(–disabled-text-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-toggle-button-unchecked-button-color’]. Got ‘var(–disabled-text-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘paper-toggle-button-unchecked-ink-color’]. Got ‘var(–disabled-text-color)’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘primary-background-color’]. Got ‘#383C45’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘primary-color’]. Got ‘#5294E2’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘primary-text-color’]. Got ‘#FFFFFF’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘secondary-background-color’]. Got ‘#383C45’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘secondary-text-color’]. Got ‘#5294E2’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘table-row-alternative-background-color’]. Got ‘#3E424B’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘table-row-background-color’]. Got ‘#353840’ expected a dictionary for dictionary value @ data[‘frontend’][‘themes’][‘text-primary-color’]. Got ‘var(–primary-text-color)’. (See C:\Users\HTPC\AppData\Roaming.homeassistant\configuration.yaml, line 20). Please check the docs at Home Assistant frontend - Home Assistant
just made all step like you said, but when a try to change theme (user profile) says “No themes available.”
I also tried to change manually using the services, bu i don’t have the domain “frontend”, although the frontend is active in configuration.yaml (i simply copy>paste your code)