Hello!
I have integrated my Milight bulbs via Node-RED while waiting for native integration.
I have a single issue with the color.
Gladys returns a 7-digit value such as: 5565439.
The issue is that Milight on the Node-RED side only requires a value from 0 to 255.
Can someone tell me the conversion that is done so I can apply the reverse, please?
Hello!
We use this set of functions:
In your case, I imagine you want RGB, so you can use this function in Node-RED (with a « function » block like in my tutorial at 33:49 → https://youtu.be/bpmHzR8_S5g?t=2029 )
function intToRgb(intColor) {
const red = intColor >> 16;
const green = (intColor - (red << 16)) >> 8;
const blue = intColor - (red << 16) - (green << 8);
return [red, green, blue];
}
![]()
That’s exactly what I wanted I’m going to look at your tutorial in detail forgive me I rushed in without seeing it
No problem, at least someone will have asked the question on the forum, if someone else has the same question, the answer is here!
Will you make a small milight tutorial with Node-RED on the forum when you get all this working? ![]()
Yes why not ![]()
Between two bottles this weekend it should be good ![]()
Done ![]()