I got 3 helpers:
one to toggle on the automation:
/ input_boolean.lmp_001_shower_dynamicbrightness_auto_001_toggle
on to determine a ‘before hour’
/ input_datetime.lmp_001_shower_dynamicbrightness_auto_001_before_hour
→ example: value is set a 6h00
on to determine a ‘after hour’
/ input_datetime.lmp_001_shower_dynamicbrightness_auto_001_after_hour
→ example: value is set a 23h00
And a light: light.shower.
I want to have the following results:
Between 6h00 and 23h00 - during the day:
color temp 434
brightness 10%
Between 23h00 and 6h00 - during the night
color temp 360
brightness 60%
What I want to achieve is:
1/ to make the hours in the code below dynamic, so I can set them with the time helpers,
2/ be sure code is correct
alias: LMP_001_shower_dynamicbrightness_auto_001_day
description: ''
trigger:
- platform: state
to: 'on'
entity_id: input_boolean.lmp_001_shower_dynamicbrightness_auto_001_toggle
condition: []
action:
- service: light.turn_on
data:
color_temp: >
{% if now().hour > 23 %}434
{% elif now().hour < 6 %}60
{% else %}100
{% endif %}
brightness_pct: >
{% if now().hour > 23 %}10
{% elif now().hour < 6 %}360
{% else %}250
{% endif %}
target:
entity_id: light.shower
mode: single