2019-02-16 23:24:32 +01:00
|
|
|
Light Partition
|
|
|
|
===============
|
|
|
|
|
|
|
|
.. seo::
|
|
|
|
:description: Instructions for setting up light partitions.
|
2021-11-16 03:19:33 +01:00
|
|
|
:image: color_lens.svg
|
2019-02-16 23:24:32 +01:00
|
|
|
|
|
|
|
The ``partition`` light platform allows you to combine multiple addressable light segments
|
2021-09-22 03:59:36 +02:00
|
|
|
(like :doc:`fastled` or :doc:`neopixelbus`) and/or individual lights (like :doc:`rgb`) into a single addressable light.
|
|
|
|
This platform also allows splitting up an addressable light into multiple segments, so that
|
2019-02-16 23:24:32 +01:00
|
|
|
segments can be individually controlled.
|
|
|
|
|
2021-02-16 11:24:01 +01:00
|
|
|
Splitting a single LED strip
|
|
|
|
----------------------------
|
2019-02-16 23:24:32 +01:00
|
|
|
|
2021-02-16 11:24:01 +01:00
|
|
|
If you want to split a strip, you may run into strange behavior like that the original light entity (e.g., ``fastled_clockless``)
|
2020-12-13 15:38:36 +01:00
|
|
|
may be conflicting with the partition. For better control over which segments of the strip will overlap each other,
|
|
|
|
mark the original ``light`` as ``internal: true``.
|
|
|
|
|
2021-02-16 11:24:01 +01:00
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
light:
|
|
|
|
- platform: partition
|
|
|
|
name: "Partition Light 1"
|
|
|
|
segments:
|
|
|
|
# Use first 10 LEDs from the light with ID light1
|
|
|
|
- id: light1
|
|
|
|
from: 0
|
|
|
|
to: 9
|
|
|
|
|
|
|
|
- platform: partition
|
|
|
|
name: "Partition Light 2"
|
|
|
|
segments:
|
|
|
|
# Use LEDs 11-20 from the light with ID light1
|
|
|
|
- id: light1
|
|
|
|
from: 10
|
|
|
|
to: 19
|
|
|
|
|
|
|
|
# Example for light segment source
|
|
|
|
- platform: fastled_clockless
|
|
|
|
id: light1
|
|
|
|
# You may want (but don't need) this
|
|
|
|
internal: true
|
|
|
|
# Other settings
|
|
|
|
|
2021-09-22 03:59:36 +02:00
|
|
|
Joining multiple LED lights into one
|
2021-02-16 11:24:01 +01:00
|
|
|
------------------------------------
|
|
|
|
|
2019-02-16 23:24:32 +01:00
|
|
|
.. code-block:: yaml
|
|
|
|
|
|
|
|
# Example configuration entry
|
|
|
|
light:
|
|
|
|
- platform: partition
|
|
|
|
name: "Partition Light"
|
|
|
|
segments:
|
2021-02-16 11:24:01 +01:00
|
|
|
# Use first 10 LEDs from the light with ID light1
|
2019-02-16 23:24:32 +01:00
|
|
|
- id: light1
|
|
|
|
from: 0
|
2021-02-16 11:24:01 +01:00
|
|
|
to: 9
|
|
|
|
# Use first 10 LEDs from light with ID light2
|
|
|
|
# they become LEDs 11-20 in the joined partition
|
2019-02-16 23:24:32 +01:00
|
|
|
- id: light2
|
2021-02-16 11:24:01 +01:00
|
|
|
from: 0
|
|
|
|
to: 9
|
2021-09-22 03:59:36 +02:00
|
|
|
# Use light3 as the 21st light in the partition
|
|
|
|
- single_light_id: light3
|
2021-02-16 11:24:01 +01:00
|
|
|
|
|
|
|
# Example for light segment source
|
|
|
|
- platform: fastled_clockless
|
|
|
|
id: light1
|
|
|
|
# You may want (but don't need) this
|
|
|
|
internal: true
|
|
|
|
# Other settings
|
2019-02-16 23:24:32 +01:00
|
|
|
|
|
|
|
# Example for light segment source
|
|
|
|
- platform: fastled_clockless
|
|
|
|
id: light2
|
2020-12-13 15:38:36 +01:00
|
|
|
# You may want (but don't need) this
|
|
|
|
internal: true
|
2019-02-16 23:24:32 +01:00
|
|
|
# Other settings
|
|
|
|
|
2021-09-22 03:59:36 +02:00
|
|
|
# Example for non-addressable light source
|
|
|
|
- platform: rgb
|
|
|
|
id: light3
|
|
|
|
# You may want (but don't need) this
|
|
|
|
internal: true
|
|
|
|
# Other settings
|
|
|
|
|
2019-02-16 23:24:32 +01:00
|
|
|
Configuration variables:
|
|
|
|
------------------------
|
|
|
|
|
2021-09-22 03:59:36 +02:00
|
|
|
- **segments** (**Required**, list): A list of segments included in this partition.
|
2024-08-14 04:46:33 +02:00
|
|
|
|
2021-09-22 03:59:36 +02:00
|
|
|
*For addressable segments:*
|
2019-02-16 23:24:32 +01:00
|
|
|
|
2021-09-22 03:59:36 +02:00
|
|
|
- **id** (**Required**, :ref:`config-id`): The ID of the addressable light to be controlled by this segment.
|
|
|
|
- **from** (**Required**, int): The index of the first LED to address in the segment. Counting starts with 0,
|
2019-02-16 23:24:32 +01:00
|
|
|
so first LED is 0.
|
|
|
|
- **to** (**Required**, int): The index of the last LED to address in this segment.
|
2021-11-28 19:57:01 +01:00
|
|
|
- **reversed** (*Optional*, boolean): Whether to reverse the order of LEDs in this segment. Defaults to ``false``.
|
2021-09-22 03:59:36 +02:00
|
|
|
|
|
|
|
*For single light segments:*
|
|
|
|
|
2021-11-28 19:57:01 +01:00
|
|
|
- **single_light_id** (**Required**, :ref:`config-id`): The ID of a single addressable or non-addressable light.
|
2021-09-22 03:59:36 +02:00
|
|
|
If an addressable light is specified, it will be treated as a single light in the partition.
|
2019-02-16 23:24:32 +01:00
|
|
|
|
2019-05-12 22:44:59 +02:00
|
|
|
- All other options from :ref:`Light <config-light>`.
|
2019-02-16 23:24:32 +01:00
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
Do *not* use this platform to control each LED on your addressable light - the light
|
|
|
|
objects have a moderate overhead and if you try to create many lights you will run out
|
|
|
|
of memory quickly.
|
|
|
|
|
2019-05-12 22:44:59 +02:00
|
|
|
See :ref:`light-addressable_set_action` for that.
|
|
|
|
|
2019-02-16 23:24:32 +01:00
|
|
|
See Also
|
|
|
|
--------
|
|
|
|
|
|
|
|
- :doc:`/components/light/index`
|
2019-02-27 10:10:09 +01:00
|
|
|
- :doc:`/components/light/fastled`
|
2019-02-16 23:24:32 +01:00
|
|
|
- :doc:`/components/light/neopixelbus`
|
2019-05-12 22:44:59 +02:00
|
|
|
- :apiref:`partition/light_partition.h`
|
2019-02-16 23:24:32 +01:00
|
|
|
- :ghedit:`Edit`
|