# HearthNodes recipe 09 - overcast compensation
alias: "Light - north kitchen overcast top-up"
id: hn_light_overcast_topup
description: "Top up the under-cabinet strip to hold 350 lx, ceiling stays off"
mode: single
max_exceeded: silent
trigger:
- platform: numeric_state
entity_id: sensor.kitchen_counter_lux
below: 300
for: "00:00:30"
- platform: numeric_state
entity_id: sensor.kitchen_counter_lux
above: 420
for: "00:00:30"
variables:
target_lx: 350
measured: "{{ states('sensor.kitchen_counter_lux') | float(350) }}"
strip_current: "{{ state_attr('light.under_cabinet_strip','brightness') | int(0) / 2.55 }}"
raw: "{{ strip_current + ((target_lx - measured) / 6) }}"
topup: "{{ [[raw, 10] | max, 85] | min | round(0) }}"
condition:
- condition: state
entity_id: binary_sensor.kitchen_occupied
state: "on"
- condition: time
after: "06:30:00"
before: "21:00:00"
- condition: template
value_template: >-
{{ is_state('select.kitchen_task_scene','ambient')
or is_state('select.kitchen_task_scene','off') }}
action:
- service: light.turn_on
target:
entity_id: light.under_cabinet_strip
data:
brightness_pct: "{{ topup }}"
color_temp_kelvin: 3000
transition: 3
- service: light.turn_off
target:
entity_id: light.kitchen_ceiling
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.kitchen_counter_lux
below: 200
sequence:
- service: select.select_option
target:
entity_id: select.kitchen_task_scene
data:
option: counter
# The strip's own controller minimum (8 percent) is why the automation floor is
# 10 percent. Scene selection beats time-of-day here: dinner happens at different
# hours and the automation must not argue with a pressed button.
触发器 · state
sensor.kitchen_counter_lux
台面照度掉到 300 lx 以下,或升到 420 lx 以上。
分步说明
- light.under_cabinet_strip把灯带设为补光档位,限制在 10 %–85 %;超过 85 % 灯带会比顶灯更亮,观感不对。
turn_on · brightness_pct {{ topup }} · color_temp_kelvin 3000 - light.kitchen_ceiling白天显式保持顶灯关闭;正是这一点去掉了房间里最大的一项能耗。
keep off - select.kitchen_task_scene低于 200 lx 时切到「台面加权」场景,把更多光给工作台面、更少给整个房间。
set 'counter' when lux < 200
让传感器看不到窗户
能看到窗户的厨房照度传感器在晴天会读到 800 lx,于是在台面正处于阴影里时反而把灯带调暗。在传感器上方加一个小遮光板,让它的视野只有工作台面和柜门,别无其他。
灯带亮度上限要低于顶灯
橱柜下灯带开到 100 % 会在柜面投下生硬的阴影,即使台面很亮,房间看起来也像是没打好光。85 % 是实际可用的上限;再高就该交给顶灯回路了。
不要和晚间场景抢控制权
一旦有人选择晚餐或保洁场景,本配方必须让位。用「场景选择器」条件而不是时间条件,因为晚餐时间不固定,自动化不该和刚按过按钮的人较劲。
硬件
| 型号 | 协议 | 连接 | 在本链路中的作用 |
|---|---|---|---|
| LED strip on a Zigbee CCT controller (e.g. GLEDOPTO or Gledopto-class controller) | zigbee |
无线 | 橱柜下灯带;请选择支持真实 1 % 下限的控制器,这样 10 % 的下限才准确。 |
| Counter-height lux sensor | zigbee |
无线 | 装在上柜下方、朝下指向工作台面,并遮挡窗户方向,使其读取的是任务照明。 |
| Kitchen zone presence sensor | zigbee |
无线 | 非成像存在检测,确保补偿只在有人看得见效果时才运行。 |
失效时怎么办
如果照度传感器不可用,只要厨房有人,灯带就回退到固定 45 %——这是调试期间在最多工况下都表现最好的档位。顶灯保持关闭;如果需要更亮,墙面开关仍可直接控制顶灯。