I’m currently trying to create a custom color temperature slider for WWA LED strip (cold white, warm white and amber instead of RGB). For that I have basically created template sensors for the RGB channels based on the input of a color temperature slider.
I would like to change the color of my lights when I change the slider position. I have created an automation but this results in a config error:
alias: CT WWA
trigger:
- entity_id: input_number.ct_slider
platform: state
condition: []
action:
- data:
rgb_color:
- {{ states('sensor.red') | int }}
- {{ states('sensor.green') | int }}
- {{ states('sensor.blue') | int }}
entity_id: light.wled2
service: light.turn_on
Thank you for the reply. So in the templating tool, the template (without the quotes) yields something like rgb_color: [0,195,59], so this looks good. However, this results in the following error (which was my initial error I believe) :
Error loading /config/configuration.yaml: invalid key: "OrderedDict([("states('sensor.red' | int)", None)])"
in "/config/automations.yaml", line 170, column 0
The value for red (i.e., the first zero in the rgb color code) is zero. Is that the way is it supposed to be, or is the “0” there because no value is coming through.
Is line 170 in your automations.yaml the rgb_color line?
Also, the error message shows your code is messed up. Make sure that the code you copied and pasted into the template tool is EXACTLY the same as it is in your automation. Cut and paste. The code in the error message has quotation marks that shouldn’t be there, and the " | int" is in the wrong spot.
Create template sensor, that gives color names blue, white, red according the temperature change?
When this template sensors state changes, set new color with name?
Then the light is changed only when the color really changes.
Thanks I saw that but there is no instruction on how to establish a color in a led light and the. Establish values , like if temperature is between 20-30 then green , 31 above , red , 19 and below , blue