home-automation-home-assistant/automations/theme-switch.yaml
Florian Brinker 2e501bc322 update
2019-10-13 11:25:04 +02:00

28 lignes
659 B
YAML

# 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 %}