Node Red - Automate LZW45 Quick Strip Calculations (Parameter 21) via Subflow

I’ve been working on this one all week, and in doing so I’ve learned a lot about Javascript! I think I’ve finally got to the point where I can release what I’ve done so far so that anyone using Node Red can automate Parameter 21’s calculations based upon multiple different configured values. While I tried my best to test many of the different value combinations, I may have missed a couple. Should anyone come across any miscalculations, please let me know and I’ll try to address them.

Before going into more depth, I wanted to thank @petro for not only breaking down the different calculations for parameter 21 in this thread, but also assisting me while I worked to correct my functions. Thanks again Petro!

I have two different versions of the subflow, the first one will work by defining your light strips node ID on the subflow. There are a total of 6 fields which you can specify, including the node ID field. For color_name, please specify one of the following 15 values:

red, orange, yellow, yellow_green, green, spring_green, cyan, azure, blue, purple, pink, warm_white, white, cool_white, or random.

I’ve also included checks to convert capital letters to lower case, checks which remove leading and trailing spaces, as well as checks which convert spaces found in the middle of values to _, so under that logic you should be able to write the above values however you’d like and it will run.

These color values are all defined according to my personal preferences. If you have a different idea of what the color options should look like, they can all be adjusted however you’d like by going into the “Quick Strip Effect Colors” subflow and adjusting the number to match your preferences. Please note that if you do this, you may also want to adjust the random color function according to your new color values. The values were hardcoded in an array and will not adjust if you only change the values within the change nodes.

For brightness_level, you need to specify a value of 1 to 99, or random. Please note that while testing, I noticed that brightness will default to max brightness (99) if used with the ‘solid’ effect. If using other effects it should calculate as you specify as far as I’m aware.

For time, please specify a value of 1 to 60, random, or simply leave it blank (so long as you plan on having your effect go forever).

For measure_time, please specify a value of seconds, minutes, hours, forever or random. If you use a value of seconds, minutes, hours or random, please make sure to specify a valid value for time. If you use forever, time can be left blank. You could specify a value for time regardless, but it will be overwritten as 0 :slight_smile:

And last but not least, for effect_type, specify one of the following values:

off, solid, chase, fast_blink, slow_blink, fast_fade, slow_fade, or random.

Similarly to color_name, checks have been included to convert capital letters to lower case, checks which remove leading and trailing spaces, as well as checks which convert spaces found in the middle of values to _. So you should be able to write the above values however you’d like.

Now for some screenshots.

Here’s the subflow:

Here’s the color picker subflow included within the overall subflow:

And here is an example. This would set node 33 to pink at 50% brightness for 23 seconds with a chase effect:

This will also accomplish the same thing if you insist on writing this way:

The second subflow is basically the same as the first in every way, except it does not take a defined node id. Instead, it searches for all entity ID’s included in a group titled group.inovelli_led_strips. Every single lightstrip in this group will be updated to the values you specify on the subflow. Everything else is the same as above :slight_smile:

Screenshot of the subflow:

Example will set all lightstrips within your group to a red color at 99% forever with a solid effect:

Please leave a comment here if you have questions or find any issues with it. I’ll do my best to address everything as time permits :slight_smile: Hope this helps others!

Due to thread character limits, please find my subflows in the comments below.

3 Likes

Here is the subflow export for a single node:

[{"id":"362f689.33b0c98","type":"subflow","name":"Quick Strip Effect Colors","info":"","category":"","in":[{"x":320,"y":380,"wires":[{"id":"680e6ded.565114"}]}],"out":[{"x":1460,"y":280,"wires":[{"id":"76243d4.8e80bc4","port":0},{"id":"ad5f5a90.416018","port":0},{"id":"19c51368.d6f8fd","port":0},{"id":"154b5ed4.108961","port":0},{"id":"651c99a3.a7f768","port":0},{"id":"d3872347.ce311","port":0},{"id":"cf83c6fb.0f7f68","port":0},{"id":"f6198ab1.ec32f8","port":0},{"id":"52e5e8d7.ac8ae8","port":0},{"id":"40a1c2c8.47e34c","port":0},{"id":"e34f2557.ee1c38","port":0},{"id":"b06df9d.d0bbb08","port":0},{"id":"72fddbcd.55b3f4","port":0},{"id":"82ae4ce5.a9f47","port":0},{"id":"a9647dc7.41876","port":0}]}],"env":[{"name":"color","type":"str","value":""}],"color":"#E9967A"},{"id":"edca33b2.fe0ca","type":"switch","z":"362f689.33b0c98","name":"Notification Color","property":"color","propertyType":"msg","rules":[{"t":"eq","v":"red","vt":"str"},{"t":"eq","v":"orange","vt":"str"},{"t":"eq","v":"yellow","vt":"str"},{"t":"eq","v":"yellow_green","vt":"str"},{"t":"eq","v":"green","vt":"str"},{"t":"eq","v":"spring_green","vt":"str"},{"t":"eq","v":"cyan","vt":"str"},{"t":"eq","v":"azure","vt":"str"},{"t":"eq","v":"blue","vt":"str"},{"t":"eq","v":"purple","vt":"str"},{"t":"eq","v":"pink","vt":"str"},{"t":"eq","v":"warm_white","vt":"str"},{"t":"eq","v":"white","vt":"str"},{"t":"eq","v":"cool_white","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":16,"x":910,"y":380,"wires":[["76243d4.8e80bc4"],["52e5e8d7.ac8ae8"],["d3872347.ce311"],["b06df9d.d0bbb08"],["ad5f5a90.416018"],["72fddbcd.55b3f4"],["82ae4ce5.a9f47"],["cf83c6fb.0f7f68"],["154b5ed4.108961"],["19c51368.d6f8fd"],["651c99a3.a7f768"],["f6198ab1.ec32f8"],["40a1c2c8.47e34c"],["e34f2557.ee1c38"],["a9647dc7.41876"],["616b3d4f.ecdbd4"]]},{"id":"76243d4.8e80bc4","type":"change","z":"362f689.33b0c98","name":"Set Red","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":100,"wires":[[]]},{"id":"ad5f5a90.416018","type":"change","z":"362f689.33b0c98","name":"Set Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"120","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":260,"wires":[[]]},{"id":"19c51368.d6f8fd","type":"change","z":"362f689.33b0c98","name":"Set Purple","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"285","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":460,"wires":[[]]},{"id":"651c99a3.a7f768","type":"change","z":"362f689.33b0c98","name":"Set Pink","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"310","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":500,"wires":[[]]},{"id":"154b5ed4.108961","type":"change","z":"362f689.33b0c98","name":"Set Blue","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"240","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":420,"wires":[[]]},{"id":"d3872347.ce311","type":"change","z":"362f689.33b0c98","name":"Set Yellow","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"60","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":180,"wires":[[]]},{"id":"616b3d4f.ecdbd4","type":"function","z":"362f689.33b0c98","name":"Throw Color Error","func":"throw(\"Invalid Color Selected. Please choose either red, orange, yellow, yellow_green, green, spring_green, cyan, azure, blue, purple, pink, warm_white, white, cool_white or random. You provided: \" + msg.color)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1210,"y":700,"wires":[]},{"id":"cf83c6fb.0f7f68","type":"change","z":"362f689.33b0c98","name":"Set Azure","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"180","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":380,"wires":[[]]},{"id":"f6198ab1.ec32f8","type":"change","z":"362f689.33b0c98","name":"Set Warm_White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"2700","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":540,"wires":[[]]},{"id":"52e5e8d7.ac8ae8","type":"change","z":"362f689.33b0c98","name":"Set Orange","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"30","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":140,"wires":[[]]},{"id":"40a1c2c8.47e34c","type":"change","z":"362f689.33b0c98","name":"Set White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"4500","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":580,"wires":[[]]},{"id":"e34f2557.ee1c38","type":"change","z":"362f689.33b0c98","name":"Set Cool_White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"6500","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":620,"wires":[[]]},{"id":"680e6ded.565114","type":"change","z":"362f689.33b0c98","name":"Set msg.color","rules":[{"t":"set","p":"color","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"color_name","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":380,"wires":[["b700720d.6d5e2"]]},{"id":"72fddbcd.55b3f4","type":"change","z":"362f689.33b0c98","name":"Set Spring_Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"125","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":300,"wires":[[]]},{"id":"b06df9d.d0bbb08","type":"change","z":"362f689.33b0c98","name":"Set Yellow_Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"80","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":220,"wires":[[]]},{"id":"82ae4ce5.a9f47","type":"change","z":"362f689.33b0c98","name":"Set Cyan","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"150","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":340,"wires":[[]]},{"id":"a9647dc7.41876","type":"function","z":"362f689.33b0c98","name":"Set Random Color","func":"var color = ['0', '30', '60', '80', '120', '125', '150', '180', '240', '285', '310', '2700', '4500', '6500']; \nvar rand = color[(Math.random() * color.length) | 0]\n\nmsg.payload.color_number = {};\nmsg.payload.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1210,"y":660,"wires":[[]]},{"id":"b700720d.6d5e2","type":"function","z":"362f689.33b0c98","name":"Correct value for color","func":"msg.color = msg.color.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":380,"wires":[["edca33b2.fe0ca"]]},{"id":"a1ac2bf8.4fc0b8","type":"comment","z":"362f689.33b0c98","name":"Quick Strip Effect Colors","info":"","x":590,"y":140,"wires":[]},{"id":"869324aa.5334b8","type":"subflow","name":"Quick Strip Effect for a Single Node","info":"","category":"","in":[{"x":240,"y":220,"wires":[{"id":"83312dd0.2a2f9"}]}],"out":[{"x":1360,"y":1340,"wires":[{"id":"8e9e2a68.e385b8","port":0}]}],"env":[{"name":"node_id","type":"num","value":"33"},{"name":"color_name","type":"str","value":"red"},{"name":"brightness_level","type":"str","value":"99"},{"name":"time","type":"str","value":""},{"name":"measure_time","type":"str","value":"forever"},{"name":"effect_type","type":"str","value":"solid"}],"color":"#FFAAAA","status":{"x":380,"y":120,"wires":[{"id":"913cc6bf.43da58","port":0}]}},{"id":"913cc6bf.43da58","type":"status","z":"869324aa.5334b8","name":"","scope":null,"x":260,"y":120,"wires":[[]]},{"id":"2b9ba079.3cf79","type":"function","z":"869324aa.5334b8","name":"Calculate pixel effect","func":"var byte4 = parseInt(msg.type);\nvar byte3 = parseInt(msg.totaltime);\nvar byte2 = parseInt(msg.brightness);\nvar byte1 = parseInt(msg.color);\n\nmsg.calculation = {};\nmsg.calculation = parseInt(byte4 + byte3 + byte2 + byte1);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":980,"y":1340,"wires":[["8e9e2a68.e385b8"]]},{"id":"8e9e2a68.e385b8","type":"api-call-service","z":"869324aa.5334b8","name":"Set Parameter 21","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service_domain":"ozw","service":"set_config_parameter","entityId":"","data":"{\t   \"node_id\":msg.node,\t   \"parameter\":21,\t   \"value\":msg.calculation\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1210,"y":1340,"wires":[[]]},{"id":"44b3a9c4.282f38","type":"subflow:362f689.33b0c98","z":"869324aa.5334b8","name":"","env":[],"x":850,"y":220,"wires":[["da909821.a06c78"]]},{"id":"da909821.a06c78","type":"switch","z":"869324aa.5334b8","name":"Which color was selected?","property":"payload.color_number","propertyType":"msg","rules":[{"t":"gte","v":"2700","vt":"num"},{"t":"btwn","v":"2699","vt":"num","v2":"0","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":340,"y":380,"wires":[["f6f08702.a2b948"],["57667b5b.01b3d4"],["20da137e.d2015c"]]},{"id":"20da137e.d2015c","type":"function","z":"869324aa.5334b8","name":"Throw color error","func":"throw(\"Invalid Color Set. Please choose either red, orange, yellow, yellow_green, green, spring_green, cyan, azure, blue, purple, pink, warm_white, white, cool_white or random.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":650,"y":420,"wires":[]},{"id":"57667b5b.01b3d4","type":"function","z":"869324aa.5334b8","name":"Calculate non-white effect + set color_type to 0","func":"var setcolor = parseInt(msg.payload.color_number);\n\nmsg.color = {};\nmsg.color = parseInt((setcolor / 360 * 255).toFixed(0));\n\nmsg.color_type = {};\nmsg.color_type = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":740,"y":380,"wires":[["d4f39695.08fd88"]]},{"id":"f6f08702.a2b948","type":"function","z":"869324aa.5334b8","name":"Calculate white effect + set color_type to 1073741824","func":"var setcolor = parseInt(msg.payload.color_number);\n\nmsg.color = {};\nmsg.color = parseInt(((setcolor - 2700) / (6500-2700) * 255).toFixed(0));\n\nmsg.color_type = {};\nmsg.color_type = parseInt(1073741824);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":760,"y":340,"wires":[["d4f39695.08fd88"]]},{"id":"a15d8e01.f4e7c","type":"function","z":"869324aa.5334b8","name":"Throw time error","func":"throw(\"Invalid Time Set. Please choose either seconds, minutes, hours, forever, or random. You supplied: \" + msg.payload.timemeasure)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":640,"y":1120,"wires":[]},{"id":"50d1da0f.a92004","type":"function","z":"869324aa.5334b8","name":"Calculate time in seconds","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'seconds'. Otherwise, change 'seconds' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * timeunit);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":920,"wires":[["717e53e1.b6378c"]]},{"id":"b836ba93.bcf5d8","type":"switch","z":"869324aa.5334b8","name":"How is time measured?","property":"payload.timemeasure","propertyType":"msg","rules":[{"t":"eq","v":"seconds","vt":"str"},{"t":"eq","v":"minutes","vt":"str"},{"t":"eq","v":"hours","vt":"str"},{"t":"eq","v":"forever","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":6,"x":330,"y":1000,"wires":[["50d1da0f.a92004"],["7e33dd2e.2b5ff4"],["eeb88851.8c6158"],["621536f4.002b18"],["484ef41b.324a8c"],["a15d8e01.f4e7c"]]},{"id":"7e33dd2e.2b5ff4","type":"function","z":"869324aa.5334b8","name":"Calculate time in minutes","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'minutes'. Otherwise, change 'minutes' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * (timeunit + 60));\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":960,"wires":[["717e53e1.b6378c"]]},{"id":"eeb88851.8c6158","type":"function","z":"869324aa.5334b8","name":"Calculate time in hours","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'hours'. Otherwise, change 'hours' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * (timeunit + 120));\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":1000,"wires":[["717e53e1.b6378c"]]},{"id":"f5715ca2.81ef2","type":"switch","z":"869324aa.5334b8","name":"Make sure there's a color","property":"color_name","propertyType":"env","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":590,"y":220,"wires":[["44b3a9c4.282f38"],["c2720c2b.27cc"]]},{"id":"c2720c2b.27cc","type":"function","z":"869324aa.5334b8","name":"Throw color error","func":"throw(\"Invalid Color Selected. Color cannot be blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":830,"y":260,"wires":[]},{"id":"f9993866.b5d218","type":"switch","z":"869324aa.5334b8","name":"What type of effect was chosen?","property":"payload.effecttype","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"solid","vt":"str"},{"t":"eq","v":"chase","vt":"str"},{"t":"eq","v":"fast_blink","vt":"str"},{"t":"eq","v":"slow_blink","vt":"str"},{"t":"eq","v":"fast_fade","vt":"str"},{"t":"eq","v":"slow_fade","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":9,"x":350,"y":1360,"wires":[["4d557e68.ad4c9"],["bb8fca1e.cc1d08"],["2799bfa3.5f477"],["1f67c507.c495ab"],["8714a780.4e6e98"],["7e111dcd.465634"],["fb595c04.bddaf"],["19379c5.c7b6864"],["7ab49600.7e78bc"]]},{"id":"4d557e68.ad4c9","type":"function","z":"869324aa.5334b8","name":"Calculate off effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":650,"y":1220,"wires":[["2b9ba079.3cf79"]]},{"id":"bb8fca1e.cc1d08","type":"function","z":"869324aa.5334b8","name":"Calculate solid effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 16777216);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":1260,"wires":[["2b9ba079.3cf79"]]},{"id":"2799bfa3.5f477","type":"function","z":"869324aa.5334b8","name":"Calculate chase effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 33554432);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":1300,"wires":[["2b9ba079.3cf79"]]},{"id":"1f67c507.c495ab","type":"function","z":"869324aa.5334b8","name":"Calculate fast blink effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 50331648);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":1340,"wires":[["2b9ba079.3cf79"]]},{"id":"8714a780.4e6e98","type":"function","z":"869324aa.5334b8","name":"Calculate slow blink effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 67108864);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":1380,"wires":[["2b9ba079.3cf79"]]},{"id":"7e111dcd.465634","type":"function","z":"869324aa.5334b8","name":"Calculate fast fade effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 83886080);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":1420,"wires":[["2b9ba079.3cf79"]]},{"id":"fb595c04.bddaf","type":"function","z":"869324aa.5334b8","name":"Calculate slow fade effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 100663296);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":1460,"wires":[["2b9ba079.3cf79"]]},{"id":"7ab49600.7e78bc","type":"function","z":"869324aa.5334b8","name":"Throw effect error","func":"throw(\"Invalid Effect Set. Please choose either off, solid, chase, fast_blink, slow_blink, fast_fade, or slow_fade. You provided: \" + msg.payload.effect_type)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":650,"y":1540,"wires":[]},{"id":"717e53e1.b6378c","type":"change","z":"869324aa.5334b8","name":"Set msg.payload.effecttype","rules":[{"t":"set","p":"payload.effecttype","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.effecttype","pt":"msg","to":"effect_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1120,"y":1000,"wires":[["9d48d757.bab3f8"]]},{"id":"83312dd0.2a2f9","type":"change","z":"869324aa.5334b8","name":"Set node ID","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"node_id","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":220,"wires":[["f5715ca2.81ef2"]]},{"id":"eb222972.3f0c98","type":"function","z":"869324aa.5334b8","name":"Calculate brightness","func":"var bright = parseInt(msg.payload.brightness);\n\nmsg.brightness = {};\nmsg.brightness = parseInt((32768 + bright * 256).toFixed(0));\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":520,"wires":[["f6db6b85.e85438"]]},{"id":"75bf0824.aedff8","type":"function","z":"869324aa.5334b8","name":"Throw brightness error","func":"throw(\"Invalid Brightness Set. Please choose a value between 1 and 99, or random.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":660,"y":600,"wires":[]},{"id":"d4f39695.08fd88","type":"change","z":"869324aa.5334b8","name":"Set payload.brightness","rules":[{"t":"set","p":"payload.brightness","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.brightness","pt":"msg","to":"brightness_level","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1100,"y":360,"wires":[["27a86473.43b83c"]]},{"id":"26e5c310.2b348c","type":"switch","z":"869324aa.5334b8","name":"Check if brightness is correct","property":"payload.brightness","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"99","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":340,"y":560,"wires":[["eb222972.3f0c98"],["1a90903c.333b3"],["75bf0824.aedff8"]]},{"id":"1a90903c.333b3","type":"function","z":"869324aa.5334b8","name":"Set random brightness","func":"var rand = Math.floor(Math.random() * 99) + 1;\n\nmsg.brightness = {};\nmsg.brightness = parseInt((32768 + rand * 256).toFixed(0));\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":560,"wires":[["f6db6b85.e85438"]]},{"id":"19379c5.c7b6864","type":"function","z":"869324aa.5334b8","name":"Set random effect","func":"var setcolor = parseInt(msg.color_type);\nvar effect = ['solid', 'chase', 'fast_blink', 'slow_blink', 'fast_fade', 'slow_fade']; \nvar rand = effect[(Math.random() * effect.length) | 0]\n\nmsg.type = {};\n\nif (rand === 'solid') {\nmsg.type = parseInt(setcolor + 16777216);\nreturn msg;\n} \n\nelse if (rand === 'chase') {\nmsg.type = parseInt(setcolor + 33554432);\nreturn msg;\n} \n\nelse if (rand === 'fast_blink') {\nmsg.type = parseInt(setcolor + 50331648);\nreturn msg;\n} \n\nelse if (rand === 'slow_blink') {\nmsg.type = parseInt(setcolor + 67108864);\nreturn msg;\n} \n\nelse if (rand === 'fast_fade') {\nmsg.type = parseInt(setcolor + 83886080);\nreturn msg;\n} \n\nelse { //slow_fade\nmsg.type = parseInt(setcolor + 100663296);\nreturn msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":650,"y":1500,"wires":[["2b9ba079.3cf79"]]},{"id":"e4ec486c.ad6a78","type":"switch","z":"869324aa.5334b8","name":"Check the value of time","property":"payload.time","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"60","v2t":"num"},{"t":"empty"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":330,"y":760,"wires":[["a7efb46e.020268"],["d6bf9f81.8267c"],["7e31ac15.7424d4"],["915c49da.29fb78"]]},{"id":"915c49da.29fb78","type":"function","z":"869324aa.5334b8","name":"Throw time error","func":"throw(\"Invalid Time Set. Please choose a value between 1 and 60, a value of random, or leave time blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":640,"y":820,"wires":[]},{"id":"7e31ac15.7424d4","type":"function","z":"869324aa.5334b8","name":"Calculate a random time","func":"var rand = Math.floor(Math.random() * 60) + 1;\n\nmsg.timeamount = {};\nmsg.timeamount = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":780,"wires":[["dd814c34.0c86f"]]},{"id":"f6db6b85.e85438","type":"change","z":"869324aa.5334b8","name":"Set msg.payload.time","rules":[{"t":"set","p":"payload.time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.time","pt":"msg","to":"time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1100,"y":540,"wires":[["8eea4d8a.0221a"]]},{"id":"484ef41b.324a8c","type":"function","z":"869324aa.5334b8","name":"Calculate a random time","func":"var timeunit = parseInt(msg.timeamount);\nvar measure = ['seconds', 'minutes', 'hours', 'forever']; \nvar rand = measure[(Math.random() * measure.length) | 0]\n\nmsg.totaltime = {};\n\nif (timeunit === 0){\nthrow(\"Please do not leave time blank if choosing a 'random' measure of time. Otherwise, change 'random' to 'forever' and then leave time blank.\")\nreturn msg;\n}\n\nelse if (rand === 'seconds') {\nmsg.totaltime = parseInt(65536 * (timeunit));\nreturn msg;\n} \n\nelse if (rand === 'minutes') {\nmsg.totaltime = parseInt(65536 * (timeunit + 60));\nreturn msg;\n} \n\nelse if (rand === 'hours') {\nmsg.totaltime = parseInt(65536 * (timeunit + 120));\nreturn msg;\n} \n\nelse { //forever\nmsg.totaltime = parseInt(16711680);\nreturn msg;\n} \n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":1080,"wires":[["717e53e1.b6378c"]]},{"id":"621536f4.002b18","type":"function","z":"869324aa.5334b8","name":"Calculate time for forever","func":"msg.totaltime = {};\nmsg.totaltime = parseInt(16711680);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":1040,"wires":[["717e53e1.b6378c"]]},{"id":"27a86473.43b83c","type":"function","z":"869324aa.5334b8","name":"Correct value for brightness if needed","func":"msg.payload.brightness = msg.payload.brightness.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1390,"y":360,"wires":[["26e5c310.2b348c"]]},{"id":"8eea4d8a.0221a","type":"function","z":"869324aa.5334b8","name":"Correct value for time if needed","func":"msg.payload.time = msg.payload.time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1370,"y":540,"wires":[["e4ec486c.ad6a78"]]},{"id":"9d48d757.bab3f8","type":"function","z":"869324aa.5334b8","name":"Correct value for effect type if needed","func":"msg.payload.effecttype = msg.payload.effecttype.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1430,"y":1000,"wires":[["f9993866.b5d218"]]},{"id":"d6bf9f81.8267c","type":"function","z":"869324aa.5334b8","name":"Set msg.timeamount to 0","func":"msg.timeamount = {};\nmsg.timeamount = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":670,"y":740,"wires":[["dd814c34.0c86f"]]},{"id":"a7efb46e.020268","type":"function","z":"869324aa.5334b8","name":"Set msg.timeamount ","func":"var amount = parseInt(msg.payload.time);\n\nmsg.timeamount = {};\nmsg.timeamount = parseInt(amount);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":700,"wires":[["dd814c34.0c86f"]]},{"id":"dd814c34.0c86f","type":"change","z":"869324aa.5334b8","name":"Set msg.payload.timemeasure","rules":[{"t":"set","p":"payload.timemeasure","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.timemeasure","pt":"msg","to":"measure_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":740,"wires":[["efea1a6e.80d6f8"]]},{"id":"efea1a6e.80d6f8","type":"function","z":"869324aa.5334b8","name":"Correct value for time measure if needed","func":"msg.payload.timemeasure = msg.payload.timemeasure.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nvar measure = (msg.payload.timemeasure);\n\nif (measure === 'second'){\nmsg.payload.timemeasure = measure.replace(/second/g,'seconds');\nreturn msg;\n}\n\nelse if (measure === 'minute'){\nmsg.payload.timemeasure = measure.replace(/minute/g,'minutes');\nreturn msg;\n}\n\nelse if (measure === 'hour'){\nmsg.payload.timemeasure = measure.replace(/hour/g,'hours');\nreturn msg;\n}\n\nelse if (measure === 'infinite'){\nmsg.payload.timemeasure = measure.replace(/infinite/g,'forever');\nreturn msg;\n}\n\nelse {\nreturn msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1460,"y":740,"wires":[["e82d0685.5ae0c8"]]},{"id":"e82d0685.5ae0c8","type":"switch","z":"869324aa.5334b8","name":"Is the measurement of time forever?","property":"payload.timemeasure","propertyType":"msg","rules":[{"t":"eq","v":"forever","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1150,"y":820,"wires":[["6bdcd65d.2b9138"],["b836ba93.bcf5d8"]]},{"id":"6bdcd65d.2b9138","type":"function","z":"869324aa.5334b8","name":"Set msg.timeamount to 0","func":"msg.timeamount = {};\nmsg.timeamount = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1510,"y":840,"wires":[["b836ba93.bcf5d8"]]},{"id":"2a0b4f12.eac28","type":"comment","z":"869324aa.5334b8","name":"Quick Strip Effect for a Single Node","info":"","x":920,"y":100,"wires":[]},{"id":"497693ef.d5e6bc","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"a2f57522.b44ee8","type":"subflow:869324aa.5334b8","z":"f2826dc8.24285","name":"","x":1300,"y":280,"wires":[[]]},{"id":"54c52bfa.d133d4","type":"inject","z":"f2826dc8.24285","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1060,"y":280,"wires":[["a2f57522.b44ee8"]]}]

Here is the export for a group of lightstrips:

[{"id":"362f689.33b0c98","type":"subflow","name":"Quick Strip Effect Colors","info":"","category":"","in":[{"x":320,"y":380,"wires":[{"id":"680e6ded.565114"}]}],"out":[{"x":1460,"y":280,"wires":[{"id":"76243d4.8e80bc4","port":0},{"id":"ad5f5a90.416018","port":0},{"id":"19c51368.d6f8fd","port":0},{"id":"154b5ed4.108961","port":0},{"id":"651c99a3.a7f768","port":0},{"id":"d3872347.ce311","port":0},{"id":"cf83c6fb.0f7f68","port":0},{"id":"f6198ab1.ec32f8","port":0},{"id":"52e5e8d7.ac8ae8","port":0},{"id":"40a1c2c8.47e34c","port":0},{"id":"e34f2557.ee1c38","port":0},{"id":"b06df9d.d0bbb08","port":0},{"id":"72fddbcd.55b3f4","port":0},{"id":"82ae4ce5.a9f47","port":0},{"id":"a9647dc7.41876","port":0}]}],"env":[{"name":"color","type":"str","value":""}],"color":"#E9967A"},{"id":"edca33b2.fe0ca","type":"switch","z":"362f689.33b0c98","name":"Notification Color","property":"color","propertyType":"msg","rules":[{"t":"eq","v":"red","vt":"str"},{"t":"eq","v":"orange","vt":"str"},{"t":"eq","v":"yellow","vt":"str"},{"t":"eq","v":"yellow_green","vt":"str"},{"t":"eq","v":"green","vt":"str"},{"t":"eq","v":"spring_green","vt":"str"},{"t":"eq","v":"cyan","vt":"str"},{"t":"eq","v":"azure","vt":"str"},{"t":"eq","v":"blue","vt":"str"},{"t":"eq","v":"purple","vt":"str"},{"t":"eq","v":"pink","vt":"str"},{"t":"eq","v":"warm_white","vt":"str"},{"t":"eq","v":"white","vt":"str"},{"t":"eq","v":"cool_white","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":16,"x":910,"y":380,"wires":[["76243d4.8e80bc4"],["52e5e8d7.ac8ae8"],["d3872347.ce311"],["b06df9d.d0bbb08"],["ad5f5a90.416018"],["72fddbcd.55b3f4"],["82ae4ce5.a9f47"],["cf83c6fb.0f7f68"],["154b5ed4.108961"],["19c51368.d6f8fd"],["651c99a3.a7f768"],["f6198ab1.ec32f8"],["40a1c2c8.47e34c"],["e34f2557.ee1c38"],["a9647dc7.41876"],["616b3d4f.ecdbd4"]]},{"id":"76243d4.8e80bc4","type":"change","z":"362f689.33b0c98","name":"Set Red","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":100,"wires":[[]]},{"id":"ad5f5a90.416018","type":"change","z":"362f689.33b0c98","name":"Set Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"120","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":260,"wires":[[]]},{"id":"19c51368.d6f8fd","type":"change","z":"362f689.33b0c98","name":"Set Purple","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"285","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":460,"wires":[[]]},{"id":"651c99a3.a7f768","type":"change","z":"362f689.33b0c98","name":"Set Pink","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"310","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":500,"wires":[[]]},{"id":"154b5ed4.108961","type":"change","z":"362f689.33b0c98","name":"Set Blue","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"240","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":420,"wires":[[]]},{"id":"d3872347.ce311","type":"change","z":"362f689.33b0c98","name":"Set Yellow","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"60","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":180,"wires":[[]]},{"id":"616b3d4f.ecdbd4","type":"function","z":"362f689.33b0c98","name":"Throw Color Error","func":"throw(\"Invalid Color Selected. Please choose either red, orange, yellow, yellow_green, green, spring_green, cyan, azure, blue, purple, pink, warm_white, white, cool_white or random. You provided: \" + msg.color)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1210,"y":700,"wires":[]},{"id":"cf83c6fb.0f7f68","type":"change","z":"362f689.33b0c98","name":"Set Azure","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"180","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":380,"wires":[[]]},{"id":"f6198ab1.ec32f8","type":"change","z":"362f689.33b0c98","name":"Set Warm_White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"2700","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":540,"wires":[[]]},{"id":"52e5e8d7.ac8ae8","type":"change","z":"362f689.33b0c98","name":"Set Orange","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"30","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":140,"wires":[[]]},{"id":"40a1c2c8.47e34c","type":"change","z":"362f689.33b0c98","name":"Set White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"4500","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":580,"wires":[[]]},{"id":"e34f2557.ee1c38","type":"change","z":"362f689.33b0c98","name":"Set Cool_White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"6500","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":620,"wires":[[]]},{"id":"680e6ded.565114","type":"change","z":"362f689.33b0c98","name":"Set msg.color","rules":[{"t":"set","p":"color","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"color_name","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":380,"wires":[["b700720d.6d5e2"]]},{"id":"72fddbcd.55b3f4","type":"change","z":"362f689.33b0c98","name":"Set Spring_Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"125","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":300,"wires":[[]]},{"id":"b06df9d.d0bbb08","type":"change","z":"362f689.33b0c98","name":"Set Yellow_Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"80","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":220,"wires":[[]]},{"id":"82ae4ce5.a9f47","type":"change","z":"362f689.33b0c98","name":"Set Cyan","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"150","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":340,"wires":[[]]},{"id":"a9647dc7.41876","type":"function","z":"362f689.33b0c98","name":"Set Random Color","func":"var color = ['0', '30', '60', '80', '120', '125', '150', '180', '240', '285', '310', '2700', '4500', '6500']; \nvar rand = color[(Math.random() * color.length) | 0]\n\nmsg.payload.color_number = {};\nmsg.payload.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1210,"y":660,"wires":[[]]},{"id":"b700720d.6d5e2","type":"function","z":"362f689.33b0c98","name":"Correct value for color","func":"msg.color = msg.color.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":380,"wires":[["edca33b2.fe0ca"]]},{"id":"a1ac2bf8.4fc0b8","type":"comment","z":"362f689.33b0c98","name":"Quick Strip Effect Colors","info":"","x":590,"y":140,"wires":[]},{"id":"7327e309.ec301c","type":"subflow","name":"Quick Strip Effect for a Group","info":"","category":"","in":[{"x":380,"y":240,"wires":[{"id":"41b89b79.8d8f14"}]}],"out":[{"x":1500,"y":1360,"wires":[{"id":"224b6ff1.82a05","port":0}]}],"env":[{"name":"color_name","type":"str","value":"red"},{"name":"brightness_level","type":"str","value":"99"},{"name":"time","type":"str","value":""},{"name":"measure_time","type":"str","value":"forever"},{"name":"effect_type","type":"str","value":"solid"}],"color":"#FFAAAA","status":{"x":520,"y":140,"wires":[{"id":"585d826e.8e7edc","port":0}]}},{"id":"585d826e.8e7edc","type":"status","z":"7327e309.ec301c","name":"","scope":null,"x":400,"y":140,"wires":[[]]},{"id":"8244f552.fabe38","type":"function","z":"7327e309.ec301c","name":"Calculate pixel effect","func":"var byte4 = parseInt(msg.type);\nvar byte3 = parseInt(msg.totaltime);\nvar byte2 = parseInt(msg.brightness);\nvar byte1 = parseInt(msg.color);\n//var node = (msg.node_id);\n\nmsg.calculation = {};\nmsg.calculation = parseInt(byte4 + byte3 + byte2 + byte1);\n\n//msg.node_id = {};\n//msg.node_id = parseInt(node);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1120,"y":1360,"wires":[["224b6ff1.82a05"]]},{"id":"224b6ff1.82a05","type":"api-call-service","z":"7327e309.ec301c","name":"Set Parameter 21","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service_domain":"ozw","service":"set_config_parameter","entityId":"","data":"{\t   \"node_id\":msg.node_id,\t   \"parameter\":21,\t   \"value\":msg.calculation\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1350,"y":1360,"wires":[[]]},{"id":"bc6b719c.89bff","type":"subflow:362f689.33b0c98","z":"7327e309.ec301c","name":"","env":[],"x":1530,"y":240,"wires":[["713c5b3.d7faea4"]]},{"id":"713c5b3.d7faea4","type":"switch","z":"7327e309.ec301c","name":"Which color was selected?","property":"payload.color_number","propertyType":"msg","rules":[{"t":"gte","v":"2700","vt":"num"},{"t":"btwn","v":"2699","vt":"num","v2":"0","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":480,"y":400,"wires":[["28b6f2ce.da023e"],["7624ae91.d2822"],["39932706.9e09f8"]]},{"id":"39932706.9e09f8","type":"function","z":"7327e309.ec301c","name":"Throw color error","func":"throw(\"Invalid Color Set. Please choose either red, orange, yellow, yellow_green, green, spring_green, cyan, azure, blue, purple, pink, warm_white, white, cool_white or random.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":790,"y":440,"wires":[]},{"id":"7624ae91.d2822","type":"function","z":"7327e309.ec301c","name":"Calculate non-white effect + set color_type to 0","func":"var setcolor = parseInt(msg.payload.color_number);\n\nmsg.color = {};\nmsg.color = parseInt((setcolor / 360 * 255).toFixed(0));\n\nmsg.color_type = {};\nmsg.color_type = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":400,"wires":[["3ce96014.6032e"]]},{"id":"28b6f2ce.da023e","type":"function","z":"7327e309.ec301c","name":"Calculate white effect + set color_type to 1073741824","func":"var setcolor = parseInt(msg.payload.color_number);\n\nmsg.color = {};\nmsg.color = parseInt(((setcolor - 2700) / (6500-2700) * 255).toFixed(0));\n\nmsg.color_type = {};\nmsg.color_type = parseInt(1073741824);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":360,"wires":[["3ce96014.6032e"]]},{"id":"8dd425a6.fed948","type":"function","z":"7327e309.ec301c","name":"Throw time error","func":"throw(\"Invalid Time Set. Please choose either seconds, minutes, hours, forever, or random. You supplied: \" + msg.payload.timemeasure)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":780,"y":1140,"wires":[]},{"id":"466235c6.bafe3c","type":"function","z":"7327e309.ec301c","name":"Calculate time in seconds","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'seconds'. Otherwise, change 'seconds' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * timeunit);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":940,"wires":[["47feef89.1ebc1"]]},{"id":"44063f20.1c8f2","type":"switch","z":"7327e309.ec301c","name":"How is time measured?","property":"payload.timemeasure","propertyType":"msg","rules":[{"t":"eq","v":"seconds","vt":"str"},{"t":"eq","v":"minutes","vt":"str"},{"t":"eq","v":"hours","vt":"str"},{"t":"eq","v":"forever","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":6,"x":470,"y":1020,"wires":[["466235c6.bafe3c"],["6ebc80a.189c18"],["742bfe6e.18241"],["38e7f91e.f3ed16"],["d1f24cc0.c8b32"],["8dd425a6.fed948"]]},{"id":"6ebc80a.189c18","type":"function","z":"7327e309.ec301c","name":"Calculate time in minutes","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'minutes'. Otherwise, change 'minutes' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * (timeunit + 60));\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":980,"wires":[["47feef89.1ebc1"]]},{"id":"742bfe6e.18241","type":"function","z":"7327e309.ec301c","name":"Calculate time in hours","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'hours'. Otherwise, change 'hours' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * (timeunit + 120));\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":800,"y":1020,"wires":[["47feef89.1ebc1"]]},{"id":"d4ef5d4c.89b54","type":"switch","z":"7327e309.ec301c","name":"Make sure there's a color","property":"color_name","propertyType":"env","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1270,"y":240,"wires":[["bc6b719c.89bff"],["31eb3f23.2dad6"]]},{"id":"31eb3f23.2dad6","type":"function","z":"7327e309.ec301c","name":"Throw color error","func":"throw(\"Invalid Color Selected. Color cannot be blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1510,"y":280,"wires":[]},{"id":"69efd11a.6d942","type":"switch","z":"7327e309.ec301c","name":"What type of effect was chosen?","property":"payload.effecttype","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"solid","vt":"str"},{"t":"eq","v":"chase","vt":"str"},{"t":"eq","v":"fast_blink","vt":"str"},{"t":"eq","v":"slow_blink","vt":"str"},{"t":"eq","v":"fast_fade","vt":"str"},{"t":"eq","v":"slow_fade","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":9,"x":490,"y":1380,"wires":[["fcbabd49.80441"],["c83abebb.16f63"],["a15ac92c.144688"],["360fd0bf.a9179"],["437ea7a9.146c88"],["185110db.2869af"],["21f368f6.97f0b8"],["53bdf573.53f47c"],["a23e9b37.97c0e8"]]},{"id":"fcbabd49.80441","type":"function","z":"7327e309.ec301c","name":"Calculate off effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":790,"y":1240,"wires":[["8244f552.fabe38"]]},{"id":"c83abebb.16f63","type":"function","z":"7327e309.ec301c","name":"Calculate solid effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 16777216);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":800,"y":1280,"wires":[["8244f552.fabe38"]]},{"id":"a15ac92c.144688","type":"function","z":"7327e309.ec301c","name":"Calculate chase effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 33554432);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":800,"y":1320,"wires":[["8244f552.fabe38"]]},{"id":"360fd0bf.a9179","type":"function","z":"7327e309.ec301c","name":"Calculate fast blink effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 50331648);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":1360,"wires":[["8244f552.fabe38"]]},{"id":"437ea7a9.146c88","type":"function","z":"7327e309.ec301c","name":"Calculate slow blink effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 67108864);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":1400,"wires":[["8244f552.fabe38"]]},{"id":"185110db.2869af","type":"function","z":"7327e309.ec301c","name":"Calculate fast fade effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 83886080);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":1440,"wires":[["8244f552.fabe38"]]},{"id":"21f368f6.97f0b8","type":"function","z":"7327e309.ec301c","name":"Calculate slow fade effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 100663296);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":1480,"wires":[["8244f552.fabe38"]]},{"id":"a23e9b37.97c0e8","type":"function","z":"7327e309.ec301c","name":"Throw effect error","func":"throw(\"Invalid Effect Set. Please choose either off, solid, chase, fast_blink, slow_blink, fast_fade, or slow_fade. You provided: \" + msg.payload.effect_type)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":790,"y":1560,"wires":[]},{"id":"47feef89.1ebc1","type":"change","z":"7327e309.ec301c","name":"Set msg.payload.effecttype","rules":[{"t":"set","p":"payload.effecttype","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.effecttype","pt":"msg","to":"effect_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1260,"y":1020,"wires":[["61ef3ae9.a272a4"]]},{"id":"ccf3aa52.9a6488","type":"change","z":"7327e309.ec301c","name":"Set node ID","rules":[{"t":"set","p":"node_id","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node_id","pt":"msg","to":"payload.attributes.node_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":240,"wires":[["d4ef5d4c.89b54"]]},{"id":"22685f53.a8561","type":"function","z":"7327e309.ec301c","name":"Calculate brightness","func":"var bright = parseInt(msg.payload.brightness);\n\nmsg.brightness = {};\nmsg.brightness = parseInt((32768 + bright * 256).toFixed(0));\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":800,"y":540,"wires":[["6603849e.d2a6cc"]]},{"id":"174fabf4.9103b4","type":"function","z":"7327e309.ec301c","name":"Throw brightness error","func":"throw(\"Invalid Brightness Set. Please choose a value between 1 and 99, or random.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":800,"y":620,"wires":[]},{"id":"3ce96014.6032e","type":"change","z":"7327e309.ec301c","name":"Set payload.brightness","rules":[{"t":"set","p":"payload.brightness","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.brightness","pt":"msg","to":"brightness_level","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1240,"y":380,"wires":[["80d910d4.18ca"]]},{"id":"71ecdab5.221c34","type":"switch","z":"7327e309.ec301c","name":"Check if brightness is correct","property":"payload.brightness","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"99","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":480,"y":580,"wires":[["22685f53.a8561"],["9b0283ac.733ca"],["174fabf4.9103b4"]]},{"id":"9b0283ac.733ca","type":"function","z":"7327e309.ec301c","name":"Set random brightness","func":"var rand = Math.floor(Math.random() * 99) + 1;\n\nmsg.brightness = {};\nmsg.brightness = parseInt((32768 + rand * 256).toFixed(0));\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":800,"y":580,"wires":[["6603849e.d2a6cc"]]},{"id":"53bdf573.53f47c","type":"function","z":"7327e309.ec301c","name":"Set random effect","func":"var setcolor = parseInt(msg.color_type);\nvar effect = ['solid', 'chase', 'fast_blink', 'slow_blink', 'fast_fade', 'slow_fade']; \nvar rand = effect[(Math.random() * effect.length) | 0]\n\nmsg.type = {};\n\nif (rand === 'solid') {\nmsg.type = parseInt(setcolor + 16777216);\nreturn msg;\n} \n\nelse if (rand === 'chase') {\nmsg.type = parseInt(setcolor + 33554432);\nreturn msg;\n} \n\nelse if (rand === 'fast_blink') {\nmsg.type = parseInt(setcolor + 50331648);\nreturn msg;\n} \n\nelse if (rand === 'slow_blink') {\nmsg.type = parseInt(setcolor + 67108864);\nreturn msg;\n} \n\nelse if (rand === 'fast_fade') {\nmsg.type = parseInt(setcolor + 83886080);\nreturn msg;\n} \n\nelse { //slow_fade\nmsg.type = parseInt(setcolor + 100663296);\nreturn msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":790,"y":1520,"wires":[["8244f552.fabe38"]]},{"id":"3ba94fe6.f1119","type":"switch","z":"7327e309.ec301c","name":"Check the value of time","property":"payload.time","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"60","v2t":"num"},{"t":"empty"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":470,"y":780,"wires":[["fba5646.ec38798"],["4ca88372.9aff5c"],["d7bcc225.9613e"],["fea3072d.707068"]]},{"id":"fea3072d.707068","type":"function","z":"7327e309.ec301c","name":"Throw time error","func":"throw(\"Invalid Time Set. Please choose a value between 1 and 60, a value of random, or leave time blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":780,"y":840,"wires":[]},{"id":"d7bcc225.9613e","type":"function","z":"7327e309.ec301c","name":"Calculate a random time","func":"var rand = Math.floor(Math.random() * 60) + 1;\n\nmsg.timeamount = {};\nmsg.timeamount = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":800,"wires":[["e4fabb4f.eba528"]]},{"id":"6603849e.d2a6cc","type":"change","z":"7327e309.ec301c","name":"Set msg.payload.time","rules":[{"t":"set","p":"payload.time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.time","pt":"msg","to":"time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1240,"y":560,"wires":[["95b4105b.7f974"]]},{"id":"d1f24cc0.c8b32","type":"function","z":"7327e309.ec301c","name":"Calculate a random time","func":"var timeunit = parseInt(msg.timeamount);\nvar measure = ['seconds', 'minutes', 'hours', 'forever']; \nvar rand = measure[(Math.random() * measure.length) | 0]\n\nmsg.totaltime = {};\n\nif (timeunit === 0){\nthrow(\"Please do not leave time blank if choosing a 'random' measure of time. Otherwise, change 'random' to 'forever' and then leave time blank.\")\nreturn msg;\n}\n\nelse if (rand === 'seconds') {\nmsg.totaltime = parseInt(65536 * (timeunit));\nreturn msg;\n} \n\nelse if (rand === 'minutes') {\nmsg.totaltime = parseInt(65536 * (timeunit + 60));\nreturn msg;\n} \n\nelse if (rand === 'hours') {\nmsg.totaltime = parseInt(65536 * (timeunit + 120));\nreturn msg;\n} \n\nelse { //forever\nmsg.totaltime = parseInt(16711680);\nreturn msg;\n} \n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":1100,"wires":[["47feef89.1ebc1"]]},{"id":"38e7f91e.f3ed16","type":"function","z":"7327e309.ec301c","name":"Calculate time for forever","func":"msg.totaltime = {};\nmsg.totaltime = parseInt(16711680);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":1060,"wires":[["47feef89.1ebc1"]]},{"id":"80d910d4.18ca","type":"function","z":"7327e309.ec301c","name":"Correct value for brightness if needed","func":"msg.payload.brightness = msg.payload.brightness.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1530,"y":380,"wires":[["71ecdab5.221c34"]]},{"id":"95b4105b.7f974","type":"function","z":"7327e309.ec301c","name":"Correct value for time if needed","func":"msg.payload.time = msg.payload.time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1510,"y":560,"wires":[["3ba94fe6.f1119"]]},{"id":"61ef3ae9.a272a4","type":"function","z":"7327e309.ec301c","name":"Correct value for effect type if needed","func":"msg.payload.effecttype = msg.payload.effecttype.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1570,"y":1020,"wires":[["69efd11a.6d942"]]},{"id":"4ca88372.9aff5c","type":"function","z":"7327e309.ec301c","name":"Set msg.timeamount to 0","func":"msg.timeamount = {};\nmsg.timeamount = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":810,"y":760,"wires":[["e4fabb4f.eba528"]]},{"id":"fba5646.ec38798","type":"function","z":"7327e309.ec301c","name":"Set msg.timeamount ","func":"var amount = parseInt(msg.payload.time);\n\nmsg.timeamount = {};\nmsg.timeamount = parseInt(amount);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":800,"y":720,"wires":[["e4fabb4f.eba528"]]},{"id":"e4fabb4f.eba528","type":"change","z":"7327e309.ec301c","name":"Set msg.payload.timemeasure","rules":[{"t":"set","p":"payload.timemeasure","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.timemeasure","pt":"msg","to":"measure_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1270,"y":760,"wires":[["337eddb1.490b62"]]},{"id":"337eddb1.490b62","type":"function","z":"7327e309.ec301c","name":"Correct value for time measure if needed","func":"msg.payload.timemeasure = msg.payload.timemeasure.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nvar measure = (msg.payload.timemeasure);\n\nif (measure === 'second'){\nmsg.payload.timemeasure = measure.replace(/second/g,'seconds');\nreturn msg;\n}\n\nelse if (measure === 'minute'){\nmsg.payload.timemeasure = measure.replace(/minute/g,'minutes');\nreturn msg;\n}\n\nelse if (measure === 'hour'){\nmsg.payload.timemeasure = measure.replace(/hour/g,'hours');\nreturn msg;\n}\n\nelse if (measure === 'infinite'){\nmsg.payload.timemeasure = measure.replace(/infinite/g,'forever');\nreturn msg;\n}\n\nelse {\nreturn msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1600,"y":760,"wires":[["d3a09008.7599e"]]},{"id":"d3a09008.7599e","type":"switch","z":"7327e309.ec301c","name":"Is the measurement of time forever?","property":"payload.timemeasure","propertyType":"msg","rules":[{"t":"eq","v":"forever","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1290,"y":840,"wires":[["64db0f08.a58ac"],["44063f20.1c8f2"]]},{"id":"64db0f08.a58ac","type":"function","z":"7327e309.ec301c","name":"Set msg.timeamount to 0","func":"msg.timeamount = {};\nmsg.timeamount = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1650,"y":860,"wires":[["44063f20.1c8f2"]]},{"id":"41b89b79.8d8f14","type":"ha-get-entities","z":"7327e309.ec301c","server":"497693ef.d5e6bc","name":"Get all LED Strips","rules":[{"property":"entity_id","logic":"in_group","value":"group.inovelli_led_strips","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":530,"y":240,"wires":[["1a04da20.f69336"]]},{"id":"1a04da20.f69336","type":"split","z":"7327e309.ec301c","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":710,"y":240,"wires":[["5d4e780e.86da98"]]},{"id":"5d4e780e.86da98","type":"delay","z":"7327e309.ec301c","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"0.25","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":870,"y":240,"wires":[["ccf3aa52.9a6488"]]},{"id":"e8b1d721.996ec8","type":"comment","z":"7327e309.ec301c","name":"Quick Strip Effect for a Group","info":"","x":920,"y":80,"wires":[]},{"id":"497693ef.d5e6bc","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"ce24c90f.927ba8","type":"subflow:7327e309.ec301c","z":"f2826dc8.24285","name":"","env":[],"x":1280,"y":360,"wires":[[]]},{"id":"1186f310.db40ed","type":"inject","z":"f2826dc8.24285","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1060,"y":360,"wires":[["ce24c90f.927ba8"]]}]

Hey! Thanks for putting this all together! Any chance you have made the switch over to ZWave JS? I am trying to make that work but get an API error when I made the changes on Set Parameter 21. I appreciate any help or direction you can give. Thanks!

What command are you calling? It should be zwave_js.bulk_set_partial_config_parameters

Yes, I am calling that command. Here is what it looks like.

https://imgur.com/LSj3YZi

Hey there! I did end up updating it for ZWaveJS but guess I never posted it here. Main differences is this should work on ZWaveJS and it will take a group of lightstrips or a single lightstrip in one subflow. Let me know if you have any troubles getting it to work!

[{"id":"362f689.33b0c98","type":"subflow","name":"Quick Strip Effect Colors","info":"","category":"","in":[{"x":320,"y":380,"wires":[{"id":"680e6ded.565114"}]}],"out":[{"x":1460,"y":280,"wires":[{"id":"76243d4.8e80bc4","port":0},{"id":"ad5f5a90.416018","port":0},{"id":"19c51368.d6f8fd","port":0},{"id":"154b5ed4.108961","port":0},{"id":"651c99a3.a7f768","port":0},{"id":"d3872347.ce311","port":0},{"id":"cf83c6fb.0f7f68","port":0},{"id":"f6198ab1.ec32f8","port":0},{"id":"52e5e8d7.ac8ae8","port":0},{"id":"40a1c2c8.47e34c","port":0},{"id":"e34f2557.ee1c38","port":0},{"id":"b06df9d.d0bbb08","port":0},{"id":"72fddbcd.55b3f4","port":0},{"id":"82ae4ce5.a9f47","port":0},{"id":"a9647dc7.41876","port":0}]}],"env":[{"name":"color","type":"str","value":""}],"color":"#E9967A"},{"id":"edca33b2.fe0ca","type":"switch","z":"362f689.33b0c98","name":"Notification Color","property":"color","propertyType":"msg","rules":[{"t":"eq","v":"red","vt":"str"},{"t":"eq","v":"orange","vt":"str"},{"t":"eq","v":"yellow","vt":"str"},{"t":"eq","v":"yellow_green","vt":"str"},{"t":"eq","v":"green","vt":"str"},{"t":"eq","v":"spring_green","vt":"str"},{"t":"eq","v":"cyan","vt":"str"},{"t":"eq","v":"azure","vt":"str"},{"t":"eq","v":"blue","vt":"str"},{"t":"eq","v":"purple","vt":"str"},{"t":"eq","v":"pink","vt":"str"},{"t":"eq","v":"warm_white","vt":"str"},{"t":"eq","v":"white","vt":"str"},{"t":"eq","v":"cool_white","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":16,"x":910,"y":380,"wires":[["76243d4.8e80bc4"],["52e5e8d7.ac8ae8"],["d3872347.ce311"],["b06df9d.d0bbb08"],["ad5f5a90.416018"],["72fddbcd.55b3f4"],["82ae4ce5.a9f47"],["cf83c6fb.0f7f68"],["154b5ed4.108961"],["19c51368.d6f8fd"],["651c99a3.a7f768"],["f6198ab1.ec32f8"],["40a1c2c8.47e34c"],["e34f2557.ee1c38"],["a9647dc7.41876"],["616b3d4f.ecdbd4"]]},{"id":"76243d4.8e80bc4","type":"change","z":"362f689.33b0c98","name":"Set Red","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":100,"wires":[[]]},{"id":"ad5f5a90.416018","type":"change","z":"362f689.33b0c98","name":"Set Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"120","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":260,"wires":[[]]},{"id":"19c51368.d6f8fd","type":"change","z":"362f689.33b0c98","name":"Set Purple","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"285","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":460,"wires":[[]]},{"id":"651c99a3.a7f768","type":"change","z":"362f689.33b0c98","name":"Set Pink","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"310","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":500,"wires":[[]]},{"id":"154b5ed4.108961","type":"change","z":"362f689.33b0c98","name":"Set Blue","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"240","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":420,"wires":[[]]},{"id":"d3872347.ce311","type":"change","z":"362f689.33b0c98","name":"Set Yellow","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"60","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":180,"wires":[[]]},{"id":"616b3d4f.ecdbd4","type":"function","z":"362f689.33b0c98","name":"Throw Color Error","func":"throw(\"Invalid Color Selected. Please choose either red, orange, yellow, yellow_green, green, spring_green, cyan, azure, blue, purple, pink, warm_white, white, cool_white or random. You provided: \" + msg.color)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1210,"y":700,"wires":[]},{"id":"cf83c6fb.0f7f68","type":"change","z":"362f689.33b0c98","name":"Set Azure","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"180","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":380,"wires":[[]]},{"id":"f6198ab1.ec32f8","type":"change","z":"362f689.33b0c98","name":"Set Warm_White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"2700","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":540,"wires":[[]]},{"id":"52e5e8d7.ac8ae8","type":"change","z":"362f689.33b0c98","name":"Set Orange","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"30","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":140,"wires":[[]]},{"id":"40a1c2c8.47e34c","type":"change","z":"362f689.33b0c98","name":"Set White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"4500","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":580,"wires":[[]]},{"id":"e34f2557.ee1c38","type":"change","z":"362f689.33b0c98","name":"Set Cool_White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"6500","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":620,"wires":[[]]},{"id":"680e6ded.565114","type":"change","z":"362f689.33b0c98","name":"Set msg.color","rules":[{"t":"set","p":"color","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"color_name","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":380,"wires":[["b700720d.6d5e2"]]},{"id":"72fddbcd.55b3f4","type":"change","z":"362f689.33b0c98","name":"Set Spring_Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"125","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":300,"wires":[[]]},{"id":"b06df9d.d0bbb08","type":"change","z":"362f689.33b0c98","name":"Set Yellow_Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"80","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":220,"wires":[[]]},{"id":"82ae4ce5.a9f47","type":"change","z":"362f689.33b0c98","name":"Set Cyan","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"150","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":340,"wires":[[]]},{"id":"a9647dc7.41876","type":"function","z":"362f689.33b0c98","name":"Set Random Color","func":"var color = ['0', '30', '60', '80', '120', '125', '150', '180', '240', '285', '310', '2700', '4500', '6500']; \nvar rand = color[(Math.random() * color.length) | 0]\n\nmsg.payload.color_number = {};\nmsg.payload.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1210,"y":660,"wires":[[]]},{"id":"b700720d.6d5e2","type":"function","z":"362f689.33b0c98","name":"Correct value for color","func":"msg.color = msg.color.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":380,"wires":[["edca33b2.fe0ca"]]},{"id":"a1ac2bf8.4fc0b8","type":"comment","z":"362f689.33b0c98","name":"Quick Strip Effect Colors","info":"","x":590,"y":140,"wires":[]},{"id":"869324aa.5334b8","type":"subflow","name":"Quick Strip Effect Calculation","info":"","category":"","in":[{"x":100,"y":280,"wires":[{"id":"c6c013eb.c1b06"}]}],"out":[{"x":1560,"y":1500,"wires":[{"id":"8e9e2a68.e385b8","port":0},{"id":"cccc854e.508b28","port":0},{"id":"62be9fdb.4b3d1","port":0}]},{"x":1280,"y":1640,"wires":[{"id":"f7e3f30f.c0bfc","port":0}]}],"env":[{"name":"single_or_group","type":"str","value":"single"},{"name":"device_id","type":"str","value":"light.lzw45_light_strip_level"},{"name":"color_name","type":"str","value":"red"},{"name":"brightness_level","type":"str","value":"99"},{"name":"time","type":"str","value":""},{"name":"measure_time","type":"str","value":"forever"},{"name":"effect_type","type":"str","value":"solid"},{"name":"zwave","type":"str","value":"zwavejs"}],"color":"#FFAAAA","status":{"x":380,"y":120,"wires":[{"id":"913cc6bf.43da58","port":0}]}},{"id":"913cc6bf.43da58","type":"status","z":"869324aa.5334b8","name":"","scope":null,"x":260,"y":120,"wires":[[]]},{"id":"2b9ba079.3cf79","type":"function","z":"869324aa.5334b8","name":"Calculate pixel effect","func":"var byte4 = parseInt(msg.type);\nvar byte3 = parseInt(msg.totaltime);\nvar byte2 = parseInt(msg.brightness);\nvar byte1 = parseInt(msg.color);\n\nmsg.calculation = {};\nmsg.calculation = parseInt(byte4 + byte3 + byte2 + byte1);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":840,"y":1500,"wires":[["f7e3f30f.c0bfc"]]},{"id":"8e9e2a68.e385b8","type":"api-call-service","z":"869324aa.5334b8","name":"Set OZW Parameter 21","server":"497693ef.d5e6bc","version":3,"debugenabled":false,"service_domain":"ozw","service":"set_config_parameter","entityId":"","data":"{\t   \"node_id\":msg.node,\t   \"parameter\":21,\t   \"value\":msg.calculation\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1370,"y":1500,"wires":[[]]},{"id":"44b3a9c4.282f38","type":"subflow:362f689.33b0c98","z":"869324aa.5334b8","name":"","env":[],"x":1730,"y":420,"wires":[["da909821.a06c78"]]},{"id":"da909821.a06c78","type":"switch","z":"869324aa.5334b8","name":"Which color was selected?","property":"payload.color_number","propertyType":"msg","rules":[{"t":"gte","v":"2700","vt":"num"},{"t":"btwn","v":"2699","vt":"num","v2":"0","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":260,"y":640,"wires":[["f6f08702.a2b948"],["57667b5b.01b3d4"],["20da137e.d2015c"]]},{"id":"20da137e.d2015c","type":"function","z":"869324aa.5334b8","name":"Throw color error","func":"throw(\"Invalid Color Set. Please choose either red, orange, yellow, yellow_green, green, spring_green, cyan, azure, blue, purple, pink, warm_white, white, cool_white or random.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":570,"y":680,"wires":[]},{"id":"57667b5b.01b3d4","type":"function","z":"869324aa.5334b8","name":"Calculate non-white effect + set color_type to 0","func":"var setcolor = parseInt(msg.payload.color_number);\n\nmsg.color = {};\nmsg.color = parseInt((setcolor / 360 * 255).toFixed(0));\n\nmsg.color_type = {};\nmsg.color_type = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":660,"y":640,"wires":[["d4f39695.08fd88"]]},{"id":"f6f08702.a2b948","type":"function","z":"869324aa.5334b8","name":"Calculate white effect + set color_type to 1073741824","func":"var setcolor = parseInt(msg.payload.color_number);\n\nmsg.color = {};\nmsg.color = parseInt(((setcolor - 2700) / (6500-2700) * 255).toFixed(0));\n\nmsg.color_type = {};\nmsg.color_type = parseInt(1073741824);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":600,"wires":[["d4f39695.08fd88"]]},{"id":"a15d8e01.f4e7c","type":"function","z":"869324aa.5334b8","name":"Throw time error","func":"throw(\"Invalid Time Set. Please choose either seconds, minutes, hours, forever, or random. You supplied: \" + msg.payload.timemeasure)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":560,"y":1260,"wires":[]},{"id":"50d1da0f.a92004","type":"function","z":"869324aa.5334b8","name":"Calculate time in seconds","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'seconds'. Otherwise, change 'seconds' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * timeunit);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":1060,"wires":[["717e53e1.b6378c"]]},{"id":"b836ba93.bcf5d8","type":"switch","z":"869324aa.5334b8","name":"How is time measured?","property":"payload.timemeasure","propertyType":"msg","rules":[{"t":"eq","v":"seconds","vt":"str"},{"t":"eq","v":"minutes","vt":"str"},{"t":"eq","v":"hours","vt":"str"},{"t":"eq","v":"forever","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":6,"x":250,"y":1140,"wires":[["50d1da0f.a92004"],["7e33dd2e.2b5ff4"],["eeb88851.8c6158"],["621536f4.002b18"],["484ef41b.324a8c"],["a15d8e01.f4e7c"]]},{"id":"7e33dd2e.2b5ff4","type":"function","z":"869324aa.5334b8","name":"Calculate time in minutes","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'minutes'. Otherwise, change 'minutes' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * (timeunit + 60));\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":1100,"wires":[["717e53e1.b6378c"]]},{"id":"eeb88851.8c6158","type":"function","z":"869324aa.5334b8","name":"Calculate time in hours","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'hours'. Otherwise, change 'hours' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * (timeunit + 120));\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":1140,"wires":[["717e53e1.b6378c"]]},{"id":"f5715ca2.81ef2","type":"switch","z":"869324aa.5334b8","name":"Make sure there's a color","property":"color_name","propertyType":"env","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1470,"y":420,"wires":[["44b3a9c4.282f38"],["c2720c2b.27cc"]]},{"id":"c2720c2b.27cc","type":"function","z":"869324aa.5334b8","name":"Throw color error","func":"throw(\"Invalid Color Selected. Color cannot be blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1710,"y":500,"wires":[]},{"id":"f9993866.b5d218","type":"switch","z":"869324aa.5334b8","name":"What type of effect was chosen?","property":"payload.effecttype","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"solid","vt":"str"},{"t":"eq","v":"chase","vt":"str"},{"t":"eq","v":"fast_blink","vt":"str"},{"t":"eq","v":"slow_blink","vt":"str"},{"t":"eq","v":"fast_fade","vt":"str"},{"t":"eq","v":"slow_fade","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":9,"x":1530,"y":1140,"wires":[["4d557e68.ad4c9"],["bb8fca1e.cc1d08"],["2799bfa3.5f477"],["1f67c507.c495ab"],["8714a780.4e6e98"],["7e111dcd.465634"],["fb595c04.bddaf"],["19379c5.c7b6864"],["7ab49600.7e78bc"]]},{"id":"4d557e68.ad4c9","type":"function","z":"869324aa.5334b8","name":"Calculate off effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1810,"y":1000,"wires":[["2b9ba079.3cf79"]]},{"id":"bb8fca1e.cc1d08","type":"function","z":"869324aa.5334b8","name":"Calculate solid effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 16777216);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1820,"y":1040,"wires":[["2b9ba079.3cf79"]]},{"id":"2799bfa3.5f477","type":"function","z":"869324aa.5334b8","name":"Calculate chase effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 33554432);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1820,"y":1080,"wires":[["2b9ba079.3cf79"]]},{"id":"1f67c507.c495ab","type":"function","z":"869324aa.5334b8","name":"Calculate fast blink effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 50331648);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1830,"y":1120,"wires":[["2b9ba079.3cf79"]]},{"id":"8714a780.4e6e98","type":"function","z":"869324aa.5334b8","name":"Calculate slow blink effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 67108864);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1830,"y":1160,"wires":[["2b9ba079.3cf79"]]},{"id":"7e111dcd.465634","type":"function","z":"869324aa.5334b8","name":"Calculate fast fade effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 83886080);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1830,"y":1200,"wires":[["2b9ba079.3cf79"]]},{"id":"fb595c04.bddaf","type":"function","z":"869324aa.5334b8","name":"Calculate slow fade effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 100663296);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1830,"y":1240,"wires":[["2b9ba079.3cf79"]]},{"id":"7ab49600.7e78bc","type":"function","z":"869324aa.5334b8","name":"Throw effect error","func":"throw(\"Invalid Effect Set. Please choose either off, solid, chase, fast_blink, slow_blink, fast_fade, or slow_fade. You provided: \" + msg.payload.effect_type)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1810,"y":1320,"wires":[]},{"id":"717e53e1.b6378c","type":"change","z":"869324aa.5334b8","name":"Set msg.payload.effecttype","rules":[{"t":"set","p":"payload.effecttype","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.effecttype","pt":"msg","to":"effect_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1140,"wires":[["9d48d757.bab3f8"]]},{"id":"83312dd0.2a2f9","type":"change","z":"869324aa.5334b8","name":"Set Device ID","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"device_id","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":280,"wires":[["73307ac5.da4844"]]},{"id":"eb222972.3f0c98","type":"function","z":"869324aa.5334b8","name":"Calculate brightness","func":"var bright = parseInt(msg.payload.brightness);\n\nmsg.brightness = {};\nmsg.brightness = parseInt((32768 + bright * 256).toFixed(0));\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1880,"y":580,"wires":[["f6db6b85.e85438"]]},{"id":"75bf0824.aedff8","type":"function","z":"869324aa.5334b8","name":"Throw brightness error","func":"throw(\"Invalid Brightness Set. Please choose a value between 1 and 99, or random.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1880,"y":660,"wires":[]},{"id":"d4f39695.08fd88","type":"change","z":"869324aa.5334b8","name":"Set payload.brightness","rules":[{"t":"set","p":"payload.brightness","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.brightness","pt":"msg","to":"brightness_level","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":620,"wires":[["27a86473.43b83c"]]},{"id":"26e5c310.2b348c","type":"switch","z":"869324aa.5334b8","name":"Check if brightness is correct","property":"payload.brightness","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"99","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1620,"y":620,"wires":[["eb222972.3f0c98"],["1a90903c.333b3"],["75bf0824.aedff8"]]},{"id":"1a90903c.333b3","type":"function","z":"869324aa.5334b8","name":"Set random brightness","func":"var rand = Math.floor(Math.random() * 99) + 1;\n\nmsg.brightness = {};\nmsg.brightness = parseInt((32768 + rand * 256).toFixed(0));\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1880,"y":620,"wires":[["f6db6b85.e85438"]]},{"id":"19379c5.c7b6864","type":"function","z":"869324aa.5334b8","name":"Set random effect","func":"var setcolor = parseInt(msg.color_type);\nvar effect = ['solid', 'chase', 'fast_blink', 'slow_blink', 'fast_fade', 'slow_fade']; \nvar rand = effect[(Math.random() * effect.length) | 0]\n\nmsg.type = {};\n\nif (rand === 'solid') {\nmsg.type = parseInt(setcolor + 16777216);\nreturn msg;\n} \n\nelse if (rand === 'chase') {\nmsg.type = parseInt(setcolor + 33554432);\nreturn msg;\n} \n\nelse if (rand === 'fast_blink') {\nmsg.type = parseInt(setcolor + 50331648);\nreturn msg;\n} \n\nelse if (rand === 'slow_blink') {\nmsg.type = parseInt(setcolor + 67108864);\nreturn msg;\n} \n\nelse if (rand === 'fast_fade') {\nmsg.type = parseInt(setcolor + 83886080);\nreturn msg;\n} \n\nelse { //slow_fade\nmsg.type = parseInt(setcolor + 100663296);\nreturn msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1810,"y":1280,"wires":[["2b9ba079.3cf79"]]},{"id":"e4ec486c.ad6a78","type":"switch","z":"869324aa.5334b8","name":"Check the value of time","property":"payload.time","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"60","v2t":"num"},{"t":"empty"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":550,"y":860,"wires":[["a7efb46e.020268"],["d6bf9f81.8267c"],["7e31ac15.7424d4"],["915c49da.29fb78"]]},{"id":"915c49da.29fb78","type":"function","z":"869324aa.5334b8","name":"Throw time error","func":"throw(\"Invalid Time Set. Please choose a value between 1 and 60, a value of random, or leave time blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":800,"y":920,"wires":[]},{"id":"7e31ac15.7424d4","type":"function","z":"869324aa.5334b8","name":"Calculate a random time","func":"var rand = Math.floor(Math.random() * 60) + 1;\n\nmsg.timeamount = {};\nmsg.timeamount = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":830,"y":880,"wires":[["dd814c34.0c86f"]]},{"id":"f6db6b85.e85438","type":"change","z":"869324aa.5334b8","name":"Set msg.payload.time","rules":[{"t":"set","p":"payload.time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.time","pt":"msg","to":"time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":2140,"y":600,"wires":[["8eea4d8a.0221a"]]},{"id":"484ef41b.324a8c","type":"function","z":"869324aa.5334b8","name":"Calculate a random time","func":"var timeunit = parseInt(msg.timeamount);\nvar measure = ['seconds', 'minutes', 'hours', 'forever']; \nvar rand = measure[(Math.random() * measure.length) | 0]\n\nmsg.totaltime = {};\n\nif (timeunit === 0){\nthrow(\"Please do not leave time blank if choosing a 'random' measure of time. Otherwise, change 'random' to 'forever' and then leave time blank.\")\nreturn msg;\n}\n\nelse if (rand === 'seconds') {\nmsg.totaltime = parseInt(65536 * (timeunit));\nreturn msg;\n} \n\nelse if (rand === 'minutes') {\nmsg.totaltime = parseInt(65536 * (timeunit + 60));\nreturn msg;\n} \n\nelse if (rand === 'hours') {\nmsg.totaltime = parseInt(65536 * (timeunit + 120));\nreturn msg;\n} \n\nelse { //forever\nmsg.totaltime = parseInt(16711680);\nreturn msg;\n} \n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":1220,"wires":[["717e53e1.b6378c"]]},{"id":"621536f4.002b18","type":"function","z":"869324aa.5334b8","name":"Calculate time for forever","func":"msg.totaltime = {};\nmsg.totaltime = parseInt(16711680);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":1180,"wires":[["717e53e1.b6378c"]]},{"id":"27a86473.43b83c","type":"function","z":"869324aa.5334b8","name":"Correct value for brightness if needed","func":"msg.payload.brightness = msg.payload.brightness.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1310,"y":620,"wires":[["26e5c310.2b348c"]]},{"id":"8eea4d8a.0221a","type":"function","z":"869324aa.5334b8","name":"Correct value for time if needed","func":"msg.payload.time = msg.payload.time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":270,"y":860,"wires":[["e4ec486c.ad6a78"]]},{"id":"9d48d757.bab3f8","type":"function","z":"869324aa.5334b8","name":"Correct value for effect type if needed","func":"msg.payload.effecttype = msg.payload.effecttype.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1210,"y":1140,"wires":[["f9993866.b5d218"]]},{"id":"d6bf9f81.8267c","type":"function","z":"869324aa.5334b8","name":"Set msg.timeamount to 0","func":"msg.timeamount = {};\nmsg.timeamount = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":830,"y":840,"wires":[["dd814c34.0c86f"]]},{"id":"a7efb46e.020268","type":"function","z":"869324aa.5334b8","name":"Set msg.timeamount ","func":"var amount = parseInt(msg.payload.time);\n\nmsg.timeamount = {};\nmsg.timeamount = parseInt(amount);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":820,"y":800,"wires":[["dd814c34.0c86f"]]},{"id":"dd814c34.0c86f","type":"change","z":"869324aa.5334b8","name":"Set msg.payload.timemeasure","rules":[{"t":"set","p":"payload.timemeasure","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.timemeasure","pt":"msg","to":"measure_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":840,"wires":[["efea1a6e.80d6f8"]]},{"id":"efea1a6e.80d6f8","type":"function","z":"869324aa.5334b8","name":"Correct value for time measure if needed","func":"msg.payload.timemeasure = msg.payload.timemeasure.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nvar measure = (msg.payload.timemeasure);\n\nif (measure === 'second'){\nmsg.payload.timemeasure = measure.replace(/second/g,'seconds');\nreturn msg;\n}\n\nelse if (measure === 'minute'){\nmsg.payload.timemeasure = measure.replace(/minute/g,'minutes');\nreturn msg;\n}\n\nelse if (measure === 'hour'){\nmsg.payload.timemeasure = measure.replace(/hour/g,'hours');\nreturn msg;\n}\n\nelse if (measure === 'infinite'){\nmsg.payload.timemeasure = measure.replace(/infinite/g,'forever');\nreturn msg;\n}\n\nelse {\nreturn msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1460,"y":840,"wires":[["e82d0685.5ae0c8"]]},{"id":"e82d0685.5ae0c8","type":"switch","z":"869324aa.5334b8","name":"Is the measurement of time forever?","property":"payload.timemeasure","propertyType":"msg","rules":[{"t":"eq","v":"forever","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1150,"y":920,"wires":[["6bdcd65d.2b9138"],["b836ba93.bcf5d8"]]},{"id":"6bdcd65d.2b9138","type":"function","z":"869324aa.5334b8","name":"Set msg.timeamount to 0","func":"msg.timeamount = {};\nmsg.timeamount = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1510,"y":940,"wires":[["b836ba93.bcf5d8"]]},{"id":"2a0b4f12.eac28","type":"comment","z":"869324aa.5334b8","name":"Quick Strip Effect Calculation","info":"","x":900,"y":100,"wires":[]},{"id":"fee94ec7.71e8","type":"change","z":"869324aa.5334b8","name":"Set node ID","rules":[{"t":"set","p":"node","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"payload.attributes.node_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":440,"wires":[["f5715ca2.81ef2"]]},{"id":"5e566d28.bd7114","type":"ha-get-entities","z":"869324aa.5334b8","name":"Get all LED Strips","server":"497693ef.d5e6bc","version":0,"rules":[{"property":"entity_id","logic":"in_group","value":"group.inovelli_led_strips","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":430,"y":420,"wires":[["fe435cbd.fa1ad"]]},{"id":"fe435cbd.fa1ad","type":"split","z":"869324aa.5334b8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":610,"y":420,"wires":[["cd476eda.d6d78"]]},{"id":"cd476eda.d6d78","type":"delay","z":"869324aa.5334b8","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"0.25","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":770,"y":420,"wires":[["69c965da.e96fec"]]},{"id":"c6c013eb.c1b06","type":"change","z":"869324aa.5334b8","name":"Set msg.singleorgroup","rules":[{"t":"set","p":"singleorgroup","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"singleorgroup","pt":"msg","to":"single_or_group","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":280,"wires":[["f04f5b4b.c3ef98"]]},{"id":"93557d32.10b66","type":"switch","z":"869324aa.5334b8","name":"Is this a single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1430,"y":280,"wires":[["83312dd0.2a2f9"],["5e566d28.bd7114"],["9ea4be43.db666"]]},{"id":"f04f5b4b.c3ef98","type":"function","z":"869324aa.5334b8","name":"Correct value for singleorgroup if needed","func":"msg.singleorgroup = msg.singleorgroup.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":280,"wires":[["159014ed.fe762b"]]},{"id":"159014ed.fe762b","type":"change","z":"869324aa.5334b8","name":"Set msg.zwave","rules":[{"t":"set","p":"zwave","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"zwave","pt":"msg","to":"zwave","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":280,"wires":[["aa89f09f.0311b"]]},{"id":"aa89f09f.0311b","type":"function","z":"869324aa.5334b8","name":"Correct value for zwave if needed","func":"msg.zwave = msg.zwave.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1120,"y":280,"wires":[["93557d32.10b66"]]},{"id":"9ea4be43.db666","type":"function","z":"869324aa.5334b8","name":"Throw node error","func":"throw(\"Invalid selection for single or group. Valid entries include either single, or group. You provided: \" + msg.singleorgroup)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1710,"y":220,"wires":[]},{"id":"73307ac5.da4844","type":"switch","z":"869324aa.5334b8","name":"Make sure there's a device defined","property":"node","propertyType":"msg","rules":[{"t":"istype","v":"string","vt":"string"},{"t":"btwn","v":"1","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"0","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":1960,"y":280,"wires":[["f5715ca2.81ef2"],["f5715ca2.81ef2"],["7c7c3b66.b113e4"],["7c7c3b66.b113e4"]]},{"id":"7c7c3b66.b113e4","type":"function","z":"869324aa.5334b8","name":"Throw device error","func":"throw(\"device_id cannot be 0 or blank if single_or_group is defined as single. Please either add in a device_id or change single_or_group to group and try again. Value provided was: \" + msg.node)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2230,"y":360,"wires":[]},{"id":"69c965da.e96fec","type":"switch","z":"869324aa.5334b8","name":"Which zwave instance?","property":"zwave","propertyType":"msg","rules":[{"t":"eq","v":"zwavejs","vt":"str"},{"t":"eq","v":"ozw","vt":"str"},{"t":"eq","v":"1.4","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":990,"y":420,"wires":[["551f8d33.1a7a84"],["fee94ec7.71e8"],["fee94ec7.71e8"]]},{"id":"551f8d33.1a7a84","type":"change","z":"869324aa.5334b8","name":"Set entity ID","rules":[{"t":"set","p":"node","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"payload.entity_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":400,"wires":[["f5715ca2.81ef2"]]},{"id":"f7e3f30f.c0bfc","type":"switch","z":"869324aa.5334b8","name":"Which zwave instance?","property":"zwave","propertyType":"msg","rules":[{"t":"eq","v":"zwavejs","vt":"str"},{"t":"eq","v":"ozw","vt":"str"},{"t":"eq","v":"1.4","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1090,"y":1500,"wires":[["cccc854e.508b28"],["8e9e2a68.e385b8"],["62be9fdb.4b3d1"]]},{"id":"cccc854e.508b28","type":"api-call-service","z":"869324aa.5334b8","name":"Set ZWaveJS Parameter 21","server":"497693ef.d5e6bc","version":3,"debugenabled":false,"service_domain":"zwave_js","service":"bulk_set_partial_config_parameters","entityId":"","data":"{    \t    \"entity_id\": msg.node,\t    \"parameter\": 21,    \t    \"value\": msg.calculation\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1380,"y":1460,"wires":[[]]},{"id":"62be9fdb.4b3d1","type":"api-call-service","z":"869324aa.5334b8","name":"Set ZWave 1.4 Parameter 21","server":"497693ef.d5e6bc","version":3,"debugenabled":false,"service_domain":"zwave","service":"set_config_parameter","entityId":"","data":"{\t   \"node_id\":msg.node,\t   \"parameter\":21,\t   \"value\":msg.calculation\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1380,"y":1540,"wires":[[]]},{"id":"497693ef.d5e6bc","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true},{"id":"3dff5d1d.9e9f12","type":"subflow:869324aa.5334b8","z":"f1e1b905.e9a56","name":"","env":[],"x":1320,"y":1560,"wires":[[],[]]},{"id":"1b3b45f0.a4db7a","type":"inject","z":"f1e1b905.e9a56","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1100,"y":1560,"wires":[["3dff5d1d.9e9f12"]]}]
1 Like

The man, the myth, the legend! Thank you so much! I am up and running!

1 Like

Thanks for sharing, this will be super helpful!

1 Like

I made one more minor update to this subflow allowing it to use Multicast instead of Bulkset.

[{"id":"362f689.33b0c98","type":"subflow","name":"Quick Strip Effect Colors","info":"","category":"","in":[{"x":320,"y":380,"wires":[{"id":"680e6ded.565114"}]}],"out":[{"x":1460,"y":280,"wires":[{"id":"76243d4.8e80bc4","port":0},{"id":"ad5f5a90.416018","port":0},{"id":"19c51368.d6f8fd","port":0},{"id":"154b5ed4.108961","port":0},{"id":"651c99a3.a7f768","port":0},{"id":"d3872347.ce311","port":0},{"id":"cf83c6fb.0f7f68","port":0},{"id":"f6198ab1.ec32f8","port":0},{"id":"52e5e8d7.ac8ae8","port":0},{"id":"40a1c2c8.47e34c","port":0},{"id":"e34f2557.ee1c38","port":0},{"id":"b06df9d.d0bbb08","port":0},{"id":"72fddbcd.55b3f4","port":0},{"id":"82ae4ce5.a9f47","port":0},{"id":"a9647dc7.41876","port":0}]}],"env":[{"name":"color","type":"str","value":""}],"color":"#E9967A"},{"id":"edca33b2.fe0ca","type":"switch","z":"362f689.33b0c98","name":"Notification Color","property":"color","propertyType":"msg","rules":[{"t":"eq","v":"red","vt":"str"},{"t":"eq","v":"orange","vt":"str"},{"t":"eq","v":"yellow","vt":"str"},{"t":"eq","v":"yellow_green","vt":"str"},{"t":"eq","v":"green","vt":"str"},{"t":"eq","v":"spring_green","vt":"str"},{"t":"eq","v":"cyan","vt":"str"},{"t":"eq","v":"azure","vt":"str"},{"t":"eq","v":"blue","vt":"str"},{"t":"eq","v":"purple","vt":"str"},{"t":"eq","v":"pink","vt":"str"},{"t":"eq","v":"warm_white","vt":"str"},{"t":"eq","v":"white","vt":"str"},{"t":"eq","v":"cool_white","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":16,"x":910,"y":380,"wires":[["76243d4.8e80bc4"],["52e5e8d7.ac8ae8"],["d3872347.ce311"],["b06df9d.d0bbb08"],["ad5f5a90.416018"],["72fddbcd.55b3f4"],["82ae4ce5.a9f47"],["cf83c6fb.0f7f68"],["154b5ed4.108961"],["19c51368.d6f8fd"],["651c99a3.a7f768"],["f6198ab1.ec32f8"],["40a1c2c8.47e34c"],["e34f2557.ee1c38"],["a9647dc7.41876"],["616b3d4f.ecdbd4"]]},{"id":"76243d4.8e80bc4","type":"change","z":"362f689.33b0c98","name":"Set Red","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":100,"wires":[[]]},{"id":"ad5f5a90.416018","type":"change","z":"362f689.33b0c98","name":"Set Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"120","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":260,"wires":[[]]},{"id":"19c51368.d6f8fd","type":"change","z":"362f689.33b0c98","name":"Set Purple","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"285","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":460,"wires":[[]]},{"id":"651c99a3.a7f768","type":"change","z":"362f689.33b0c98","name":"Set Pink","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"310","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":500,"wires":[[]]},{"id":"154b5ed4.108961","type":"change","z":"362f689.33b0c98","name":"Set Blue","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"240","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":420,"wires":[[]]},{"id":"d3872347.ce311","type":"change","z":"362f689.33b0c98","name":"Set Yellow","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"60","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":180,"wires":[[]]},{"id":"616b3d4f.ecdbd4","type":"function","z":"362f689.33b0c98","name":"Throw Color Error","func":"throw(\"Invalid Color Selected. Please choose either red, orange, yellow, yellow_green, green, spring_green, cyan, azure, blue, purple, pink, warm_white, white, cool_white or random. You provided: \" + msg.color)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1210,"y":700,"wires":[]},{"id":"cf83c6fb.0f7f68","type":"change","z":"362f689.33b0c98","name":"Set Azure","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"180","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":380,"wires":[[]]},{"id":"f6198ab1.ec32f8","type":"change","z":"362f689.33b0c98","name":"Set Warm_White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"2700","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":540,"wires":[[]]},{"id":"52e5e8d7.ac8ae8","type":"change","z":"362f689.33b0c98","name":"Set Orange","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"30","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":140,"wires":[[]]},{"id":"40a1c2c8.47e34c","type":"change","z":"362f689.33b0c98","name":"Set White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"4500","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":580,"wires":[[]]},{"id":"e34f2557.ee1c38","type":"change","z":"362f689.33b0c98","name":"Set Cool_White","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"6500","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":620,"wires":[[]]},{"id":"680e6ded.565114","type":"change","z":"362f689.33b0c98","name":"Set msg.color","rules":[{"t":"set","p":"color","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"color_name","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":380,"wires":[["b700720d.6d5e2"]]},{"id":"72fddbcd.55b3f4","type":"change","z":"362f689.33b0c98","name":"Set Spring_Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"125","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":300,"wires":[[]]},{"id":"b06df9d.d0bbb08","type":"change","z":"362f689.33b0c98","name":"Set Yellow_Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"80","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":220,"wires":[[]]},{"id":"82ae4ce5.a9f47","type":"change","z":"362f689.33b0c98","name":"Set Cyan","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.color_number","pt":"msg","to":"150","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":340,"wires":[[]]},{"id":"a9647dc7.41876","type":"function","z":"362f689.33b0c98","name":"Set Random Color","func":"var color = ['0', '30', '60', '80', '120', '125', '150', '180', '240', '285', '310', '2700', '4500', '6500']; \nvar rand = color[(Math.random() * color.length) | 0]\n\nmsg.payload.color_number = {};\nmsg.payload.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1210,"y":660,"wires":[[]]},{"id":"b700720d.6d5e2","type":"function","z":"362f689.33b0c98","name":"Correct value for color","func":"msg.color = msg.color.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":380,"wires":[["edca33b2.fe0ca"]]},{"id":"a1ac2bf8.4fc0b8","type":"comment","z":"362f689.33b0c98","name":"Quick Strip Effect Colors","info":"","x":590,"y":140,"wires":[]},{"id":"869324aa.5334b8","type":"subflow","name":"Quick Strip Effect Calculation","info":"","category":"","in":[{"x":100,"y":280,"wires":[{"id":"c6c013eb.c1b06"}]}],"out":[{"x":1560,"y":1500,"wires":[{"id":"8e9e2a68.e385b8","port":0},{"id":"cccc854e.508b28","port":0},{"id":"62be9fdb.4b3d1","port":0}]}],"env":[{"name":"single_or_group","type":"str","value":"single"},{"name":"device_id","type":"str","value":"light.lzw45_light_strip_level"},{"name":"color_name","type":"str","value":"red"},{"name":"brightness_level","type":"str","value":"99"},{"name":"time","type":"str","value":""},{"name":"measure_time","type":"str","value":"forever"},{"name":"effect_type","type":"str","value":"solid"},{"name":"zwave","type":"str","value":"zwavejs"}],"color":"#FFAAAA"},{"id":"2b9ba079.3cf79","type":"function","z":"869324aa.5334b8","name":"Calculate pixel effect","func":"var byte4 = parseInt(msg.type);\nvar byte3 = parseInt(msg.totaltime);\nvar byte2 = parseInt(msg.brightness);\nvar byte1 = parseInt(msg.color);\n\nmsg.calculation = {};\nmsg.calculation = parseInt(byte4 + byte3 + byte2 + byte1);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":840,"y":1500,"wires":[["f7e3f30f.c0bfc"]]},{"id":"8e9e2a68.e385b8","type":"api-call-service","z":"869324aa.5334b8","name":"Set OZW Parameter 21","server":"497693ef.d5e6bc","version":3,"debugenabled":false,"service_domain":"ozw","service":"set_config_parameter","entityId":"","data":"{\t   \"node_id\":msg.node,\t   \"parameter\":21,\t   \"value\":msg.calculation\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1370,"y":1500,"wires":[[]]},{"id":"44b3a9c4.282f38","type":"subflow:362f689.33b0c98","z":"869324aa.5334b8","name":"","env":[],"x":1730,"y":420,"wires":[["da909821.a06c78"]]},{"id":"da909821.a06c78","type":"switch","z":"869324aa.5334b8","name":"Which color was selected?","property":"payload.color_number","propertyType":"msg","rules":[{"t":"gte","v":"2700","vt":"num"},{"t":"btwn","v":"2699","vt":"num","v2":"0","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":260,"y":640,"wires":[["f6f08702.a2b948"],["57667b5b.01b3d4"],["20da137e.d2015c"]]},{"id":"20da137e.d2015c","type":"function","z":"869324aa.5334b8","name":"Throw color error","func":"throw(\"Invalid Color Set. Please choose either red, orange, yellow, yellow_green, green, spring_green, cyan, azure, blue, purple, pink, warm_white, white, cool_white or random.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":570,"y":680,"wires":[]},{"id":"57667b5b.01b3d4","type":"function","z":"869324aa.5334b8","name":"Calculate non-white effect + set color_type to 0","func":"var setcolor = parseInt(msg.payload.color_number);\n\nmsg.color = {};\nmsg.color = parseInt((setcolor / 360 * 255).toFixed(0));\n\nmsg.color_type = {};\nmsg.color_type = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":640,"wires":[["d4f39695.08fd88"]]},{"id":"f6f08702.a2b948","type":"function","z":"869324aa.5334b8","name":"Calculate white effect + set color_type to 1073741824","func":"var setcolor = parseInt(msg.payload.color_number);\n\nmsg.color = {};\nmsg.color = parseInt(((setcolor - 2700) / (6500-2700) * 255).toFixed(0));\n\nmsg.color_type = {};\nmsg.color_type = parseInt(1073741824);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":680,"y":600,"wires":[["d4f39695.08fd88"]]},{"id":"a15d8e01.f4e7c","type":"function","z":"869324aa.5334b8","name":"Throw time error","func":"throw(\"Invalid Time Set. Please choose either seconds, minutes, hours, forever, or random. You supplied: \" + msg.payload.timemeasure)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":560,"y":1260,"wires":[]},{"id":"50d1da0f.a92004","type":"function","z":"869324aa.5334b8","name":"Calculate time in seconds","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'seconds'. Otherwise, change 'seconds' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * timeunit);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":1060,"wires":[["717e53e1.b6378c"]]},{"id":"b836ba93.bcf5d8","type":"switch","z":"869324aa.5334b8","name":"How is time measured?","property":"payload.timemeasure","propertyType":"msg","rules":[{"t":"eq","v":"seconds","vt":"str"},{"t":"eq","v":"minutes","vt":"str"},{"t":"eq","v":"hours","vt":"str"},{"t":"eq","v":"forever","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":6,"x":250,"y":1140,"wires":[["50d1da0f.a92004"],["7e33dd2e.2b5ff4"],["eeb88851.8c6158"],["621536f4.002b18"],["484ef41b.324a8c"],["a15d8e01.f4e7c"]]},{"id":"7e33dd2e.2b5ff4","type":"function","z":"869324aa.5334b8","name":"Calculate time in minutes","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'minutes'. Otherwise, change 'minutes' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * (timeunit + 60));\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":1100,"wires":[["717e53e1.b6378c"]]},{"id":"eeb88851.8c6158","type":"function","z":"869324aa.5334b8","name":"Calculate time in hours","func":"var timeunit = parseInt(msg.timeamount);\n\nif (timeunit === 0){\n    throw(\"Please do not leave time blank if calculating in 'hours'. Otherwise, change 'hours' to 'forever' and then leave time blank.\")\n    return msg;\n}\n\nelse {\nmsg.totaltime = {};\nmsg.totaltime = parseInt(65536 * (timeunit + 120));\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":1140,"wires":[["717e53e1.b6378c"]]},{"id":"f5715ca2.81ef2","type":"switch","z":"869324aa.5334b8","name":"Make sure there's a color","property":"color_name","propertyType":"env","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1470,"y":420,"wires":[["44b3a9c4.282f38"],["c2720c2b.27cc"]]},{"id":"c2720c2b.27cc","type":"function","z":"869324aa.5334b8","name":"Throw color error","func":"throw(\"Invalid Color Selected. Color cannot be blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1710,"y":500,"wires":[]},{"id":"f9993866.b5d218","type":"switch","z":"869324aa.5334b8","name":"What type of effect was chosen?","property":"payload.effecttype","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"solid","vt":"str"},{"t":"eq","v":"chase","vt":"str"},{"t":"eq","v":"fast_blink","vt":"str"},{"t":"eq","v":"slow_blink","vt":"str"},{"t":"eq","v":"fast_fade","vt":"str"},{"t":"eq","v":"slow_fade","vt":"str"},{"t":"eq","v":"random_no_strobe","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":1530,"y":1140,"wires":[["4d557e68.ad4c9"],["bb8fca1e.cc1d08"],["2799bfa3.5f477"],["1f67c507.c495ab"],["8714a780.4e6e98"],["7e111dcd.465634"],["fb595c04.bddaf"],["0a17d24c1600634a"],["19379c5.c7b6864"],["7ab49600.7e78bc"]]},{"id":"4d557e68.ad4c9","type":"function","z":"869324aa.5334b8","name":"Calculate off effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1810,"y":1000,"wires":[["2b9ba079.3cf79"]]},{"id":"bb8fca1e.cc1d08","type":"function","z":"869324aa.5334b8","name":"Calculate solid effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 16777216);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1820,"y":1040,"wires":[["2b9ba079.3cf79"]]},{"id":"2799bfa3.5f477","type":"function","z":"869324aa.5334b8","name":"Calculate chase effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 33554432);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1820,"y":1080,"wires":[["2b9ba079.3cf79"]]},{"id":"1f67c507.c495ab","type":"function","z":"869324aa.5334b8","name":"Calculate fast blink effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 50331648);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1830,"y":1120,"wires":[["2b9ba079.3cf79"]]},{"id":"8714a780.4e6e98","type":"function","z":"869324aa.5334b8","name":"Calculate slow blink effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 67108864);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1830,"y":1160,"wires":[["2b9ba079.3cf79"]]},{"id":"7e111dcd.465634","type":"function","z":"869324aa.5334b8","name":"Calculate fast fade effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 83886080);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1830,"y":1200,"wires":[["2b9ba079.3cf79"]]},{"id":"fb595c04.bddaf","type":"function","z":"869324aa.5334b8","name":"Calculate slow fade effect","func":"var colortype = parseInt(msg.color_type);\n\nmsg.type = {};\nmsg.type = parseInt(colortype + 100663296);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1830,"y":1240,"wires":[["2b9ba079.3cf79"]]},{"id":"7ab49600.7e78bc","type":"function","z":"869324aa.5334b8","name":"Throw effect error","func":"throw(\"Invalid Effect Set. Please choose either off, solid, chase, fast_blink, slow_blink, fast_fade, slow_fade, random_no_strobe, or random. You provided: \" + msg.payload.effect_type)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1810,"y":1360,"wires":[]},{"id":"717e53e1.b6378c","type":"change","z":"869324aa.5334b8","name":"Set msg.payload.effecttype","rules":[{"t":"set","p":"payload.effecttype","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.effecttype","pt":"msg","to":"effect_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":900,"y":1140,"wires":[["9d48d757.bab3f8"]]},{"id":"83312dd0.2a2f9","type":"change","z":"869324aa.5334b8","name":"Set Device ID","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"device_id","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":280,"wires":[["73307ac5.da4844"]]},{"id":"eb222972.3f0c98","type":"function","z":"869324aa.5334b8","name":"Calculate brightness","func":"var bright = parseInt(msg.payload.brightness);\n\nmsg.brightness = {};\nmsg.brightness = parseInt((32768 + bright * 256).toFixed(0));\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1880,"y":580,"wires":[["f6db6b85.e85438"]]},{"id":"75bf0824.aedff8","type":"function","z":"869324aa.5334b8","name":"Throw brightness error","func":"throw(\"Invalid Brightness Set. Please choose a value between 1 and 99, or random.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1880,"y":660,"wires":[]},{"id":"d4f39695.08fd88","type":"change","z":"869324aa.5334b8","name":"Set payload.brightness","rules":[{"t":"set","p":"payload.brightness","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.brightness","pt":"msg","to":"brightness_level","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":620,"wires":[["27a86473.43b83c"]]},{"id":"26e5c310.2b348c","type":"switch","z":"869324aa.5334b8","name":"Check if brightness is correct","property":"payload.brightness","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"99","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1620,"y":620,"wires":[["eb222972.3f0c98"],["1a90903c.333b3"],["75bf0824.aedff8"]]},{"id":"1a90903c.333b3","type":"function","z":"869324aa.5334b8","name":"Set random brightness","func":"var rand = Math.floor(Math.random() * 99) + 1;\n\nmsg.brightness = {};\nmsg.brightness = parseInt((32768 + rand * 256).toFixed(0));\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1880,"y":620,"wires":[["f6db6b85.e85438"]]},{"id":"19379c5.c7b6864","type":"function","z":"869324aa.5334b8","name":"Set random effect","func":"var setcolor = parseInt(msg.color_type);\nvar effect = ['solid', 'chase', 'fast_blink', 'slow_blink', 'fast_fade', 'slow_fade']; \nvar rand = effect[(Math.random() * effect.length) | 0]\n\nmsg.type = {};\n\nif (rand === 'solid') {\nmsg.type = parseInt(setcolor + 16777216);\nreturn msg;\n} \n\nelse if (rand === 'chase') {\nmsg.type = parseInt(setcolor + 33554432);\nreturn msg;\n} \n\nelse if (rand === 'fast_blink') {\nmsg.type = parseInt(setcolor + 50331648);\nreturn msg;\n} \n\nelse if (rand === 'slow_blink') {\nmsg.type = parseInt(setcolor + 67108864);\nreturn msg;\n} \n\nelse if (rand === 'fast_fade') {\nmsg.type = parseInt(setcolor + 83886080);\nreturn msg;\n} \n\nelse { //slow_fade\nmsg.type = parseInt(setcolor + 100663296);\nreturn msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1810,"y":1320,"wires":[["2b9ba079.3cf79"]]},{"id":"e4ec486c.ad6a78","type":"switch","z":"869324aa.5334b8","name":"Check the value of time","property":"payload.time","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"60","v2t":"num"},{"t":"empty"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":550,"y":860,"wires":[["a7efb46e.020268"],["d6bf9f81.8267c"],["7e31ac15.7424d4"],["915c49da.29fb78"]]},{"id":"915c49da.29fb78","type":"function","z":"869324aa.5334b8","name":"Throw time error","func":"throw(\"Invalid Time Set. Please choose a value between 1 and 60, a value of random, or leave time blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":800,"y":920,"wires":[]},{"id":"7e31ac15.7424d4","type":"function","z":"869324aa.5334b8","name":"Calculate a random time","func":"var rand = Math.floor(Math.random() * 60) + 1;\n\nmsg.timeamount = {};\nmsg.timeamount = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":880,"wires":[["dd814c34.0c86f"]]},{"id":"f6db6b85.e85438","type":"change","z":"869324aa.5334b8","name":"Set msg.payload.time","rules":[{"t":"set","p":"payload.time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.time","pt":"msg","to":"time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":2140,"y":600,"wires":[["8eea4d8a.0221a"]]},{"id":"484ef41b.324a8c","type":"function","z":"869324aa.5334b8","name":"Calculate a random time","func":"var timeunit = parseInt(msg.timeamount);\nvar measure = ['seconds', 'minutes', 'hours', 'forever']; \nvar rand = measure[(Math.random() * measure.length) | 0]\n\nmsg.totaltime = {};\n\nif (timeunit === 0){\nthrow(\"Please do not leave time blank if choosing a 'random' measure of time. Otherwise, change 'random' to 'forever' and then leave time blank.\")\nreturn msg;\n}\n\nelse if (rand === 'seconds') {\nmsg.totaltime = parseInt(65536 * (timeunit));\nreturn msg;\n} \n\nelse if (rand === 'minutes') {\nmsg.totaltime = parseInt(65536 * (timeunit + 60));\nreturn msg;\n} \n\nelse if (rand === 'hours') {\nmsg.totaltime = parseInt(65536 * (timeunit + 120));\nreturn msg;\n} \n\nelse { //forever\nmsg.totaltime = parseInt(16711680);\nreturn msg;\n} \n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":1220,"wires":[["717e53e1.b6378c"]]},{"id":"621536f4.002b18","type":"function","z":"869324aa.5334b8","name":"Calculate time for forever","func":"msg.totaltime = {};\nmsg.totaltime = parseInt(16711680);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":1180,"wires":[["717e53e1.b6378c"]]},{"id":"27a86473.43b83c","type":"function","z":"869324aa.5334b8","name":"Correct value for brightness if needed","func":"msg.payload.brightness = msg.payload.brightness.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1310,"y":620,"wires":[["26e5c310.2b348c"]]},{"id":"8eea4d8a.0221a","type":"function","z":"869324aa.5334b8","name":"Correct value for time if needed","func":"msg.payload.time = msg.payload.time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":270,"y":860,"wires":[["e4ec486c.ad6a78"]]},{"id":"9d48d757.bab3f8","type":"function","z":"869324aa.5334b8","name":"Correct value for effect type if needed","func":"msg.payload.effecttype = msg.payload.effecttype.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1210,"y":1140,"wires":[["f9993866.b5d218"]]},{"id":"d6bf9f81.8267c","type":"function","z":"869324aa.5334b8","name":"Set msg.timeamount to 0","func":"msg.timeamount = {};\nmsg.timeamount = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":840,"wires":[["dd814c34.0c86f"]]},{"id":"a7efb46e.020268","type":"function","z":"869324aa.5334b8","name":"Set msg.timeamount ","func":"var amount = parseInt(msg.payload.time);\n\nmsg.timeamount = {};\nmsg.timeamount = parseInt(amount);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":800,"wires":[["dd814c34.0c86f"]]},{"id":"dd814c34.0c86f","type":"change","z":"869324aa.5334b8","name":"Set msg.payload.timemeasure","rules":[{"t":"set","p":"payload.timemeasure","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.timemeasure","pt":"msg","to":"measure_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":840,"wires":[["efea1a6e.80d6f8"]]},{"id":"efea1a6e.80d6f8","type":"function","z":"869324aa.5334b8","name":"Correct value for time measure if needed","func":"msg.payload.timemeasure = msg.payload.timemeasure.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nvar measure = (msg.payload.timemeasure);\n\nif (measure === 'second'){\nmsg.payload.timemeasure = measure.replace(/second/g,'seconds');\nreturn msg;\n}\n\nelse if (measure === 'minute'){\nmsg.payload.timemeasure = measure.replace(/minute/g,'minutes');\nreturn msg;\n}\n\nelse if (measure === 'hour'){\nmsg.payload.timemeasure = measure.replace(/hour/g,'hours');\nreturn msg;\n}\n\nelse if (measure === 'infinite'){\nmsg.payload.timemeasure = measure.replace(/infinite/g,'forever');\nreturn msg;\n}\n\nelse {\nreturn msg;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1460,"y":840,"wires":[["e82d0685.5ae0c8"]]},{"id":"e82d0685.5ae0c8","type":"switch","z":"869324aa.5334b8","name":"Is the measurement of time forever?","property":"payload.timemeasure","propertyType":"msg","rules":[{"t":"eq","v":"forever","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1150,"y":920,"wires":[["6bdcd65d.2b9138"],["b836ba93.bcf5d8"]]},{"id":"6bdcd65d.2b9138","type":"function","z":"869324aa.5334b8","name":"Set msg.timeamount to 0","func":"msg.timeamount = {};\nmsg.timeamount = parseInt(0);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1510,"y":940,"wires":[["b836ba93.bcf5d8"]]},{"id":"2a0b4f12.eac28","type":"comment","z":"869324aa.5334b8","name":"Quick Strip Effect Calculation","info":"","x":900,"y":100,"wires":[]},{"id":"fee94ec7.71e8","type":"change","z":"869324aa.5334b8","name":"Set node ID","rules":[{"t":"set","p":"node","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"payload.attributes.node_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":440,"wires":[["f5715ca2.81ef2"]]},{"id":"5e566d28.bd7114","type":"ha-get-entities","z":"869324aa.5334b8","name":"Get all LED Strips","server":"497693ef.d5e6bc","version":0,"rules":[{"property":"entity_id","logic":"in_group","value":"group.inovelli_led_strips","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":430,"y":420,"wires":[["fe435cbd.fa1ad"]]},{"id":"fe435cbd.fa1ad","type":"split","z":"869324aa.5334b8","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":610,"y":420,"wires":[["cd476eda.d6d78"]]},{"id":"cd476eda.d6d78","type":"delay","z":"869324aa.5334b8","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"0.25","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":770,"y":420,"wires":[["69c965da.e96fec"]]},{"id":"c6c013eb.c1b06","type":"change","z":"869324aa.5334b8","name":"Set msg.singleorgroup","rules":[{"t":"set","p":"singleorgroup","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"singleorgroup","pt":"msg","to":"single_or_group","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":280,"wires":[["f04f5b4b.c3ef98"]]},{"id":"93557d32.10b66","type":"switch","z":"869324aa.5334b8","name":"Is this a single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1430,"y":280,"wires":[["83312dd0.2a2f9"],["5e566d28.bd7114"],["9ea4be43.db666"]]},{"id":"f04f5b4b.c3ef98","type":"function","z":"869324aa.5334b8","name":"Correct value for singleorgroup if needed","func":"msg.singleorgroup = msg.singleorgroup.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":280,"wires":[["159014ed.fe762b"]]},{"id":"159014ed.fe762b","type":"change","z":"869324aa.5334b8","name":"Set msg.zwave","rules":[{"t":"set","p":"zwave","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"zwave","pt":"msg","to":"zwave","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":280,"wires":[["aa89f09f.0311b"]]},{"id":"aa89f09f.0311b","type":"function","z":"869324aa.5334b8","name":"Correct value for zwave if needed","func":"msg.zwave = msg.zwave.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1120,"y":280,"wires":[["93557d32.10b66"]]},{"id":"9ea4be43.db666","type":"function","z":"869324aa.5334b8","name":"Throw node error","func":"throw(\"Invalid selection for single or group. Valid entries include either single, or group. You provided: \" + msg.singleorgroup)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1710,"y":220,"wires":[]},{"id":"73307ac5.da4844","type":"switch","z":"869324aa.5334b8","name":"Make sure there's a device defined","property":"node","propertyType":"msg","rules":[{"t":"istype","v":"string","vt":"string"},{"t":"btwn","v":"1","vt":"num","v2":"9999","v2t":"num"},{"t":"eq","v":"0","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":1960,"y":280,"wires":[["f5715ca2.81ef2"],["f5715ca2.81ef2"],["7c7c3b66.b113e4"],["7c7c3b66.b113e4"]]},{"id":"7c7c3b66.b113e4","type":"function","z":"869324aa.5334b8","name":"Throw device error","func":"throw(\"device_id cannot be 0 or blank if single_or_group is defined as single. Please either add in a device_id or change single_or_group to group and try again. Value provided was: \" + msg.node)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2230,"y":360,"wires":[]},{"id":"69c965da.e96fec","type":"switch","z":"869324aa.5334b8","name":"Which zwave instance?","property":"zwave","propertyType":"msg","rules":[{"t":"eq","v":"zwavejs","vt":"str"},{"t":"eq","v":"ozw","vt":"str"},{"t":"eq","v":"1.4","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":990,"y":420,"wires":[["551f8d33.1a7a84"],["fee94ec7.71e8"],["fee94ec7.71e8"]]},{"id":"551f8d33.1a7a84","type":"change","z":"869324aa.5334b8","name":"Set entity ID","rules":[{"t":"set","p":"node","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"payload.entity_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":400,"wires":[["f5715ca2.81ef2"]]},{"id":"f7e3f30f.c0bfc","type":"switch","z":"869324aa.5334b8","name":"Which zwave instance?","property":"zwave","propertyType":"msg","rules":[{"t":"eq","v":"zwavejs","vt":"str"},{"t":"eq","v":"ozw","vt":"str"},{"t":"eq","v":"1.4","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1090,"y":1500,"wires":[["cccc854e.508b28"],["8e9e2a68.e385b8"],["62be9fdb.4b3d1"]]},{"id":"cccc854e.508b28","type":"api-call-service","z":"869324aa.5334b8","name":"Set ZWaveJS Parameter 21","server":"497693ef.d5e6bc","version":3,"debugenabled":false,"service_domain":"zwave_js","service":"multicast_set_value","entityId":"","data":"{    \t    \"entity_id\": msg.node,\t    \"command_class\": 112,\t    \"endpoint\": 0,\t    \"property\": 21,    \t    \"value\": msg.calculation\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1380,"y":1460,"wires":[[]]},{"id":"62be9fdb.4b3d1","type":"api-call-service","z":"869324aa.5334b8","name":"Set ZWave 1.4 Parameter 21","server":"497693ef.d5e6bc","version":3,"debugenabled":false,"service_domain":"zwave","service":"set_config_parameter","entityId":"","data":"{\t   \"node_id\":msg.node,\t   \"parameter\":21,\t   \"value\":msg.calculation\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1380,"y":1540,"wires":[[]]},{"id":"0a17d24c1600634a","type":"function","z":"869324aa.5334b8","name":"Calculate random no strobe effect","func":"var setcolor = parseInt(msg.color_type);\nvar effect = ['solid', 'chase', 'slow_blink', 'fast_fade', 'slow_fade']; \nvar rand = effect[(Math.random() * effect.length) | 0]\n\nmsg.type = {};\n\nif (rand === 'solid') {\nmsg.type = parseInt(setcolor + 16777216);\nreturn msg;\n} \n\nelse if (rand === 'chase') {\nmsg.type = parseInt(setcolor + 33554432);\nreturn msg;\n} \n\nelse if (rand === 'slow_blink') {\nmsg.type = parseInt(setcolor + 67108864);\nreturn msg;\n} \n\nelse if (rand === 'fast_fade') {\nmsg.type = parseInt(setcolor + 83886080);\nreturn msg;\n} \n\nelse if (rand === 'slow_fade') { \nmsg.type = parseInt(setcolor + 100663296);\nreturn msg;\n}","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1860,"y":1280,"wires":[["2b9ba079.3cf79"]]},{"id":"497693ef.d5e6bc","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30},{"id":"f699c7379df218c0","type":"subflow:869324aa.5334b8","z":"f1e1b905.e9a56","name":"","x":1220,"y":1800,"wires":[[]]},{"id":"253ef5ed5a7f40b4","type":"inject","z":"f1e1b905.e9a56","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1000,"y":1800,"wires":[["f699c7379df218c0"]]}]