Add documentation for SM16716 output component. (#217)

* Add documentation for SM16716 output component.

It still needs the sm16716.svg image file.

* Remove update on boot documentation.

* Update sm16716.rst

* Create sm16716.svg

* Lint
This commit is contained in:
Kevin Lewis 2019-05-31 09:06:16 -04:00 committed by Otto Winter
parent cd186ee3cc
commit 2f8e05b88a
6 changed files with 193 additions and 0 deletions

View File

@ -61,5 +61,6 @@ See Also
- :doc:`/components/output/esp8266_pwm`
- :doc:`/components/output/pca9685`
- :doc:`/components/output/my9231`
- :doc:`/components/output/sm16716`
- :apiref:`rgb/rgb_light_output.h`
- :ghedit:`Edit`

View File

@ -41,5 +41,6 @@ See Also
- :doc:`/components/output/esp8266_pwm`
- :doc:`/components/output/pca9685`
- :doc:`/components/output/my9231`
- :doc:`/components/output/sm16716`
- :apiref:`rgbw/rgb_light_output.h`
- :ghedit:`Edit`

View File

@ -52,5 +52,6 @@ See Also
- :doc:`/components/output/esp8266_pwm`
- :doc:`/components/output/pca9685`
- :doc:`/components/output/my9231`
- :doc:`/components/output/sm16716`
- :apiref:`rgbww/rgbww_light_output.h`
- :ghedit:`Edit`

View File

@ -0,0 +1,188 @@
SM16716 LED driver
==================
.. seo::
:description: Instructions for setting up SM16716 LED drivers in ESPHome.
:image: sm16716.png
:keywords: SM16716, Feit Electric A19 Smart WiFi Bulb, Merkury Innovations A21 Smart Wi-Fi Bulb
.. _sm16716-component:
Component
---------
The SM16716 component represents a SM16716 LED diver chain
(`SM16716 description <https://github.com/sowbug/sm16716/blob/master/SM16716%20Datasheet%20%5BChinese%5D.pdf>`__,
`SM16716 description <https://github.com/sowbug/sm16716/blob/master/SM16716%20Datasheet%20%5BChinese%5D.pdf>`__) 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 blubs:
- 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
:ref:`individual output channels <sm16716-output>`.
.. code-block:: yaml
# Example configuration entry
sm16716:
data_pin: GPIO14
clock_pin: GPIO4
num_channels: 3
num_chips: 1
# 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:
************************
- **data_pin** (**Required**, :ref:`config-pin_schema`): The pin used for MOSI.
- **clock_pin** (**Required**, :ref:`config-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*, :ref:`config-id`): The id to use for
this ``sm16716`` component. Use this if you have multiple SM16716 chains
connected at the same time.
.. _sm16716-output:
Driver Output
-------------
The SM16716 output component exposes a SM16716 channel of a global
:ref:`sm16716-component` as a float output.
.. code-block:: yaml
# Example configuration entry
sm16716:
data_pin: GPIO14
clock_pin: GPIO4
num_channels: 3
num_chips: 1
# 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**, :ref:`config-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*, :ref:`config-id`): Manually specify the ID of the
:ref:`sm16716-component`.
Use this if you have multiple SM16716 chains you want to use at the same time.
- All other options from :ref:`Output <config-output>`.
Feit Electric A19 Smart WiFi Bulb
---------------------------------
This component can be used with a Feit Electric A19 smart light blub. 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:
.. code-block:: yaml
esphome:
name: <NAME_OF_NODE>
platform: ESP8266
board: esp01_1m
wifi:
ssid: <YOUR_SSID>
password: <YOUR_WIFI_PASSPHRASE>
api:
logger:
ota:
password: <YOUR_OTA_PASSWORD>
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.
See Also
--------
- :doc:`/components/output/index`
- :doc:`/components/output/esp8266_pwm`
- :doc:`/components/light/rgb`
- :doc:`/components/light/rgbw`
- :doc:`/components/light/rgbww`
- :doc:`/components/power_supply`
- :apiref:`output/sm16716_output_component.h`
- `An Arduino controller for SM16716-based LED strings. <https://github.com/sowbug/sm16716>`__ by `@snowbug <https://github.com/sowbug>`__
- :ghedit:`Edit`

1
images/sm16716.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="61.333" width="260"><path d="M20.456 1.6h219.3c10.31 0 18.667 8.357 18.667 18.667v20.666c0 10.31-8.358 18.667-18.667 18.667h-219.3c-10.31 0-18.667-8.357-18.667-18.667V20.267C1.79 9.957 10.146 1.6 20.456 1.6z"/><path d="M20.456 1.6h219.3c10.31 0 18.667 8.357 18.667 18.667v20.666c0 10.31-8.358 18.667-18.667 18.667h-219.3c-10.31 0-18.667-8.357-18.667-18.667V20.267C1.79 9.957 10.146 1.6 20.456 1.6z" fill="none" stroke="#000" stroke-width="1.3333" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10"/><g fill="#fff"><path d="M27.719 48.013q-4.06 0-7.934-.886-3.826-.934-6.3-2.474l3.547-8.026q2.333 1.353 5.227 2.193 2.893.793 5.553.793 2.287 0 3.267-.42.98-.466.98-1.353 0-1.027-1.307-1.54-1.26-.513-4.2-1.12-3.78-.793-6.3-1.68-2.52-.933-4.387-2.987Q14 28.413 14 24.867q0-3.08 1.726-5.6 1.727-2.52 5.134-3.967 3.453-1.447 8.353-1.447 3.36 0 6.58.747 3.267.7 5.74 2.1l-3.313 7.98q-4.807-2.427-9.1-2.427-4.247 0-4.247 2.054 0 .98 1.26 1.493 1.26.467 4.153 1.027 3.734.7 6.3 1.633 2.567.887 4.434 2.94 1.913 2.053 1.913 5.6 0 3.08-1.727 5.6-1.726 2.473-5.18 3.967-3.406 1.446-8.306 1.446zM79.365 47.267l-.093-14.887-7.093 11.947h-4.854l-7.093-11.434v14.374H50.199V14.6h9.053l10.64 17.407L80.252 14.6h9.053l.094 32.667zM112.905 14.6v32.667h-11.013v-24.36h-5.6V14.6zM138.652 26.127q2.987 0 5.553 1.306 2.567 1.307 4.107 3.687t1.54 5.46q0 3.407-1.773 6.02-1.727 2.613-4.76 4.013-3.034 1.4-6.72 1.4-4.714 0-8.26-1.82-3.5-1.82-5.46-5.413t-1.96-8.82q0-5.6 2.24-9.707 2.286-4.106 6.346-6.253 4.107-2.147 9.52-2.147 2.94 0 5.6.7 2.66.654 4.527 1.867l-3.967 7.7q-2.426-1.727-5.926-1.727-2.847 0-4.714 1.447-1.82 1.4-2.38 4.107 2.567-1.82 6.487-1.82zm-2.8 14.28q1.493 0 2.427-.887.933-.887.933-2.427t-.933-2.426q-.934-.934-2.427-.934-1.493 0-2.427.934-.933.886-.933 2.426t.933 2.427q.934.887 2.427.887zM183.345 14.6v6.767l-10.873 25.9h-12.04l10.36-24.127h-6.3v4.76h-9.1V14.6zM205.825 14.6v32.667h-11.013v-24.36h-5.6V14.6zM231.572 26.127q2.987 0 5.553 1.306 2.567 1.307 4.107 3.687t1.54 5.46q0 3.407-1.773 6.02-1.727 2.613-4.76 4.013-3.034 1.4-6.72 1.4-4.714 0-8.26-1.82-3.5-1.82-5.46-5.413t-1.96-8.82q0-5.6 2.24-9.707 2.286-4.106 6.346-6.253 4.107-2.147 9.52-2.147 2.94 0 5.6.7 2.66.654 4.527 1.867l-3.967 7.7q-2.426-1.727-5.926-1.727-2.847 0-4.714 1.447-1.82 1.4-2.38 4.107 2.567-1.82 6.487-1.82zm-2.8 14.28q1.493 0 2.427-.887.933-.887.933-2.427t-.933-2.426q-.934-.934-2.427-.934-1.493 0-2.427.934-.933.886-.933 2.426t.933 2.427q.934.887 2.427.887z"/></g></svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -174,6 +174,7 @@ Output Components
ESP32 LEDC, components/output/ledc, pwm.png
PCA9685, components/output/pca9685, pca9685.jpg
MY9231/MY9291, components/output/my9231, my9231.svg
SM16716, components/output/sm16716, sm16716.svg
Custom Output, components/output/custom, language-cpp.svg
Light Components