Frontend.set_theme

Hi All,

I made a automation for changing theme based on sun. But its not working.
When I do it in developer tool Its only change the page where I do the action.
My tablet (also other user) stay the same. How can I do this action?

Oh and I use a different Lovelace for tablet as well, can this be the problem?

In version 0.106.x it was working, I disabled it for a while. in 0.108.x its not working anymore.

###########################################################################################
#
# SYSTEM CHANGE THEME BASED ON SUN IS BELOW OR ABOVE HORIZON
#
###########################################################################################

- alias: "System - Automatic Theme Change Sunset"
  trigger:

    - platform: homeassistant
      event: start

    - platform: state
      entity_id: sun.sun

  action:
    service_template: frontend.set_theme
    data_template:
      name: "{{ 'default' if is_state('sun.sun', 'above_horizon') else 'peternight' }}"

Go to your profile and make sure 'backend-selected" is set for theme.

Thanks !!! you my hero!

1 Like