跳转到内容

RGB 灯

rgb 灯光平台从 3 个浮点输出组件创建一个 RGB 灯(每个颜色通道一个)。

可与此组件配合使用的 RGB LED 灯带示例。
# 配置示例
light:
- platform: rgb
name: "Living Room Lights"
red: output_component1
green: output_component2
blue: output_component3

校准/校正 LED 灯带产生的颜色通常是有利的,因为不同颜色的感知强度通常会有所不同。这可以通过在各个输出通道上使用 max_power 来实现:

# 配置示例
light:
- platform: rgb
name: "Living Room Lights"
red: output_component1
green: output_component2
blue: output_component3
# 输出配置示例
output:
- platform: ...
id: output_component1
max_power: 80%
# 对绿色和蓝色输出重复相同操作

NOTE

请记住,gamma_correct 默认启用(γ=2.8),在校准时可能需要考虑这一点。例如,如果你将灯设置为 50% 亮度并希望这成为新的最大值:max_PWM_power = max_light_power^2.8 = 0.5^2.8 = 0.144,那么你应该将 max_power 设置为 14.4%