Add documentation for SM2235 & SM2335 LED drivers (#2514)

This commit is contained in:
Cossid 2022-12-22 16:04:29 -06:00 committed by GitHub
parent e73edf0fbb
commit 039228274a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 340 additions and 0 deletions

View File

@ -0,0 +1,167 @@
SM2235 LED driver
==================
.. seo::
:description: Instructions for setting up SM2235 LED drivers in ESPHome.
:keywords: SM2235
.. _sm2235-component:
Component/Hub
-------------
The SM2235 component represents a SM2235 LED diver chain in
ESPHome. Communication is done with two GPIO pins (DATA and CLK).
To use the channels of this components, you first need to setup the
global ``sm2235`` hub and give it an id, and then define the
:ref:`individual output channels <sm2235-output>`.
.. code-block:: yaml
# Example configuration entry
sm2235:
data_pin: GPIO4
clock_pin: GPIO5
max_power_color_channels: 9
max_power_white_channels: 9
Configuration variables:
************************
- **data_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin used for DATA.
- **clock_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin which CLK is
connected to.
- **id** (*Optional*, :ref:`config-id`): The id to use for
this ``sm2235`` component. Use this if you have multiple SM2235 chains
connected at the same time.
- **max_power_color_channels** (*Optional*, int 0-15): Adjusts the current supplied to the
color channels, higher is more power. Default is 2 per SM2235 datasheet. See table below.
- **max_power_white_channels** (*Optional*, int 0-15): Adjusts the current supplied to the
white channels, higher is more power. Default is 4 per SM2235 datasheet. See table below.
.. note::
The LED driver may be able to tolerate more power than
the bulb is designed to handle, start with lower values
and increase slowly, comparing to a stock bulb to verify
what is safe for your model.
+---------------------------------+-----------------+
| max_power_white_channels value | actual current |
+=================================+=================+
| 0 | 5 mA |
+---------------------------------+-----------------+
| 1 | 10 mA |
+---------------------------------+-----------------+
| 2 | 15 mA |
+---------------------------------+-----------------+
| 3 | 20 mA |
+---------------------------------+-----------------+
| 4 | 25 mA (default) |
+---------------------------------+-----------------+
| 5 | 30 mA |
+---------------------------------+-----------------+
| 6 | 35 mA |
+---------------------------------+-----------------+
| 7 | 40 mA |
+---------------------------------+-----------------+
| 8 | 45 mA |
+---------------------------------+-----------------+
| 9 | 50 mA |
+---------------------------------+-----------------+
| 10 | 55 mA |
+---------------------------------+-----------------+
| 11 | 60 mA |
+---------------------------------+-----------------+
| 12 | 65 mA |
+---------------------------------+-----------------+
| 13 | 70 mA |
+---------------------------------+-----------------+
| 14 | 75 mA |
+---------------------------------+-----------------+
| 15 | 80 mA |
+---------------------------------+-----------------+
+---------------------------------+-----------------+
| max_power_color_channels value | actual current |
+=================================+=================+
| 0 | 4 mA |
+---------------------------------+-----------------+
| 1 | 8 mA |
+---------------------------------+-----------------+
| 2 | 12 mA (default) |
+---------------------------------+-----------------+
| 3 | 16 mA |
+---------------------------------+-----------------+
| 4 | 20 mA |
+---------------------------------+-----------------+
| 5 | 24 mA |
+---------------------------------+-----------------+
| 6 | 28 mA |
+---------------------------------+-----------------+
| 7 | 32 mA |
+---------------------------------+-----------------+
| 8 | 36 mA |
+---------------------------------+-----------------+
| 9 | 40 mA |
+---------------------------------+-----------------+
| 10 | 44 mA |
+---------------------------------+-----------------+
| 11 | 48 mA |
+---------------------------------+-----------------+
| 12 | 52 mA |
+---------------------------------+-----------------+
| 13 | 56 mA |
+---------------------------------+-----------------+
| 14 | 60 mA |
+---------------------------------+-----------------+
| 15 | 64 mA |
+---------------------------------+-----------------+
.. _sm2235-output:
Output
------
The SM2235 output component exposes a SM2235 channel of a global
:ref:`sm2235-component` as a float output.
.. code-block:: yaml
# Individual outputs
output:
- platform: sm2235
id: output_red
channel: 1
Configuration variables:
************************
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **channel** (**Required**, int): Chose the channel of the SM2235 chain of
this output component.
- **sm2235_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the
:ref:`sm2235-component`.
Use this if you have multiple SM2235 chains you want to use at the same time.
- All other options from :ref:`Output <config-output>`.
.. note::
This driver does support enabling of both the color and the white channels
at the same time, but it is not encourage. Therefore, the :ref:`rgbw_color_interlock`
should be set to true when using this driver for safest operation.
See Also
--------
- :doc:`/components/output/index`
- :doc:`/components/output/esp8266_pwm`
- :doc:`/components/output/sm2135`
- :doc:`/components/output/sm2335`
- :doc:`/components/light/rgb`
- :doc:`/components/light/rgbw`
- :doc:`/components/light/rgbww`
- :doc:`/components/power_supply`
- :apiref:`output/sm2235_output_component.h`
- :ghedit:`Edit`

View File

@ -0,0 +1,169 @@
SM2335 LED driver
==================
.. seo::
:description: Instructions for setting up SM2335 LED drivers in ESPHome.
:keywords: SM2335, SwitchBot Color Bulb W1401400
.. _sm2335-component:
Component/Hub
-------------
The SM2335 component represents a SM2335 LED diver chain in
ESPHome. Communication is done with two GPIO pins (DATA and CLK).
It is used in some smart light bulbs:
- SwitchBot Color Bulb W1401400
To use the channels of this components, you first need to setup the
global ``sm2335`` hub and give it an id, and then define the
:ref:`individual output channels <sm2335-output>`.
.. code-block:: yaml
# Example configuration entry
sm2335:
data_pin: GPIO4
clock_pin: GPIO5
max_power_color_channels: 9
max_power_white_channels: 9
Configuration variables:
************************
- **data_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin used for DATA.
- **clock_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The pin which CLK is
connected to.
- **id** (*Optional*, :ref:`config-id`): The id to use for
this ``sm2335`` component. Use this if you have multiple SM2335 chains
connected at the same time.
- **max_power_color_channels** (*Optional*, int 0-15): Adjusts the current supplied to the
color channels, higher is more power. Default is 2 per SM2335 datasheet. See table below.
- **max_power_white_channels** (*Optional*, int 0-15): Adjusts the current supplied to the
white channels, higher is more power. Default is 4 per SM2335 datasheet. See table below.
.. note::
The LED driver may be able to tolerate more power than
the bulb is designed to handle, start with lower values
and increase slowly, comparing to a stock bulb to verify
what is safe for your model.
+---------------------------------+-----------------+
| max_power_white_channels value | actual current |
+=================================+=================+
| 0 | 5 mA |
+---------------------------------+-----------------+
| 1 | 10 mA |
+---------------------------------+-----------------+
| 2 | 15 mA |
+---------------------------------+-----------------+
| 3 | 20 mA |
+---------------------------------+-----------------+
| 4 | 25 mA (default) |
+---------------------------------+-----------------+
| 5 | 30 mA |
+---------------------------------+-----------------+
| 6 | 35 mA |
+---------------------------------+-----------------+
| 7 | 40 mA |
+---------------------------------+-----------------+
| 8 | 45 mA |
+---------------------------------+-----------------+
| 9 | 50 mA |
+---------------------------------+-----------------+
| 10 | 55 mA |
+---------------------------------+-----------------+
| 11 | 60 mA |
+---------------------------------+-----------------+
| 12 | 65 mA |
+---------------------------------+-----------------+
| 13 | 70 mA |
+---------------------------------+-----------------+
| 14 | 75 mA |
+---------------------------------+-----------------+
| 15 | 80 mA |
+---------------------------------+-----------------+
+---------------------------------+-----------------+
| max_power_color_channels value | actual current |
+=================================+=================+
| 0 | 10 mA |
+---------------------------------+-----------------+
| 1 | 20 mA |
+---------------------------------+-----------------+
| 2 | 30 mA (default) |
+---------------------------------+-----------------+
| 3 | 40 mA |
+---------------------------------+-----------------+
| 4 | 50 mA |
+---------------------------------+-----------------+
| 5 | 60 mA |
+---------------------------------+-----------------+
| 6 | 70 mA |
+---------------------------------+-----------------+
| 7 | 80 mA |
+---------------------------------+-----------------+
| 8 | 90 mA |
+---------------------------------+-----------------+
| 9 | 100 mA |
+---------------------------------+-----------------+
| 10 | 110 mA |
+---------------------------------+-----------------+
| 11 | 120 mA |
+---------------------------------+-----------------+
| 12 | 130 mA |
+---------------------------------+-----------------+
| 13 | 140 mA |
+---------------------------------+-----------------+
| 14 | 150 mA |
+---------------------------------+-----------------+
| 15 | 160 mA |
+---------------------------------+-----------------+
.. _sm2335-output:
Output
------
The SM2335 output component exposes a SM2335 channel of a global
:ref:`sm2335-component` as a float output.
.. code-block:: yaml
# Individual outputs
output:
- platform: sm2335
id: output_red
channel: 1
Configuration variables:
************************
- **id** (**Required**, :ref:`config-id`): The id to use for this output component.
- **channel** (**Required**, int): Chose the channel of the SM2335 chain of
this output component.
- **sm2335_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the
:ref:`sm2335-component`.
Use this if you have multiple SM2335 chains you want to use at the same time.
- All other options from :ref:`Output <config-output>`.
.. note::
This driver does support enabling of both the color and the white channels
at the same time, but it is not encourage. Therefore, the :ref:`rgbw_color_interlock`
should be set to true when using this driver for safest operation.
See Also
--------
- :doc:`/components/output/index`
- :doc:`/components/output/esp8266_pwm`
- :doc:`/components/output/sm2135`
- :doc:`/components/output/sm2235`
- :doc:`/components/light/rgb`
- :doc:`/components/light/rgbw`
- :doc:`/components/light/rgbww`
- :doc:`/components/power_supply`
- :ghedit:`Edit`

1
images/sm2235.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" id="svg10" width="260" height="61.333" version="1.1"><metadata id="metadata16"/><path id="path2" 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 id="path4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.333" 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"/><text style="font-style:normal;font-weight:400;font-size:49.4582px;line-height:1.25;font-family:sans-serif;fill:#fff;fill-opacity:1;stroke:none;stroke-width:1.23645" id="text24" x="35.867" y="46.914" transform="scale(0.95547305,1.046602)" xml:space="preserve"><tspan id="tspan22" x="35.867" y="46.914" style="fill:#fff;stroke-width:1.23645">SM2235</tspan></text></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

1
images/sm2335.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" id="svg10" width="260" height="61.333" version="1.1"><metadata id="metadata16"/><path id="path2" 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 id="path4" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="1.333" 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"/><text style="font-style:normal;font-weight:400;font-size:49.4582px;line-height:1.25;font-family:sans-serif;fill:#fff;fill-opacity:1;stroke:none;stroke-width:1.23645" id="text24" x="35.867" y="46.914" transform="scale(0.95547305,1.046602)" xml:space="preserve"><tspan id="tspan22" x="35.867" y="46.914" style="fill:#fff;stroke-width:1.23645">SM2335</tspan></text></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -435,6 +435,8 @@ Output Components
MY9231/MY9291, components/output/my9231, my9231.svg
SM16716, components/output/sm16716, sm16716.svg
SM2135, components/output/sm2135, sm2135.svg
SM2235, components/output/sm2235, sm2235.svg
SM2335, components/output/sm2335, sm2335.svg
MCP4725, components/output/mcp4725, mcp4725.jpg
MCP4728, components/output/mcp4728, mcp4728.jpg
MCP47A1, components/output/mcp47a1, mcp47a1.svg