home-automation-home-assistant/automations/theme-switch.yaml

28 行
659 B
YAML

2019-10-13 09:25:04 +00:00
# You can replace default by Light - Green, for example
- alias: 'Set theme at startup'
trigger:
- platform: homeassistant
event: start
action:
- service: frontend.set_theme
data:
name: default
- alias: 'Set HA theme for day and 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 %}
default
{% endif %}