Open 877dev opened 5 years ago
G'day 877. It looks like that controller doesn't have any WHITE channel; I have two different types of controllers, one with a single WHITE channel and one with two (COOL WHITE and WARM WHITE).
The inner working of the node has been pretty much put into this snippet (it's from a function node) https://github.com/joocer/node-red-nodes/blob/master/magic-home-ufo-controller.js
I don't have a unit to test on, but given the difference between a 5 and a 4 channel controller, there's a chance that updating this
if (STYLE == 'RGBWW') { checkbit = function(command) { command[8] = (command[0] + command[1] + command[2] + command[3] + command[4] + command[5] + command[6] + command[7]) % 256; return command; }; COLORCOMMAND = [49, 255, 255, 255, 255, 255, 240, 15, 255]; } else { checkbit = function (command) { command[7] = (command[0] + command[1] + command[2] + command[3] + command[4] + command[5] + command[6]) % 256; return command; }; COLORCOMMAND = [49, 255, 255, 255, 0, 0, 240, 15, 255]; }
to be like this
if (STYLE == 'RGBWW') { checkbit = function(command) { command[8] = (command[0] + command[1] + command[2] + command[3] + command[4] + command[5] + command[6] + command[7]) % 256; return command; }; COLORCOMMAND = [49, 255, 255, 255, 255, 255, 240, 15, 255]; } else if (STYLE == 'RGBW') { checkbit = function (command) { command[7] = (command[0] + command[1] + command[2] + command[3] + command[4] + command[5] + command[6]) % 256; return command; }; COLORCOMMAND = [49, 255, 255, 255, 0, 0, 240, 15, 255]; } else { checkbit = function (command) { command[6] = (command[0] + command[1] + command[2] + command[3] + command[4] + command[5]) % 256; return command; }; COLORCOMMAND = [49, 255, 255, 255, 0, 240, 15, 255]; }
it would support a 3 channel controller.
Hi @joocer and thanks for the node. I admit I am relatively new to red node and have almost zero knowledge of javascript, I'm even sturggling with passing payloads on etc..
But I think I have this setup correctly, and it works fine with on/off commands. But when changing colour by one of the three inject nodes, the LED strip stops responding until I re-deploy.
Any info/insights/tips would be greatly appreciated!
The kit I purchased (running stock firmware): https://www.amazon.co.uk/gp/product/B07MM4G7PZ/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1
My flow: