Set theme not working

Im only using chrome so i cant tell :slight_smile:

This is my automation:

- id: change_current_theme
  alias: 'Change Current Theme'
  initial_state: 'on'
  trigger:
      - platform: state
        entity_id: input_select.utseende
  action:
      - service: frontend.set_theme
        data_template:
          name: '{{states.input_select.utseende.state}}'
2 Likes

Just to make that simple and clear:

frontend.set_theme will ONLY work, if you have chosen theme ā€œBackend-selectedā€ under your profile in HA.
If you have selected any other theme there, it is NOT possible to change that theme through automations.

1 Like

Thanks for clarifying that. I wish this was mentioned in the Frontend documentation.
However, I observe different behaviour (HA 0.112.1) between Firefox and Chrome. In Firefox indeed the theme should be set to ā€œBackend-selectedā€ for frontend.set_theme to work but in Chrome that seems to work even if a specific theme is selected in your profile.

I cannot confirm that. For me Chrome behaves exactly as expected: Setting the userā€™s theme to a dedicated theme forces that theme to be used. Setting the usersā€™s theme to ā€œBackend-selectedā€ activates the selection through automations.

Have you been using incognito mode when testing? Did you disable all cookies in chrome? Anything else that would impede the browser storing the needed data for your selection to become active?

I cannot replicate the behaviour in Chrome anymore. Not sure what it did but Chrome is now behaving as expected. Thanks for your response.

this works for meā€¦

trigger:
- platform: homeassistant
event: start
action:
- service: frontend.reload_themes
data: {}
- service: frontend.set_theme
data:
name: Caule Black Blue Glass"