From ba199fef03912ac2332c5d67429fbdd77fb4205e Mon Sep 17 00:00:00 2001 From: BoukeHaarsma23 Date: Wed, 12 May 2021 21:14:26 +0200 Subject: [PATCH] Add sm2135 component (#1127) --- components/output/sm2135.rst | 137 +++++++++++++++++++++++++++++++++++ images/sm2135.svg | 74 +++++++++++++++++++ index.rst | 1 + 3 files changed, 212 insertions(+) create mode 100644 components/output/sm2135.rst create mode 100644 images/sm2135.svg diff --git a/components/output/sm2135.rst b/components/output/sm2135.rst new file mode 100644 index 000000000..6c472d9b9 --- /dev/null +++ b/components/output/sm2135.rst @@ -0,0 +1,137 @@ +SM2135 LED driver +================== + +.. seo:: + :description: Instructions for setting up SM2135 LED drivers in ESPHome. + :keywords: SM2135, Calex Smart RGB Reflector + +.. _sm2135-component: + +Component +--------- + +The SM2135 component represents a SM2135 LED diver chain +(`SM2135 description `__, +`SM2135 description `__) in +ESPHome. Communication is done with two GPIO pins (MOSI and SCLK). +It is used in some smart light bulbs: + +- Calex Smart RGB Reflector LED lamp (GU10) +- LSC Smart GU10 + +To use the channels of this components, you first need to setup the +global ``sm2135`` hub and give it an id, and then define the +:ref:`individual output channels `. + +.. code-block:: yaml + + # Example configuration entry + sm2135: + data_pin: GPIO12 + clock_pin: GPIO14 + + # Individual outputs + output: + - platform: sm2135 + id: output_red + channel: 0 + max_power: 0.8 + - platform: sm2135 + id: output_green + channel: 1 + max_power: 0.8 + - platform: sm2135 + id: output_blue + channel: 2 + max_power: 0.8 + - platform: sm2135 + id: output_white + channel: 3 + max_power: 0.8 + - platform: sm2135 + id: output_warmwhite + channel: 4 + max_power: 0.8 + +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. +- **id** (*Optional*, :ref:`config-id`): The id to use for + this ``sm2135`` component. Use this if you have multiple SM2135 chains + connected at the same time. + +.. _sm2135-output: + +Driver Output +------------- + +The SM2135 output component exposes a SM2135 channel of a global +:ref:`sm2135-component` as a float output. + +.. code-block:: yaml + + # Example configuration entry + sm2135: + data_pin: GPIO12 + clock_pin: GPIO14 + + # Individual outputs + output: + - platform: sm2135 + id: output_red + channel: 0 + max_power: 0.8 + - platform: sm2135 + id: output_green + channel: 1 + max_power: 0.8 + - platform: sm2135 + id: output_blue + channel: 2 + max_power: 0.8 + - platform: sm2135 + id: output_white + channel: 3 + max_power: 0.8 + - platform: sm2135 + id: output_warmwhite + channel: 4 + max_power: 0.8 + +Configuration variables: +************************ + +- **id** (**Required**, :ref:`config-id`): The id to use for this output component. +- **channel** (**Required**, int): Chose the channel of the SM2135 chain of + this output component. +- **sm2135_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the + :ref:`sm2135-component`. + Use this if you have multiple SM2135 chains you want to use at the same time. +- All other options from :ref:`Output `. + +.. note:: + + The white LEDs are much brighter than the color LEDs. To get uniform brightness + for both color and white you will need to limit the white led power. + +.. note:: + + This driver does not support enabling of both the color and the white channels + at the same time. Therefore, the :ref:`rgbw_color_interlock` should be set to true + when using this driver. + +See Also +-------- + +- :doc:`/components/output/index` +- :doc:`/components/output/esp8266_pwm` +- :doc:`/components/output/sm16716` +- :doc:`/components/light/rgb` +- :doc:`/components/light/rgbw` +- :doc:`/components/light/rgbww` +- :doc:`/components/power_supply` +- :apiref:`output/sm2135_output_component.h` +- :ghedit:`Edit` diff --git a/images/sm2135.svg b/images/sm2135.svg new file mode 100644 index 000000000..238245c1a --- /dev/null +++ b/images/sm2135.svg @@ -0,0 +1,74 @@ + + + + + + image/svg+xml + + + + + + + + + + SM2135 + diff --git a/index.rst b/index.rst index 309249633..7e8edaff3 100644 --- a/index.rst +++ b/index.rst @@ -227,6 +227,7 @@ Output Components TLC59208F, components/output/tlc59208f, tlc59208f.jpg MY9231/MY9291, components/output/my9231, my9231.svg SM16716, components/output/sm16716, sm16716.svg + SM2135, components/output/sm2135, sm2135.svg MCP4725, components/output/mcp4725, mcp4725.jpg Custom Output, components/output/custom, language-cpp.svg Template Output, components/output/template, description.svg