Change colour temperature in node red

Can some one tell me what im doing wrong here?`

I have a call service node with the following json:

{
    "color_temp": 340,
    "brightness": 255,
    "rgb_color": [
        255,
        255,
        255
    ]
}

If i dont have the "color_temp": 340, then it works fine but i want to add the color temp in there, How do i do this?

Thanks

I had the same issue.

Problem is that the color temperature is not supported in the RGB wheel. Ones you change the color temperature, RGB wheel will automatically reset and go back to the center.

What you can do is add another node. First one will set color and brightness and then second node will set the color temperature.

Hope this helps.

1 Like

Thanks man! I was starting to pull my hair off and this comment stopped me from doing it. Haha.

Hey!

Can you please help me understand what made it work for you, since i am ripping my hair off here… Thanks!

I have just done exactly what the comment above did. In Node-RED I first make a call adjusting the colour and brightness - then I make a separate call right after which adjusts the temperature :slight_smile:

Sorry for my stupidity, but could you show me an example? I have tried changing back and fourth, but the light bulb only works one way, when changing it back to bright - it dosen’t work at all for me :confused:

Sure :slight_smile:
I have highlighted it in the below. First call service gives the color and brightness, second call service gives the color temperature. Hope this makes sense.
image

Thank you for the reply! I really appriciate it… I have tried to specify my problem with the pic below.
I first wan’t the light to be “white” and a bit dim, and then i wan’t it to be red. Going from red - white is no problem, but when i go from white - red the light just gets white with 100% brighness, can you see what i am doing wrong? :confused:

I see there are 2 different color modes used rgb_color and xy_color do you know which your light supports? I may well be both but in order to check go to dev tools and find the entity. The color modes will be listed there.

I’d start by just getting each color call service node to work separately, then link them together. You may need to add a slight delay, ~250ms, between nodes.

Hey! Thanks.
It supports both methods, and it does the same thing even if i use “rgb_color” on both.

This is the attributes i am trying to get the lights to appear from. Note that “Röd = Red” and “Vit = White”

I thought it would just be to change the light color_mode from hs and color_temp, but when i try to add a node to do that, i get an API error message…
node red

You should always post the errors you receive.

Set each color separately, so you can manually switch between white and red. Then put them in a row with a small delay.

as

The thing is, as the settings are now - they don’t even shift from white to red, it’s only white or brighter white. I can go from red (if i set in in home assistant first) to white, but when i try to go from white to red, it only gets brighter

And the secound picture is when i try to get color_mode :color_temp to be a secound node.coplor_temp

Hello,

Sorry but my english is not good… I hope you’ll understand my answer.

In your node, you can’t put many différents type of color in your message. You must choose betwenn hs_color or rgb_color or xy_color.
Try tu keep only rgb_color lines 8-12 and delete all the lines 4-7 and 13-16 in your message.
It will be better and you won’t get another error of API.
Hope it will be help you.

Hello, thank you for you’re reply. That dosen’t make any different at all, the light still behaves just like before :frowning: Thanks anyway! Seems like this can’t be fixed…