sys_ui_theme_day_night

View All Rules

alias: sys_ui_theme_day_night
trigger:
  - platform: homeassistant
    event: start
  - platform: state
    entity_id: sun.sun
    to: above_horizon
  - platform: state
    entity_id: sun.sun
    to: below_horizon
action:
  - service_template: frontend.set_theme
    data_template:
      name: >
        {% if states.sun.sun.state == "above_horizon" %}
          default
        {% else %}
          blue_night
        {% endif %}

© 2020. Some rights reserved. The contents of this site is released under a Creative Commons Attribution-Share Alike license.