SM16716 LED 驱动器
组件/集线器
Section titled “组件/集线器”SM16716 组件代表 ESPHome 中的 SM16716 LED 驱动器链 (SM16716 描述, SM16716 描述)。通信通过两个 GPIO 引脚(MOSI 和 SCLK)完成,多个驱动芯片可以串联。它用于一些智能灯泡:
- Feit Electric A19 智能 WiFi 灯泡
- Merkury Innovations A21 智能 Wi-Fi 灯泡
要使用此组件的通道,您首先需要设置全局 sm16716 集线器并为其指定 id,然后定义单个输出通道。
# 示例配置条目sm16716: data_pin: GPIOXX clock_pin: GPIOXX num_channels: 3 num_chips: 1-
data_pin (必填, 引脚架构):用于 MOSI 的引脚。
-
clock_pin (必填, 引脚架构):SCLK 连接到的引脚。
-
num_channels (可选, 整数):整个链的总通道数。 必须在 3 到 255 范围内。默认为 3。
-
num_chips (可选, 整数):链中的芯片数量。 必须在 1 到 85 范围内。默认为 1。
-
id (可选, ID):此
sm16716组件使用的 id。 如果您同时连接了多个 SM16716 链,请使用此选项。
SM16716 输出组件将全局组件/集线器的 SM16716 通道作为浮点输出暴露。
# 单个输出output: - platform: sm16716 id: output_red channel: 0 - platform: sm16716 id: output_green channel: 1 - platform: sm16716 id: output_blue channel: 2-
id (必填, ID):此输出组件使用的 id。
-
channel (*必填, 整数):选择此输出组件的 SM16716 链的通道。
-
sm16716_id (可选, ID):手动指定组件/集线器的 ID。 如果您想同时使用多个 SM16716 链,请使用此选项。
-
所有其他选项来自 Output。
Feit Electric A19 智能 WiFi 灯泡
Section titled “Feit Electric A19 智能 WiFi 灯泡”此组件可用于某版本的 Feit Electric A19 智能灯泡。您可以使用 tuya-convert 刷写灯泡。冷白 LED 连接到 PWM1,暖白 LED 连接到 PWM2。RGB LED 连接到 SM16716 芯片,该芯片连接到 GPIO4(时钟)、GPIO14(数据)和 GPIO13(电源)。Feit Electric A19 的完整配置如下:
esphome: name: GPIOXX friendly_name: GPIOXX
esp8266: board: esp01_1m
wifi: ssid: !secret wifi_ssid password: !secret wifi_password
api:
logger:
ota: platform: esphome
sm16716: data_pin: GPIO14 clock_pin: GPIO4 num_channels: 3 num_chips: 1
output: - platform: sm16716 id: output_red channel: 0 power_supply: rgb_power - platform: sm16716 id: output_green channel: 1 power_supply: rgb_power - platform: sm16716 id: output_blue channel: 2 power_supply: rgb_power - platform: esp8266_pwm id: output_cold_white pin: GPIO5 - platform: esp8266_pwm id: output_warm_white pin: GPIO12
light: - platform: rgbww name: ${friendly_name} id: light red: output_red green: output_green blue: output_blue cold_white: output_cold_white warm_white: output_warm_white cold_white_color_temperature: 6500 K warm_white_color_temperature: 2700 K
power_supply: - id: rgb_power pin: GPIO13NOTE
白色 LED 比彩色 LED 亮得多,即使白色电平设置得很低,也会完全盖过设定的颜色。您需要将白色电平设置为 0 才能从此灯泡获得可用的颜色。
Costco Feit A19 RGBCT 灯泡的替代配置:
sm16716: data_pin: GPIO12 clock_pin: GPIO14 num_channels: 3 num_chips: 1
output: - platform: sm16716 id: output_red channel: 2 power_supply: rgb_power - platform: sm16716 id: output_green channel: 1 power_supply: rgb_power - platform: sm16716 id: output_blue channel: 0 power_supply: rgb_power - platform: esp8266_pwm id: output_color_temperature inverted: true pin: GPIO5 - platform: esp8266_pwm id: output_brightness min_power: 0.05 zero_means_zero: true pin: GPIO4
light: - platform: rgbct name: ${friendly_name} id: outside red: output_red green: output_green blue: output_blue color_temperature: output_color_temperature white_brightness: output_brightness cold_white_color_temperature: 153 mireds warm_white_color_temperature: 370 mireds color_interlock: true
power_supply: - id: rgb_power pin: GPIO13