чтобы при любом включении света (в т..ч мануального с пульта) с часу ночи до шести утра он зажигался в теплом свете минимальной яркости.
- id: 'bathroom_light_brightness'
alias: "Свет в ванной: автоуправление"
description: "Автоматическая яркость света"
initial_state: true
trigger:
- platform: state
entity_id: light.svetilnik_v1
to: 'on'
- platform: state
entity_id: light.svetilnik_v2
to: 'on'
- platform: state
entity_id: light.svetilnik_v3
to: 'on'
- platform: state
entity_id: group.bathroom_light
to: 'on'
action:
- service: light.turn_on
entity_id:
- light.svetilnik_v1
- light.svetilnik_v2
- light.svetilnik_v3
data_template:
brightness_pct: >
{%- if states("binary_sensor.tod_morning") == 'on' -%}
20
{%- elif states("binary_sensor.tod_day") == 'on' -%}
99
{%- elif states("binary_sensor.tod_evening") == 'on' -%}
75
{%- else -%}
1
{% endif %}
color_temp: >
{%- if states("binary_sensor.tod_morning") == 'on' -%}
280
{%- elif states("binary_sensor.tod_day") == 'on' -%}
195
{%- elif states("binary_sensor.tod_evening") == 'on' -%}
240
{%- else -%}
333
{% endif %}
# color_temp: 221