action:
- service: light.turn_on
entity_id: light.gateway_light_xxxxxxxxxx
data_template:
brightness: >
{% if now().hour >= 18 and now().hour < 20 %}60
{% elif now().hour >= 20 and now().hour < 21 %}50
{% elif now().hour >= 21 and now().hour < 23 %}40
{% elif now().hour >= 23 %}30
{% elif now().hour >= 0 and now().hour < 8 %}20
{% else %}40
{% endif %}
color_name: >
{% if now().hour >= 18 and now().hour < 21 %}yellow
{% elif now().hour >= 21 and now().hour < 22 %}red
{% elif now().hour >= 22 %}Magenta
{% elif now().hour >= 0 and now().hour < 8 %}blue
{% else %}white
{% endif %}
|