SM16716 LED driver¶
Component/Hub¶
The SM16716 component represents a SM16716 LED driver chain (SM16716 description, SM16716 description) in ESPHome. Communication is done with two GPIO pins (MOSI and SCLK) and multiple driver chips can be chained. It is used in some smart light bulbs:
Feit Electric A19 Smart WiFi Bulb
Merkury Innovations A21 Smart Wi-Fi Bulb
To use the channels of this components, you first need to setup the
global sm16716
hub and give it an id, and then define the
individual output channels.
# Example configuration entry
sm16716:
data_pin: GPIOXX
clock_pin: GPIOXX
num_channels: 3
num_chips: 1
Configuration variables:¶
data_pin (Required, Pin Schema): The pin used for MOSI.
clock_pin (Required, Pin Schema): The pin which SCLK is connected to.
num_channels (Optional, int): Total number of channels of the whole chain. Must be in range from 3 to 255. Defaults to 3.
num_chips (Optional, int): Number of chips in the chain. Must be in range from 1 to 85. Defaults to 1.
id (Optional, ID): The id to use for this
sm16716
component. Use this if you have multiple SM16716 chains connected at the same time.
Output¶
The SM16716 output component exposes a SM16716 channel of a global Component/Hub as a float output.
# Individual outputs
output:
- platform: sm16716
id: output_red
channel: 0
- platform: sm16716
id: output_green
channel: 1
- platform: sm16716
id: output_blue
channel: 2
Configuration variables:¶
id (Required, ID): The id to use for this output component.
channel (Required, int): Chose the channel of the SM16716 chain of this output component.
sm16716_id (Optional, ID): Manually specify the ID of the Component/Hub. Use this if you have multiple SM16716 chains you want to use at the same time.
All other options from Output.
Feit Electric A19 Smart WiFi Bulb¶
This component can be used with a version of a Feit Electric A19 smart light bulb. You can use tuya-convert to flash the bulb. The cold white LEDs are connected to PWM1 and the warm white LEDs are connected to PWM2. The RGB LEDs are connected to a SM16716 chip that is connected to GPIO4 for clock, GPIO14 for data, and GPIO13 for power. A complete configuration for a Feit Electric A19 looks like:
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: GPIO13
Note
The white LEDs are much brighter than the color LEDs and will fully overpower the set color when the white level is set even a little bit high. You will need to set the white level to 0 in order to get usable colors from this bulb.
Alternative Costco Feit A19 RGBCT bulb configuration:
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