-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
rgbw2colorloop.json
1 lines (1 loc) · 4.65 KB
/
rgbw2colorloop.json
1
[{"id":"f00739aa9fbc9f54","type":"debug","z":"62a53d6e4cbdfb9a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":830,"y":840,"wires":[]},{"id":"ab8dad85d2138b72","type":"comment","z":"62a53d6e4cbdfb9a","name":"Shelly RGBW color loop example","info":"","x":310,"y":720,"wires":[]},{"id":"cf3c0ab1b3cdab0b","type":"shelly-gen1","z":"62a53d6e4cbdfb9a","hostname":"192.168.178.178","description":"","mode":"callback","server":"033a6e9acf499057","uploadretryinterval":"5000","pollinginterval":5000,"pollstatus":false,"getstatusoncommand":false,"devicetype":"RGBW","outputs":1,"x":630,"y":840,"wires":[["f00739aa9fbc9f54"]]},{"id":"3fa1a28b.020b7e","type":"function","z":"62a53d6e4cbdfb9a","name":"Initialize Colors","func":"// Tip: to have a smoother effect you should set the transition time in the RGBW2 node to 300ms\n// This depends on the interval in the inject node which is set actually to 300ms.\nvar rgbwValues = [\n {red : 255, green : 0, blue : 0, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n {red : 255, green : 0, blue : 0, on : true, timer : 0, white : 0, gain: 90, effect: 0, transition: 0},\n {red : 255, green : 0, blue : 0, on : true, timer : 0, white : 0, gain: 80, effect: 0, transition: 0},\n {red : 255, green : 0, blue : 0, on : true, timer : 0, white : 0, gain: 60, effect: 0, transition: 0},\n {red : 255, green : 0, blue : 0, on : true, timer : 0, white : 0, gain: 40, effect: 0, transition: 0},\n {red : 255, green : 0, blue : 0, on : true, timer : 0, white : 0, gain: 20, effect: 0, transition: 0},\n {red : 255, green : 0, blue : 0, on : true, timer : 0, white : 0, gain: 10, effect: 0, transition: 0},\n {red : 255, green : 0, blue : 0, on : true, timer : 0, white : 0, gain: 10, effect: 0, transition: 0},\n {red : 0, green : 255, blue : 0, on : true, timer : 0, white : 0, gain: 10, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 20, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 40, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 60, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 80, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 90, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n {red : 0, green : 0, blue : 255, on : true, timer : 0, white : 0, gain: 100, effect: 0, transition: 0},\n];\nflow.set(\"rgbwValues\", rgbwValues);\nflow.set(\"rgbwValuesIndex\", 0);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":780,"wires":[[]]},{"id":"e1f1130.eecc8f","type":"inject","z":"62a53d6e4cbdfb9a","name":"Reset","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":780,"wires":[["3fa1a28b.020b7e"]]},{"id":"2ba3d484.11014c","type":"inject","z":"62a53d6e4cbdfb9a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":230,"y":840,"wires":[["4d667ff6.1fffd"]]},{"id":"4d667ff6.1fffd","type":"function","z":"62a53d6e4cbdfb9a","name":"Loop Colors","func":"\nvar rgbwValues = flow.get(\"rgbwValues\");\nvar rgbwValuesIndex = flow.get(\"rgbwValuesIndex\");\nmsg.payload = rgbwValues[rgbwValuesIndex];\n\nrgbwValuesIndex = (rgbwValuesIndex + 1) % rgbwValues.length;\nflow.set(\"rgbwValuesIndex\", rgbwValuesIndex);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":430,"y":840,"wires":[["cf3c0ab1b3cdab0b"]]},{"id":"033a6e9acf499057","type":"shelly-gen1-server","port":"20001","hostname":""}]