Connect Hue with RGBW

Hi Guys

I have a little Problem with Hue

I have KNX and want to control Hue

From KNX i just have seperate Objects for R,G,B,W and want to connect this to the Hue ligth.
But how can i do this. theoretical i ned 4 Sliders for R,G,B,W
I can choose HSL oder HSB

HueKNX

There is a node available 'node-red-contrib-color-convert' which can convert RGB to HSL/HSV. For the W you may need to do it seperately in Kelvin.

Can you give us an example of the objects?

You might have to store the values using context variables. There’s a page in the docs called “working with context”

Can you give me an example of the color convert ?

As the documentation describes:

For the first 3 input modes the node will attempt to determine the input format of msg.payload from the 3 following:

  • a 3 segment array with values between 0-255 for RGB.
  • a 3 segment array for HSL and HSV with Hue is between 0-360 and Saturation, Level, values 0-100.
  • a object with keys red,green,blue with values between 0-255.
  • a object with keys hue,saturation,lightness or value,brightness with values between 0-360 for hue and 0-100 for the others.

Do you have RGBW payload available ? If yes, what does it look like ?

One option could be to use a function-node. In my plugin homebridge-mqtt you'll find 2 convert-functions (https://github.com/cflurin/homebridge-mqtt/blob/master/lib/utils.js)

Utils.rgb2hsv = function(r, g, b) {
...

and

Utils.hsv2rgb = function (h, s, v) {
...

Maybe is now Clearer what i mean.
Maybe someone has an Expample.
Im verry new with node Red

3 separate payloads can be combined with the join node.

What does the ouput of the knx node produce? (Connect a debug node to it)

Thats why i said im newbie how must i do that ?

What does the ouput of the knx node produce? (Connect a debug node to it)

Assuming you are using the heumagic node:

  1. You need to send an object like this (see doc):
{rgb:[r,g,b]}
  1. First build an array with the join node and then an object with the template node.

Import and try this flow:

[{"id":"b3155e60.37d73","type":"join","z":"7c6a9ec3.f1512","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":390,"y":1260,"wires":[["207e45ca.32f6ea"]]},{"id":"c188ba2d.8da4f8","type":"inject","z":"7c6a9ec3.f1512","name":"","topic":"red","payload":"200","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":1220,"wires":[["b3155e60.37d73"]]},{"id":"99e929d7.500088","type":"inject","z":"7c6a9ec3.f1512","name":"","topic":"green","payload":"180","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":1260,"wires":[["b3155e60.37d73"]]},{"id":"906a8390.860e7","type":"inject","z":"7c6a9ec3.f1512","name":"","topic":"blue","payload":"210","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":220,"y":1300,"wires":[["b3155e60.37d73"]]},{"id":"54bd1ebb.28a31","type":"debug","z":"7c6a9ec3.f1512","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":670,"y":1260,"wires":[]},{"id":"207e45ca.32f6ea","type":"template","z":"7c6a9ec3.f1512","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{rgb:[{{payload}}]}","output":"str","x":520,"y":1260,"wires":[["54bd1ebb.28a31"]]}]

Hallo, danke für den Hinweis auf die Funktionen. Mir ist nicht klar wie die Eingangsparameter sein sollen. Ich habe h = 60, s = 75 und v = 185 (gesendet von Zigbee2MQTT) - wenn ich die Funktion damit aufruf kommen unsinnige Werte dabei heraus.

Danke für ein Lichtblick :wink: