jdomeij / node-red-contrib-node-hue

Node RED nodes for controlling Philips Hue lights
Apache License 2.0
17 stars 8 forks source link

"blue": 255 will also light red a bit #11

Open volkerrichert opened 6 years ago

volkerrichert commented 6 years ago

Hi! I've tried to power on each color individually. RG works fine, but B will power up blue and also red a bit.

I'm sending {"red":0, "green": 0, "blue": 255, "on": true } to a Dresden electronic FLS-PP lp

jdomeij commented 6 years ago

Can you please attach the "complete message object" output from an debug node connected to the light. This library only supports the "xy" color space (the one Hue uses), to output blue color I need to convert the RGB values to "xy" using an formula + an gamma table optimized for Hue lights.

volkerrichert commented 6 years ago

hm, while testing i receive a lot of "timeout of 10000ms exceeded". Very often the bridge react very slowly with a gap of more the 10 sec after pressing the dimmer.

the msg looks like {"_msgid":"4df3b999.a580c8","topic":"test","payload":{"red":0,"green":0,"blue":255,"on":true}}

jdomeij commented 6 years ago

This msg is what you are sending to the light, the info I was requesting was the message from the node hue input node witch are generated by the light. The timeouts indicates that something strange on your network, problems with the hue hub or connectivity problems between hue hub and light.

jdomeij commented 6 years ago

I found the following issue on the github page for the underlying library that is used to communicate with the hue hub https://github.com/peter-murray/node-hue-api/issues/16

volkerrichert commented 6 years ago

Ah, you what to see the data from the input hue node. Sorry, i misunderstand.

{"id":"light2","info":{"id":"2","name":"Grubenlampe 1-3","capability":["bri","xy","hs","ct"],"group":false,"type":"Extended color light","uniqueid":"00:21:2e:ff:ff:01:4f:89-0a","modelid":"FLS-PP3"},"payload":{"on":true,"reachable":true,"bri":100,"xy":[0.1526,0.0389],"hsv":[240,100,100],"rgb":[1,1,254],"hex":"0101FE","color":"blue","mired":153,"kelvin":6536},"state":{"on":true,"bri":254,"hue":43812,"sat":254,"xy":[0.1526,0.0389],"ct":153,"colormode":"hs"},"event":"update","_msgid":"be6f461.68606b8"}

volkerrichert commented 6 years ago

ah, there was a msg before:

{"id":"light2","info":{"id":"2","name":"Grubenlampe 1-3","capability":["bri","xy","hs","ct"],"group":false,"type":"Extended color light","uniqueid":"00:21:2e:ff:ff:01:4f:89-0a","modelid":"FLS-PP3"},"payload":{"on":true,"reachable":true,"bri":100,"xy":[0.1355,0.0399],"hsv":[240,100,100],"rgb":[0,0,255],"hex":"0000FF","color":"blue","mired":153,"kelvin":6536},"state":{"on":true,"bri":255,"hue":43812,"sat":255,"xy":[0.1355,0.0399],"ct":153,"colormode":"hs"},"event":"change","_msgid":"c47c9d7a.64668"}

jdomeij commented 6 years ago

If you try to set the value using HSV, to set blue inject the following {"hue": 240, "sat": 100, "bri": 100}, this will skip the conversion to XY color space because this one of the color modes the light says it supports.

volkerrichert commented 6 years ago

same result.

frist value from bulb:

{"on":true,"reachable":true,"bri":100,"xy":[0.1355,0.0399],"hsv":[240,100,100],"rgb":[0,0,255],"hex":"0000FF","color":"blue","mired":153,"kelvin":6536}

{"on":true,"reachable":true,"bri":100,"xy":[0.1526,0.0389],"hsv":[240,100,100],"rgb":[1,1,254],"hex":"0101FE","color":"blue","mired":153,"kelvin":6536}

I'll try xy

volkerrichert commented 6 years ago

sending xy results in

{"on":true,"reachable":true,"bri":100,"xy":[0.1355,0.0399],"hsv":[240,100,100],"rgb":[0,0,254],"hex":"0000FE","color":"blue","mired":153,"kelvin":6536}

and

{"on":true,"reachable":true,"bri":100,"xy":[0.1355,0.0399],"hsv":[238,100,100],"rgb":[1,8,254],"hex":"0108FE","color":"blue","mired":153,"kelvin":6536}

witch result in a blue channel on only. Ok, that work, but i don't know why.

volkerrichert commented 6 years ago

Ok, I change my script and send {"hue":240,"sat":100,"bri":100,"on":true,"duration":0}, when i what just the blue one on. The red one is also "on" :-(