jdomeij / node-red-contrib-node-hue

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

Effect:Colorloop #15

Closed mcfarlde closed 6 years ago

mcfarlde commented 6 years ago

HELP WANTED Hi, I'm trying to determine how to modify the example provided to set the effect via a dropdown but my Java is weak. Are any more examples available? Sorry for posting this as an issue, but I cannot find anything discussing this elsewhere.

Here is what I did. [{"id":"24994102.8c593e","type":"node-hue-out","z":"3cf03d1b.e63c92","server":"a553cd7.3861c3","lightID":"light2","name":"Hannahs Bedside","x":170,"y":220,"wires":[["191a5968.3b5317"]]},{"id":"a51583d6.913c9","type":"ui_switch","z":"3cf03d1b.e63c92","name":"OnOff","label":"On","group":"40df5889.2d6b08","order":1,"width":0,"height":0,"passthru":false,"topic":"on","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":540,"y":190,"wires":[["60fdc0e0.03c2f"]]},{"id":"191a5968.3b5317","type":"function","z":"3cf03d1b.e63c92","name":"split","func":"var retVal = [\n null, null\n];\n\nif (msg.payload !== undefined)\n msg = msg.payload;\n\nif (msg.on !== undefined)\n retVal[0] = { payload: msg.on };\n\nif (msg.bri !== undefined)\n retVal[1] = { payload: msg.bri };\n \nif (msg.effect !== undefined)\n retVal[2] = { payload: msg.effect };\n\nreturn retVal","outputs":"3","noerr":0,"x":394,"y":221,"wires":[["a51583d6.913c9"],["48485800.816808"],[]]},{"id":"60fdc0e0.03c2f","type":"function","z":"3cf03d1b.e63c92","name":"join","func":"var retVal = {\n payload: {\n delay: 10000\n }\n};\n\nretVal.payload[msg.topic] = msg.payload;\n\nreturn retVal;","outputs":1,"noerr":0,"x":714,"y":221,"wires":[["7df168cb.0eb2d8","aaf6beb6.2fdf5"]]},{"id":"48485800.816808","type":"ui_slider","z":"3cf03d1b.e63c92","name":"Brightness","label":"Bri","group":"40df5889.2d6b08","order":2,"width":"0","height":"0","passthru":false,"topic":"bri","min":"0","max":"100","step":"1","x":550,"y":240,"wires":[["60fdc0e0.03c2f"]]},{"id":"7df168cb.0eb2d8","type":"node-hue-in","z":"3cf03d1b.e63c92","server":"a553cd7.3861c3","lightID":"light2","name":"Hannahs Bedside","x":930,"y":200,"wires":[]},{"id":"aaf6beb6.2fdf5","type":"debug","z":"3cf03d1b.e63c92","name":"","active":true,"console":"false","complete":"payload","x":910,"y":260,"wires":[]},{"id":"bfbb2edf.7fe68","type":"ui_button","z":"3cf03d1b.e63c92","name":"Loop Button","group":"40df5889.2d6b08","order":0,"width":0,"height":0,"passthru":false,"label":"Loop","color":"","bgcolor":"","icon":"","payload":"colorloop","payloadType":"str","topic":"effect","x":550,"y":300,"wires":[["60fdc0e0.03c2f"]]},{"id":"a553cd7.3861c3","type":"node-hue-bridge","z":"","name":"Hue Bridge","address":"10.0.1.122","key":"53NyRQbTqVH58t4mmgZSqUkmo1T7zi6NN1FT7JC4","interval":"10000"},{"id":"40df5889.2d6b08","type":"ui_group","z":"","name":"Hannah's Room","tab":"cda9bbc8.8213b8","disp":true,"width":"6"},{"id":"cda9bbc8.8213b8","type":"ui_tab","z":"","name":"Wink Relays","icon":"dashboard"}]