Home Assistant integration to group multiple light sources into a single "virtual" color temperature-changing light.
Useful for instance with LED strips having separate cold white/warm white channels (CCT or CWWW LED), in which two separate light entities are available in Home Assistant, one for each color temperature. This integration groups together the two lights, allowing them to be controlled as a single entity in HA.
An example application is a "dumb"/analog LED strip controlled by a Shelly RGBW2 (configured in 4 white channels mode), where the cold light and warm light channels are each connected to a separate channel in the Shelly.
light.turn_on
service. See this Python notebook for more details.configuration.yaml
\
Follow the instructions below, then restart Home Assistant.configuration.yaml
).custom_components
directory (folder) there, you need to create it.custom_components
directory (folder) create a new folder called color_temperature_light_mixer
.color_temperature_light_mixer.zip
from the latest release section in this repository.configuration.yaml
\
Follow the instructions below, then restart Home Assistant.The integration can be configured via either HA UI and YAML.
The following configuration options are supported:
Name | Description |
---|---|
name |
The name of the "virtual" color changing temperature light. |
warm_light_entity_id |
The entity_id representing the warm light (yellow-ish color). |
warm_light_color_temp_kelvin |
The color temperature of the warm light, in Kelvin. |
cold_light_entity_id |
The entity_id representing the cold light (blu-ish color). |
cold_light_color_temp_kelvin |
The color temperature of the cold light, in Kelvin. |
The same configuration options can be specified via the configuration.yaml
.
See the following snippet for an example:
color_temperature_light_mixer:
- name: Virtual
warm_light_entity_id: light.warm_white
warm_light_color_temp_kelvin: 3000
cold_light_entity_id: light.cold_white
cold_light_color_temp_kelvin: 6000
This integration will set up the following entities (one for each of your defined configurations):
Platform | Description |
---|---|
light |
The "virtual" color changing temperature light combining the warm and cold light entities. |
You can automatically track new versions of this component and update it by HACS, or follow this repository on GitHub to be notified of new releases.
This integration makes the assumption that 100% brightness is achieved when both warm white AND cold white LEDs are on. Check the specifications of your lights to see if this type of setup is supported (compared instead to having only one of the strips at 100% power at a time).\ A future development might include the ability to cap the output brightness for setups where this is required.
At the moment the assumption is that each light source "contributes" equally to the resulting temperature. This was a design choice done to keep the math required in the computations simple. In some particular setups however this might not be the case.
At the moment only two light sources are supported per "virtual" light.\ It is nonetheless possible to create multiple "virtual" lights, each with their own pair of light sources.
Support for light transitions has not been appropriately tested yet.
You can enable debug logs in two different ways:
Enable debug logging
and then downloading the generated logs. See the HA docs for more information.By editing configuration.yaml
and restarting HA:
# configuration.yaml
logger:
default: info
logs:
custom_components.color_temperature_light_mixer: debug
This is an active open-source project. We are always open to people who want to use the code or contribute to it.
We have set up a separate document containing our contribution guidelines.
Thank you for being involved!
For a full list of all authors and contributors, check the contributor's page.
The original inspiration came from the template light provided by gfrancesco, as part of this HA forum thread.
This Home Assistant custom component was created and is updated using the HA-Blueprint template. You can use this template to maintain your own Home Assistant custom components.