I am using a Shelly RGBW2 relay to power two CCT led strips. One strip is connected R for WW and G for CW colors. Second strip is connected similarly to BW for WW and CW colors.
While Shelly RGBW2 does support only RGBW or 4x White LED strips mode the light visualization is shown (logically) as RGBW or 4xW.
While I’ve met some tutorials on how to set Shelly via MQTT to do that I’ve never seen a tutorial how to modify one of these modes (RGBW or 4x White) into a CCT mode while having native Shelly integration.
So my question is if there is an option to convert a light (not just a visualization of a card) from RGBW/4xW mode into a CCT mode using native Shelly integration + some modifications e.g. in config file? I am using also a Homekit Bridge to produce those devices into a Homekit. Therefore I want Homekit to recognize this as CCT.
Okay. So I’ve made the code already using “light template” that converts two channels for Shelly RGBW2 and converts them into a CCT LED with a temperature slider.
In case this helps to anyone:
info:
I am using two channels for one light. One channel is light.cw1 and the second channel is light.ww1.
steps to perform:
you need to create a two number “helper” objects called:
helper_brightness_level_1 (this one should have values from 0 to 255)
helper_temperature_ratio_1 (this one should have values from 0 to 100)
edit configuration.yaml to include “light template”
thank you a lot, works great for me!
One question: Even if it works and the output is fine, I cannot see the slider moving or the position of the slider for temperature. The numbers above, however, are changing. Regarding brightness, behaviour is fine… Please see video below. Any idea? Maybe input number for temperture should be switched to mireds?
I think this might be the failure. Your temperature ratio helper (allowing values in between 0 and 100) is fine for adjusting cw and ww light brightness but not for the temperature_template value expecting mired values in between 153 and 500.
As a result, no value can be defined for the attribute color_temp.
I have recently installed a Shelly RGBW2 to control a warm + cold white led light strip. Having spent quite some time browsing the HA forums for a similar setup to mine, I quickly realized that HA templates were not the most appropriate solution, given the amount of tasks that they would need to cover inside the (quite limited) templating language:
checking the input for out-of-bound values
handling a request to set only the color temperature OR only the brightness OR both the color temperature + brightness
keeping track of the previous state
I decided therefore for a more direct approach, arriving at the following custom integration:
I would greatly appreciate some feedback if you would like to try it out, before making an official post on this forum for all the rest of the community to see…
Good work! Very good solution.
Unfortunately, the switching does not work well. It doesn’t remember the last status and then switches on random values.
Excellent work! I appreciate that these settings are made within the UI so we don’t have to depend on the template and yaml configurations.
I’ve submitted one defect (missing icon) and one feature request (brightness shouldn’t override temperature value). I appreciate the enhancement is a documented, known limitation and the current design may be desired by some. However; in my house I’ll find people unnecessarily set lights to 100% which overrides the temperature while I installed lights with the intention of prioritizing temperature.
Great integration! This looks very promising. I have one question though: how would this work with one Shelly RGBW2, with cold white on white, and warm white on red? In the setup of the integration I van only choose the Shelly itself, not the different channels.