I have an automation to adjust brightness to time, but after a year of using, it works well, but it seems like the sun does not care about the current time
Motion turns on the yeelight, and another automation set the brightness, here is the current solution:
- alias: Dining Room brightness
trigger:
- platform: state
entity_id: light.etkezo_rgbw
from: 'off'
to: 'on'
action:
- service: light.turn_on
data_template:
brightness_pct: >
{% set hour = now().hour | int %}
{% if hour >= 7 and hour < 8 %} 15
{% elif hour >= 8 and hour < 9 %} 40
{% elif hour >= 9 and hour < 18 %} 100
{% elif hour >= 18 and hour < 19 %} 50
{% elif hour >= 19 and hour < 20 %} 30
{% elif hour >= 20 and hour < 21 %} 10
{% else %} 1
{% endif %}
kelvin: >
{% set hour = now().hour | int -%}
{% if hour >= 6 and hour < 8 %} 3000
{% elif hour >= 8 and hour < 18 %} 3500
{% elif hour >= 18 and hour < 20 %} 2500
{% else %} 1700
{% endif %}
entity_id: light.etkezo_rgbw
How can I transform this to sunrise+1 hour, sunrise+2hours, sunset+1hour, sunset+2hours, or something like this, or if you have better idea it would be nice too, I’m thinking about it since autumn where we first set the 1 hour to winter time.