Node Red - Automate Inovelli Switch Parameter Calculations for ZWaveJS

Please find my subflow below. Been working on it for a little bit, and just finished converting it from OZW to ZWaveJS the other day. I hope other people find it useful! This can be used to set a notification for either a single switch or a group of switches if set up within a group titled: group.inovelli_switches.

It is also capable of setting the default/permanent color of the switch itself, and setting it’s on and off brightness level if desired.

Please note that while this subflow supports all Inovelli switches, it was designed for use primarily with Dimmers, and as such can only be guaranteed for them. LZW36 should be supported, but I don’t have one of those switches to confirm support. Additionally, while the On/Off switch is supported, it cannot be used to set notifications and only has limited support for setting the default/permanent color.

Additionally, while ZWaveJS now supports setting the notification parameter to a value above 83823359, node-red does not allow it for some reason. This translates to any effect defined to use pulse or breath will not work. I’ve added in a hardcoded node which changes any calculations above 83823359 to a red chase effect for 6 seconds. If/when support for values above 83823359 is added in, this work around can simply be deleted form the subflow. Until then, it allows the flow to be used without throwing any API errors :slight_smile:

This thing is kind of massive, please try to see the below screenshot:

And instead of completely word vomiting all over this specific post, I’ve decided to document the directions in google docs. Please find the link here: Inovelli Switch Calculator Directions - Google Docs

The actual subflow will be added to comment 2 as I’m sure it goes above character limits here haha…

If anyone has any questions, please feel free to let me know!

2 Likes

Subflow:

[{"id":"622f6fdc.53255","type":"subflow","name":"Inovelli Switch Colors","info":"","category":"","in":[{"x":180,"y":460,"wires":[{"id":"afd4ba78.36e738"}]}],"out":[{"x":1340,"y":460,"wires":[{"id":"24eba44b.be043c","port":0},{"id":"29484e6d.985c22","port":0},{"id":"67d291ec.e9f9c","port":0},{"id":"fa5d6adf.e2b278","port":0},{"id":"cc8df5bc.47d9c8","port":0},{"id":"3a671d8f.61fd52","port":0},{"id":"699fd353.e1e86c","port":0},{"id":"895f93f4.e4446","port":0},{"id":"5a546c17.129624","port":0},{"id":"9acc62e5.b9c1c","port":0},{"id":"cbae533c.14307","port":0},{"id":"96770017.8ff7c","port":0},{"id":"c6da46f4.03d3e8","port":0},{"id":"84349430.689418","port":0},{"id":"c39b55c0.257998","port":0},{"id":"3fc738af.17aa18","port":0},{"id":"d9e24a81.db4418","port":0},{"id":"9f680e18.5d04f","port":0},{"id":"136d361a.4ba82a","port":0},{"id":"43c62b5e.14f134","port":0}]}],"env":[{"name":"color","type":"str","value":""}],"color":"#DDBBCC"},{"id":"366c6b5d.5d62f4","type":"switch","z":"622f6fdc.53255","name":"Notification Color","property":"color","propertyType":"msg","rules":[{"t":"eq","v":"red","vt":"str"},{"t":"eq","v":"orange","vt":"str"},{"t":"eq","v":"gold","vt":"str"},{"t":"eq","v":"yellow","vt":"str"},{"t":"eq","v":"yellow_green","vt":"str"},{"t":"eq","v":"green","vt":"str"},{"t":"eq","v":"irish","vt":"str"},{"t":"eq","v":"spring_green","vt":"str"},{"t":"eq","v":"cyan","vt":"str"},{"t":"eq","v":"teal","vt":"str"},{"t":"eq","v":"azure","vt":"str"},{"t":"eq","v":"blue","vt":"str"},{"t":"eq","v":"light_purple","vt":"str"},{"t":"eq","v":"purple","vt":"str"},{"t":"eq","v":"violet","vt":"str"},{"t":"eq","v":"light_pink","vt":"str"},{"t":"eq","v":"pink","vt":"str"},{"t":"eq","v":"white","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"true_random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":21,"x":770,"y":460,"wires":[["24eba44b.be043c"],["29484e6d.985c22"],["9f680e18.5d04f"],["67d291ec.e9f9c"],["fa5d6adf.e2b278"],["cc8df5bc.47d9c8"],["136d361a.4ba82a"],["3a671d8f.61fd52"],["699fd353.e1e86c"],["895f93f4.e4446"],["d9e24a81.db4418"],["5a546c17.129624"],["3fc738af.17aa18"],["9acc62e5.b9c1c"],["43c62b5e.14f134"],["cbae533c.14307"],["96770017.8ff7c"],["c6da46f4.03d3e8"],["84349430.689418"],["c39b55c0.257998"],["14bbea53.6556f6"]]},{"id":"24eba44b.be043c","type":"change","z":"622f6fdc.53255","name":"Set Red","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":120,"wires":[[]]},{"id":"cc8df5bc.47d9c8","type":"change","z":"622f6fdc.53255","name":"Set Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"85","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":320,"wires":[[]]},{"id":"9acc62e5.b9c1c","type":"change","z":"622f6fdc.53255","name":"Set Purple","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"177","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":640,"wires":[[]]},{"id":"cbae533c.14307","type":"change","z":"622f6fdc.53255","name":"Set Light_Pink","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"220","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":680,"wires":[[]]},{"id":"5a546c17.129624","type":"change","z":"622f6fdc.53255","name":"Set Blue","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"170","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":560,"wires":[[]]},{"id":"67d291ec.e9f9c","type":"change","z":"622f6fdc.53255","name":"Set Yellow","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"42","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":240,"wires":[[]]},{"id":"14bbea53.6556f6","type":"function","z":"622f6fdc.53255","name":"Throw Color Error","func":"throw(\"Invalid Color Selected. Please choose either red, orange, yellow, yellow_green, green, cyan, teal, blue, purple, light_pink, pink, white, random or true_random. You provided: \" + msg.color)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1070,"y":920,"wires":[]},{"id":"895f93f4.e4446","type":"change","z":"622f6fdc.53255","name":"Set Teal","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"145","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":480,"wires":[[]]},{"id":"96770017.8ff7c","type":"change","z":"622f6fdc.53255","name":"Set Pink","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"234","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":760,"wires":[[]]},{"id":"29484e6d.985c22","type":"change","z":"622f6fdc.53255","name":"Set Orange","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"11","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":160,"wires":[[]]},{"id":"c6da46f4.03d3e8","type":"change","z":"622f6fdc.53255","name":"Set White","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"255","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":800,"wires":[[]]},{"id":"afd4ba78.36e738","type":"change","z":"622f6fdc.53255","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":320,"y":460,"wires":[["51e16179.42c08"]]},{"id":"3a671d8f.61fd52","type":"change","z":"622f6fdc.53255","name":"Set Spring_Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":400,"wires":[[]]},{"id":"fa5d6adf.e2b278","type":"change","z":"622f6fdc.53255","name":"Set Yellow_Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"65","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":280,"wires":[[]]},{"id":"699fd353.e1e86c","type":"change","z":"622f6fdc.53255","name":"Set Cyan","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"127","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":440,"wires":[[]]},{"id":"84349430.689418","type":"function","z":"622f6fdc.53255","name":"Set Random Color","func":"var color = ['0', '11', '28', '42', '65', '85', '95', '110', '127', '145', '164', '170', '177', '195', '212', '220', '234', '255']; \nvar rand = color[(Math.random() * color.length) | 0]\n\nmsg.color_number = {};\nmsg.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1070,"y":840,"wires":[[]]},{"id":"51e16179.42c08","type":"function","z":"622f6fdc.53255","name":"Correct value for color","func":"msg.color = msg.color.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":460,"wires":[["366c6b5d.5d62f4"]]},{"id":"7b266d5e.6cbf74","type":"comment","z":"622f6fdc.53255","name":"Inovelli Switch Colors","info":"","x":440,"y":220,"wires":[]},{"id":"c39b55c0.257998","type":"function","z":"622f6fdc.53255","name":"Set True_Random Color","func":"var rand = Math.floor(Math.random() * 255) + 1;\n\nmsg.color_number = {};\nmsg.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1090,"y":880,"wires":[[]]},{"id":"3fc738af.17aa18","type":"change","z":"622f6fdc.53255","name":"Set Light_Purple","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"195","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":600,"wires":[[]]},{"id":"9f680e18.5d04f","type":"change","z":"622f6fdc.53255","name":"Set Gold","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"28","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":200,"wires":[[]]},{"id":"d9e24a81.db4418","type":"change","z":"622f6fdc.53255","name":"Set Azure","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"164","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":520,"wires":[[]]},{"id":"136d361a.4ba82a","type":"change","z":"622f6fdc.53255","name":"Set Irish","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"95","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":360,"wires":[[]]},{"id":"43c62b5e.14f134","type":"change","z":"622f6fdc.53255","name":"Set Violet","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"212","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":720,"wires":[[]]},{"id":"ced394cd.07a138","type":"subflow","name":"Inovelli Switch Effect Calculator ZwaveJS","info":"Use this Subflow to calculate a notification for either a single entity id or a group of entities within a group titled **group.inovelli_switches**.\n\nAdditionally, this subflow can be used to define a permanent color in place of the solid blue color (170).\n\nLastly, this can also set the on and off brightness of the switch.\n\nFull directions provided in the below link: https://docs.google.com/document/d/1QPAO0wZgsBvZ5d8yD3xoDUpZX2YorPeEuY-Loz3mcRI/edit?usp=sharing","category":"","in":[{"x":280,"y":400,"wires":[{"id":"387f188b.b8e878"}]}],"out":[{"x":3240,"y":2720,"wires":[{"id":"280109e1.7dd616","port":0},{"id":"dccff49c.686cf8","port":0},{"id":"7b15da79.7a5874","port":0},{"id":"d56c5d09.c3c6e","port":0},{"id":"c688ddb9.ac587","port":0},{"id":"cbff6a4d.ab1e98","port":0}]}],"env":[{"name":"single_or_group","type":"str","value":"single"},{"name":"device_id","type":"str","value":"light.under_deck_light_level"},{"name":"is_permanent","type":"str","value":"no"},{"name":"switch_type","type":"str","value":"dimmer"},{"name":"color_name","type":"str","value":"red"},{"name":"brightness","type":"str","value":"10"},{"name":"total_time","type":"str","value":"5"},{"name":"measure_time","type":"str","value":"seconds"},{"name":"effect","type":"str","value":"breath"},{"name":"off_brightness","type":"str","value":""},{"name":"on_brightness","type":"str","value":""}],"color":"#789123","status":{"x":300,"y":220,"wires":[{"id":"5b1abf00.e5c32","port":0}]}},{"id":"5b1abf00.e5c32","type":"status","z":"ced394cd.07a138","name":"","scope":null,"x":180,"y":220,"wires":[[]]},{"id":"6b7bedfd.f99d94","type":"switch","z":"ced394cd.07a138","name":"Make sure there's a color","property":"color_name","propertyType":"env","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":1080,"wires":[["343233db.d0313c"],["762c608d.24285"]]},{"id":"762c608d.24285","type":"subflow:622f6fdc.53255","z":"ced394cd.07a138","name":"","env":[],"x":520,"y":1100,"wires":[["e9b0ba4a.df14b8"]]},{"id":"4cd2d8a3.bde3e8","type":"switch","z":"ced394cd.07a138","name":"What is the brightness value","property":"brightness","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1740,"y":720,"wires":[["f0565f95.619f4"],["70383bf1.4b7384"],["3c82e100.cfedae"]]},{"id":"f0565f95.619f4","type":"function","z":"ced394cd.07a138","name":"Extract Brightness Value","func":"var light = parseInt(msg.brightness);\n\nmsg.bright = {};\nmsg.bright = parseInt(light);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2010,"y":680,"wires":[["6b7bedfd.f99d94"]]},{"id":"3c82e100.cfedae","type":"function","z":"ced394cd.07a138","name":"Throw brightness error","func":"throw(\"Invalid Brightness Selected. Brightness cannot be blank and must be between 1 and 10. You selected: \" + msg.brightness)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2000,"y":760,"wires":[]},{"id":"e9b0ba4a.df14b8","type":"change","z":"ced394cd.07a138","name":"Set msg.color","rules":[{"t":"set","p":"color","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"color_number","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":1100,"wires":[["4ed0e38e.d53aac"]]},{"id":"ca30863e.3b3f18","type":"change","z":"ced394cd.07a138","name":"Set msg.brightness","rules":[{"t":"set","p":"brightness","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"brightness","pt":"msg","to":"brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":720,"wires":[["adbba3a4.23c03"]]},{"id":"ff1489b9.2a33e8","type":"switch","z":"ced394cd.07a138","name":"What is the measure of time?","property":"measure_time","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":2080,"y":1520,"wires":[["8d94f9c3.13a1e8"],["9ae8430.cbb0bc"],["1765a727.a7cbf9"],["c63d35b2.25f678"],["98f8c9ca.731868"],["5d04df19.5b454"]]},{"id":"93d0dd4e.55bfe","type":"change","z":"ced394cd.07a138","name":"set msg.total_time","rules":[{"t":"set","p":"total_time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"total_time","pt":"msg","to":"total_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":1520,"wires":[["c28d364a.c4d0c8"]]},{"id":"8d94f9c3.13a1e8","type":"function","z":"ced394cd.07a138","name":"Calculate for Seconds","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\nmsg.time = parseInt(amount);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1400,"wires":[["c66288ba.effca8"]]},{"id":"9ae8430.cbb0bc","type":"function","z":"ced394cd.07a138","name":"Calculate for Minutes","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\n\nif (amount === '1')\n{\n    msg.time = parseInt(amount * 60);\n}\n\nelse\n{\n    msg.time = parseInt(amount + 60);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1440,"wires":[["c66288ba.effca8"]]},{"id":"1765a727.a7cbf9","type":"function","z":"ced394cd.07a138","name":"Calculate for Hours","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\n\nif (amount === '1')\n{\n    msg.time = parseInt(amount * 120);\n}\n\nelse\n{\n    msg.time = parseInt(amount + 120);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2350,"y":1480,"wires":[["c66288ba.effca8"]]},{"id":"c63d35b2.25f678","type":"function","z":"ced394cd.07a138","name":"Calculate for Forever","func":"msg.time = {};\nmsg.time = parseInt(255);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1520,"wires":[["c66288ba.effca8"]]},{"id":"5d04df19.5b454","type":"function","z":"ced394cd.07a138","name":"Throw time error","func":"throw(\"Invalid Measure of Time Selected. Valid entries inlude seconds, minutes, hours, or forever. You supplied: \" + msg.measure_time)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2340,"y":1600,"wires":[]},{"id":"c66288ba.effca8","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":230,"y":2220,"wires":[["78f7d2f.52d912c"],["56c0899b.f666e8"],["56c0899b.f666e8"],["56c0899b.f666e8"],["48812b47.28b2c4"]]},{"id":"56c0899b.f666e8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to LED Strip Effect","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Strip Effect","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":2220,"wires":[["ff608c9a.bbf18"]]},{"id":"78f7d2f.52d912c","type":"change","z":"ced394cd.07a138","name":"Set Parameter to LED Strip Effect (Color)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Strip Effect (Color)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":2180,"wires":[["ff608c9a.bbf18"]]},{"id":"48812b47.28b2c4","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":510,"y":2260,"wires":[]},{"id":"ff608c9a.bbf18","type":"change","z":"ced394cd.07a138","name":"Set msg.effect","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"effect","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":2180,"wires":[["14c351bc.5747ae"]]},{"id":"7040998f.d28a98","type":"switch","z":"ced394cd.07a138","name":"Which effect was defined?","property":"effect","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":"blink","vt":"str"},{"t":"eq","v":"pulse","vt":"str"},{"t":"eq","v":"breath","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":1710,"y":2020,"wires":[["fc5a2e0b.2d172"],["5a3101a2.1857e"],["ee3c7827.057288"],["658a2d88.5d1814"],["8e39fc30.452ca"],["8e39fc30.452ca"],["737c2d32.2b9694"],["737c2d32.2b9694"],["e5ff5c32.53818"],["36266957.96bf46"]]},{"id":"5a3101a2.1857e","type":"change","z":"ced394cd.07a138","name":"Set effect to 1","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1920,"wires":[["4a754925.93f358"]]},{"id":"fc5a2e0b.2d172","type":"change","z":"ced394cd.07a138","name":"Set effect to 0","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1880,"wires":[["4a754925.93f358"]]},{"id":"658a2d88.5d1814","type":"change","z":"ced394cd.07a138","name":"Set effect to 3","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2000,"wires":[["4a754925.93f358"]]},{"id":"8e39fc30.452ca","type":"change","z":"ced394cd.07a138","name":"Set effect to 4","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2040,"wires":[["4a754925.93f358"]]},{"id":"737c2d32.2b9694","type":"change","z":"ced394cd.07a138","name":"Set effect to 5","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"5","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2080,"wires":[["4a754925.93f358"]]},{"id":"ee3c7827.057288","type":"change","z":"ced394cd.07a138","name":"Set effect to 2","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1960,"wires":[["4a754925.93f358"]]},{"id":"36266957.96bf46","type":"function","z":"ced394cd.07a138","name":"Throw effect error","func":"throw(\"Invalid Effect Listed. Valid choices for effects include off, solid, chase, fast_blink, slow_blink, blink, pulse, or breath. You selected: \" + msg.effect)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2160,"wires":[]},{"id":"4a754925.93f358","type":"function","z":"ced394cd.07a138","name":"Calculate Parameter Effect","func":"var colorchoice = parseInt(msg.color);\nvar timeamount = parseInt(msg.time);\nvar bright = parseInt(msg.bright);\nvar effectchoice = parseInt(msg.effect);\n\nmsg.calculation = {};\nmsg.calculation = parseInt((colorchoice) + (bright * 256) + (timeamount * 65536) + (effectchoice * 16777216))\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2740,"y":2200,"wires":[["33a5bd96.8e5782"]]},{"id":"adbba3a4.23c03","type":"function","z":"ced394cd.07a138","name":"Correct value for brightness if needed","func":"msg.brightness = msg.brightness.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1430,"y":720,"wires":[["4cd2d8a3.bde3e8"]]},{"id":"c28d364a.c4d0c8","type":"function","z":"ced394cd.07a138","name":"Correct value for total_time if needed","func":"msg.total_time = msg.total_time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":550,"y":1520,"wires":[["beedc17a.35662"]]},{"id":"bf806ca.915109","type":"function","z":"ced394cd.07a138","name":"Correct value for measure_time if needed","func":"msg.measure_time = msg.measure_time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1160,"y":1520,"wires":[["a605b835.d530b8"]]},{"id":"14c351bc.5747ae","type":"function","z":"ced394cd.07a138","name":"Correct value for effect if needed","func":"msg.effect = msg.effect.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":2180,"wires":[["2d152983.12d8b6"]]},{"id":"70383bf1.4b7384","type":"function","z":"ced394cd.07a138","name":"Set random brightness","func":"var rand = Math.floor(Math.random() * 10) + 1;\n\nmsg.bright = {};\nmsg.bright = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2000,"y":720,"wires":[["6b7bedfd.f99d94"]]},{"id":"cc804692.070ae8","type":"comment","z":"ced394cd.07a138","name":"Define if Single Device or Group","info":"","x":950,"y":320,"wires":[]},{"id":"a605b835.d530b8","type":"switch","z":"ced394cd.07a138","name":"Check if time is valid","property":"total_time","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"255","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"forever","vt":"str"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":1460,"y":1520,"wires":[["ff1489b9.2a33e8"],["641b2be0.2e6764"],["ff1489b9.2a33e8"],["9237fb11.fe9548"],["a412519d.8b225"]]},{"id":"a412519d.8b225","type":"function","z":"ced394cd.07a138","name":"Throw time error","func":"throw(\"Invalid Time Defined. Time must be between 1 and 255, or blank if measure of time is forever. You supplied: \" + msg.total_time)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1700,"y":1640,"wires":[]},{"id":"beedc17a.35662","type":"change","z":"ced394cd.07a138","name":"Set msg.measure_time","rules":[{"t":"set","p":"measure_time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"measure_time","pt":"msg","to":"measure_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":1520,"wires":[["bf806ca.915109"]]},{"id":"9237fb11.fe9548","type":"switch","z":"ced394cd.07a138","name":"Is measure_time forever?","property":"measure_time","propertyType":"msg","rules":[{"t":"eq","v":"forever","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1750,"y":1580,"wires":[["ff1489b9.2a33e8"],["19e5d46b.660abc"]]},{"id":"19e5d46b.660abc","type":"function","z":"ced394cd.07a138","name":"Throw time error","func":"throw(\"Time can only be blank if measure_time is set to forever. Please define a value for total_time or change measure_time to forever and try again.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1960,"y":1640,"wires":[]},{"id":"641b2be0.2e6764","type":"function","z":"ced394cd.07a138","name":"Set random time","func":"var rand = Math.floor(Math.random() * 255) + 1;\n\nmsg.total_time = {};\nmsg.total_time = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1700,"y":1460,"wires":[["ff1489b9.2a33e8"]]},{"id":"98f8c9ca.731868","type":"function","z":"ced394cd.07a138","name":"Calculate for Random","func":"var rand = parseInt(msg.total_time)\n\nmsg.time = {};\nmsg.time = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1560,"wires":[["c66288ba.effca8"]]},{"id":"e5ff5c32.53818","type":"function","z":"ced394cd.07a138","name":"Set random effect","func":"var rand = Math.floor(Math.random() * 5) + 1;\n\nmsg.effect = {};\nmsg.effect = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2120,"wires":[["4a754925.93f358"]]},{"id":"387f188b.b8e878","type":"change","z":"ced394cd.07a138","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":440,"y":400,"wires":[["48c115b1.a1cdcc"]]},{"id":"3cfa6e8f.ecce52","type":"switch","z":"ced394cd.07a138","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":1090,"y":400,"wires":[["4b16dd5f.e88624"],["d763fdc8.f1ebf"],["ac4e743d.fcec78"]]},{"id":"ac4e743d.fcec78","type":"function","z":"ced394cd.07a138","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":1470,"y":500,"wires":[]},{"id":"48c115b1.a1cdcc","type":"function","z":"ced394cd.07a138","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":740,"y":400,"wires":[["3cfa6e8f.ecce52"]]},{"id":"4b16dd5f.e88624","type":"change","z":"ced394cd.07a138","name":"Set device ID","rules":[{"t":"set","p":"node","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"device_id","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":320,"wires":[["b55ed425.618328"]]},{"id":"78119ef8.149e2","type":"change","z":"ced394cd.07a138","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":1930,"y":400,"wires":[["3993c503.2a334a","ce2b44ff.566188"]]},{"id":"d763fdc8.f1ebf","type":"ha-get-entities","z":"ced394cd.07a138","server":"497693ef.d5e6bc","name":"Get all Inovelli switches","rules":[{"property":"entity_id","logic":"in_group","value":"group.inovelli_switches","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":1390,"y":400,"wires":[["548017f8.8fc668"]]},{"id":"548017f8.8fc668","type":"split","z":"ced394cd.07a138","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1590,"y":400,"wires":[["36b39b6b.69adc4"]]},{"id":"36b39b6b.69adc4","type":"delay","z":"ced394cd.07a138","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"0.25","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1750,"y":400,"wires":[["78119ef8.149e2"]]},{"id":"cc4fff5d.2c35a","type":"function","z":"ced394cd.07a138","name":"Throw permanence error","func":"throw(\"Invalid selection for is_permanent. Valid entries are yes (permanent change) or no (this is a notification). You provided: \" + msg.ispermanent)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1170,"y":780,"wires":[]},{"id":"e83f8a25.9ee728","type":"switch","z":"ced394cd.07a138","name":"Is this change permanent?","property":"ispermanent","propertyType":"msg","rules":[{"t":"eq","v":"no","vt":"str"},{"t":"eq","v":"yes","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":900,"y":740,"wires":[["ca30863e.3b3f18"],["6b7bedfd.f99d94"],["cc4fff5d.2c35a"]]},{"id":"dccff49c.686cf8","type":"join","z":"ced394cd.07a138","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":2950,"y":2540,"wires":[[]]},{"id":"280109e1.7dd616","type":"switch","z":"ced394cd.07a138","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":2920,"y":2460,"wires":[[],["dccff49c.686cf8"]]},{"id":"208ad7a9.681698","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":2090,"y":1100,"wires":[["f7f6c719.08b8a8"],["f7f6c719.08b8a8"],["652d0e43.7d5dd"],["652d0e43.7d5dd"],["7e3465a4.fee7dc"]]},{"id":"f7f6c719.08b8a8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to LED Indicator Color","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Indicator Color","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2430,"y":1080,"wires":[["f55f6e2a.9a6e"]]},{"id":"7e3465a4.fee7dc","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2370,"y":1180,"wires":[]},{"id":"4ed0e38e.d53aac","type":"change","z":"ced394cd.07a138","name":"Set Switch Type","rules":[{"t":"set","p":"switch","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"switch","pt":"msg","to":"switch_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":1100,"wires":[["aec81b3c.aa42c8"]]},{"id":"aec81b3c.aa42c8","type":"function","z":"ced394cd.07a138","name":"Correct value for switch if needed","func":"msg.switch = msg.switch.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":1100,"wires":[["4bfc94ec.ec9a5c"]]},{"id":"f55f6e2a.9a6e","type":"change","z":"ced394cd.07a138","name":"Set msg.calculation","rules":[{"t":"set","p":"calculation","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"calculation","pt":"msg","to":"color","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2770,"y":1080,"wires":[["190b03a.0f6b4fc"]]},{"id":"28fb6ee7.af7092","type":"change","z":"ced394cd.07a138","name":"Set msg.offbright","rules":[{"t":"set","p":"offbright","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"offbright","pt":"msg","to":"off_brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":2740,"wires":[["eed01666.fa20c8"]]},{"id":"eed01666.fa20c8","type":"function","z":"ced394cd.07a138","name":"Correct value for offbright if needed","func":"msg.offbright = msg.offbright.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1240,"y":2740,"wires":[["c0ea2e78.2a6c8"]]},{"id":"8c493c95.38053","type":"change","z":"ced394cd.07a138","name":"Set msg.onbright","rules":[{"t":"set","p":"onbright","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"onbright","pt":"msg","to":"on_brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":2840,"wires":[["7756c42c.28689c"]]},{"id":"7756c42c.28689c","type":"function","z":"ced394cd.07a138","name":"Correct value for onbright if needed","func":"msg.onbright = msg.onbright.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1240,"y":2840,"wires":[["bd5bac16.10df9"]]},{"id":"c0ea2e78.2a6c8","type":"switch","z":"ced394cd.07a138","name":"Is off_brightness between 1 and 10?","property":"offbright","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1570,"y":2740,"wires":[["b2779d18.d9991"],[],["13288cce.42ac03"]]},{"id":"bd5bac16.10df9","type":"switch","z":"ced394cd.07a138","name":"Is on_brightness between 1 and 10?","property":"onbright","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1570,"y":2840,"wires":[["e4042d15.e3fac"],[],["68f11a70.274fb4"]]},{"id":"cbff6a4d.ab1e98","type":"join","z":"ced394cd.07a138","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":2950,"y":2940,"wires":[[]]},{"id":"7b15da79.7a5874","type":"switch","z":"ced394cd.07a138","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":2900,"y":2700,"wires":[[],["d56c5d09.c3c6e"]]},{"id":"c688ddb9.ac587","type":"switch","z":"ced394cd.07a138","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":2900,"y":2860,"wires":[[],["cbff6a4d.ab1e98"]]},{"id":"b2779d18.d9991","type":"switch","z":"ced394cd.07a138","name":"Is there a switch defined?","property":"switch","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1890,"y":2720,"wires":[["fda28d12.be4d3"],["385c0b27.521f24"]]},{"id":"385c0b27.521f24","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2760,"wires":[]},{"id":"e4042d15.e3fac","type":"switch","z":"ced394cd.07a138","name":"Is there a switch defined?","property":"switch","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1890,"y":2840,"wires":[["a2f806fd.9da5a8"],["fbab1076.c7166"]]},{"id":"a2f806fd.9da5a8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to LED Indicator Intensity","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Indicator Intensity","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2240,"y":2840,"wires":[["fa33dfb6.6358c"]]},{"id":"fbab1076.c7166","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2880,"wires":[]},{"id":"652d0e43.7d5dd","type":"function","z":"ced394cd.07a138","name":"Set Parameter LED Indicator Color to Calculation","func":"var hue = parseInt(msg.color);\n\nmsg.parameter = {};\nmsg.parameter = \"LED Indicator Color\";\n\nmsg.calculation = {};\nmsg.calculation = parseInt(hue / 255 * 350);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2470,"y":1120,"wires":[["190b03a.0f6b4fc"]]},{"id":"3993c503.2a334a","type":"change","z":"ced394cd.07a138","name":"Set Switch Type","rules":[{"t":"set","p":"switch","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"switch","pt":"msg","to":"switch_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":2780,"wires":[["4c119950.cea458"]]},{"id":"4c119950.cea458","type":"function","z":"ced394cd.07a138","name":"Correct value for switch if needed","func":"msg.switch = msg.switch.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":700,"y":2780,"wires":[["28fb6ee7.af7092","8c493c95.38053"]]},{"id":"13288cce.42ac03","type":"function","z":"ced394cd.07a138","name":"Throw offbright error","func":"throw(\"Invalid Off Brightness Defined. Value must be between 1 and 10, or blank. You supplied: \" + msg.offbright)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1880,"y":2760,"wires":[]},{"id":"68f11a70.274fb4","type":"function","z":"ced394cd.07a138","name":"Throw onbright error","func":"throw(\"Invalid On Brightness Defined. Value must be between 1 and 10, or blank. You supplied: \" + msg.onbright)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1880,"y":2880,"wires":[]},{"id":"d56c5d09.c3c6e","type":"join","z":"ced394cd.07a138","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":2950,"y":2780,"wires":[[]]},{"id":"d4bdbb6f.224108","type":"function","z":"ced394cd.07a138","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":1950,"y":320,"wires":[]},{"id":"61de5933.0f9dd8","type":"comment","z":"ced394cd.07a138","name":"On/Off Brightness Set","info":"","x":1540,"y":2620,"wires":[]},{"id":"a597a01b.bdfe3","type":"comment","z":"ced394cd.07a138","name":"Set Permanent Color","info":"","x":2340,"y":980,"wires":[]},{"id":"190b03a.0f6b4fc","type":"api-call-service","z":"ced394cd.07a138","name":"Set ZWaveJS Notification","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"","data":"{    \t    \"entity_id\": msg.node,\t    \"parameter\": msg.parameter,    \t    \"value\": msg.calculation\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":2650,"y":2460,"wires":[["280109e1.7dd616"]]},{"id":"2d152983.12d8b6","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"eq","v":"switch","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1430,"y":2180,"wires":[["7040998f.d28a98"],["7040998f.d28a98"],["7040998f.d28a98"],["fa221846.cfe7c8"]]},{"id":"a3ffebf5.ed6b58","type":"function","z":"ced394cd.07a138","name":"Throw chase effect error","func":"throw(\"Switches cannot use the Chase effect. Please define another effect and try again.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2190,"y":2520,"wires":[]},{"id":"fa221846.cfe7c8","type":"switch","z":"ced394cd.07a138","name":"Which effect was defined?","property":"effect","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"solid","vt":"str"},{"t":"eq","v":"fast_blink","vt":"str"},{"t":"eq","v":"slow_blink","vt":"str"},{"t":"eq","v":"blink","vt":"str"},{"t":"eq","v":"pulse","vt":"str"},{"t":"eq","v":"breath","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"chase","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":1710,"y":2400,"wires":[["82695a04.b00148"],["7a523732.1cf438"],["36311aa4.228166"],["fe852e0d.7df8d"],["fe852e0d.7df8d"],["8d12b5e4.70ec88"],["8d12b5e4.70ec88"],["69273ae6.26f3f4"],["a3ffebf5.ed6b58"],[]]},{"id":"7a523732.1cf438","type":"change","z":"ced394cd.07a138","name":"Set effect to 1","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2320,"wires":[["4a754925.93f358"]]},{"id":"82695a04.b00148","type":"change","z":"ced394cd.07a138","name":"Set effect to 0","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2280,"wires":[["4a754925.93f358"]]},{"id":"fe852e0d.7df8d","type":"change","z":"ced394cd.07a138","name":"Set effect to 3","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2400,"wires":[["4a754925.93f358"]]},{"id":"8d12b5e4.70ec88","type":"change","z":"ced394cd.07a138","name":"Set effect to 4","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2440,"wires":[["4a754925.93f358"]]},{"id":"69273ae6.26f3f4","type":"function","z":"ced394cd.07a138","name":"Set random effect","func":"var rand = Math.floor(Math.random() * 5) + 1;\n\nmsg.effect = {};\nmsg.effect = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2480,"wires":[["4a754925.93f358"]]},{"id":"bd14b20a.9cd69","type":"comment","z":"ced394cd.07a138","name":"Define Effect On/Off Switch","info":"","x":1710,"y":2260,"wires":[]},{"id":"56a85fe6.70732","type":"comment","z":"ced394cd.07a138","name":"Define Effect All Other Switches","info":"","x":1710,"y":1880,"wires":[]},{"id":"36311aa4.228166","type":"change","z":"ced394cd.07a138","name":"Set effect to 2","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2360,"wires":[["4a754925.93f358"]]},{"id":"fb0be354.bad6c","type":"comment","z":"ced394cd.07a138","name":"Define Time","info":"","x":1250,"y":1380,"wires":[]},{"id":"870f1804.cbbb58","type":"comment","z":"ced394cd.07a138","name":"Define Brightness","info":"","x":1490,"y":640,"wires":[]},{"id":"7c075f15.51bfc","type":"comment","z":"ced394cd.07a138","name":"Define Color","info":"","x":1390,"y":1000,"wires":[]},{"id":"cd542bce.675398","type":"comment","z":"ced394cd.07a138","name":"Define Notification Parameter","info":"","x":580,"y":1960,"wires":[]},{"id":"abe01825.67c988","type":"api-call-service","z":"ced394cd.07a138","name":"Set ZWaveJS Notification","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"","data":"{    \t    \"entity_id\": msg.node,\t    \"parameter\": msg.parameter,    \t    \"value\": msg.offbright\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":2630,"y":2720,"wires":[["7b15da79.7a5874"]]},{"id":"fa33dfb6.6358c","type":"api-call-service","z":"ced394cd.07a138","name":"Set ZWaveJS Notification","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"","data":"{    \t    \"entity_id\": msg.node,\t    \"parameter\": msg.parameter,    \t    \"value\": msg.onbright\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":2630,"y":2840,"wires":[["c688ddb9.ac587"]]},{"id":"33a5bd96.8e5782","type":"switch","z":"ced394cd.07a138","name":"Is calculation over 83823359?","property":"calculation","propertyType":"msg","rules":[{"t":"gt","v":"83823359","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":3430,"y":2200,"wires":[["8d2aa72a.eca988"],["190b03a.0f6b4fc"]]},{"id":"8d2aa72a.eca988","type":"change","z":"ced394cd.07a138","name":"Change to red chase 6 seconds","rules":[{"t":"set","p":"calculation","pt":"msg","to":"33950208","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":3750,"y":2200,"wires":[["190b03a.0f6b4fc"]]},{"id":"fda28d12.be4d3","type":"change","z":"ced394cd.07a138","name":"Set Parameter to LED Indicator Intensity (When Off)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Indicator Intensity (When Off)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2270,"y":2720,"wires":[["abe01825.67c988"]]},{"id":"65efe18b.f81a8","type":"comment","z":"ced394cd.07a138","name":"**Temporary work around for API error concerning values over 83823359, delete when no longer needed**","info":"","x":3600,"y":2100,"wires":[]},{"id":"5816bfbc.f4a31","type":"comment","z":"ced394cd.07a138","name":"Main Calculation","info":"","x":2740,"y":2100,"wires":[]},{"id":"b55ed425.618328","type":"switch","z":"ced394cd.07a138","name":"Make sure there's a device defined","property":"node","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1600,"y":320,"wires":[["3993c503.2a334a","ce2b44ff.566188"],["d4bdbb6f.224108"]]},{"id":"343233db.d0313c","type":"function","z":"ced394cd.07a138","name":"Throw color error","func":"throw(\"Invalid Color Selected. Color cannot be blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":510,"y":1040,"wires":[]},{"id":"f9b0a5d0.3d69c8","type":"function","z":"ced394cd.07a138","name":"Correct value for ispermanent if needed","func":"msg.ispermanent = msg.ispermanent.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":740,"wires":[["e83f8a25.9ee728"]]},{"id":"ce2b44ff.566188","type":"change","z":"ced394cd.07a138","name":"Set msg.ispermanent","rules":[{"t":"set","p":"ispermanent","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"ispermanent","pt":"msg","to":"is_permanent","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":740,"wires":[["f9b0a5d0.3d69c8"]]},{"id":"e1c997bd.a509e8","type":"comment","z":"ced394cd.07a138","name":"Check if permanent or not","info":"","x":730,"y":640,"wires":[]},{"id":"4bfc94ec.ec9a5c","type":"switch","z":"ced394cd.07a138","name":"Is this change permanent?","property":"ispermanent","propertyType":"msg","rules":[{"t":"eq","v":"yes","vt":"str"},{"t":"eq","v":"no","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1500,"y":1100,"wires":[["208ad7a9.681698"],["93d0dd4e.55bfe"],["a27f8ab5.11ef28"]]},{"id":"a27f8ab5.11ef28","type":"function","z":"ced394cd.07a138","name":"Throw permanence error","func":"throw(\"Invalid selection for is_permanent. Valid entries are yes (permanent change) or no (this is a notification). You provided: \" + msg.ispermanent)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1750,"y":1160,"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":"13bab4c7.a1200b","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":600,"y":320,"wires":[["cf6a1b00.b7ddc8"]]},{"id":"35ab03ad.71e6dc","type":"debug","z":"f1e1b905.e9a56","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1110,"y":320,"wires":[]},{"id":"cf6a1b00.b7ddc8","type":"subflow:ced394cd.07a138","z":"f1e1b905.e9a56","name":"","x":860,"y":320,"wires":[["35ab03ad.71e6dc"]]}]
1 Like

@harmfulmushroom Have you updated this subflow since posting? I’m getting an error when trying to set a notification.

The set notification node is still using set_config_parameter instead of the new bulk_set_partial_config_parameters. I’m working on a fix.

1 Like

I have not worked on this guy since I originally released it actually. Thanks for taking a look at it! I’m going to be out of town until the weekend so I won’t be able to test it or work on it until then. I’m happy to take a look once I’m back in town though!

1 Like

Hey @stu1811, I actually can’t replicate the issue you’re receiving. Can you try importing this subflow to see if that fixes it on your end?

[{"id":"622f6fdc.53255","type":"subflow","name":"Inovelli Switch Colors","info":"","category":"","in":[{"x":180,"y":460,"wires":[{"id":"afd4ba78.36e738"}]}],"out":[{"x":1340,"y":460,"wires":[{"id":"24eba44b.be043c","port":0},{"id":"29484e6d.985c22","port":0},{"id":"67d291ec.e9f9c","port":0},{"id":"fa5d6adf.e2b278","port":0},{"id":"cc8df5bc.47d9c8","port":0},{"id":"3a671d8f.61fd52","port":0},{"id":"699fd353.e1e86c","port":0},{"id":"895f93f4.e4446","port":0},{"id":"5a546c17.129624","port":0},{"id":"9acc62e5.b9c1c","port":0},{"id":"cbae533c.14307","port":0},{"id":"96770017.8ff7c","port":0},{"id":"c6da46f4.03d3e8","port":0},{"id":"84349430.689418","port":0},{"id":"c39b55c0.257998","port":0},{"id":"3fc738af.17aa18","port":0},{"id":"d9e24a81.db4418","port":0},{"id":"9f680e18.5d04f","port":0},{"id":"136d361a.4ba82a","port":0},{"id":"43c62b5e.14f134","port":0}]}],"env":[{"name":"color","type":"str","value":""}],"color":"#DDBBCC"},{"id":"366c6b5d.5d62f4","type":"switch","z":"622f6fdc.53255","name":"Notification Color","property":"color","propertyType":"msg","rules":[{"t":"eq","v":"red","vt":"str"},{"t":"eq","v":"orange","vt":"str"},{"t":"eq","v":"gold","vt":"str"},{"t":"eq","v":"yellow","vt":"str"},{"t":"eq","v":"yellow_green","vt":"str"},{"t":"eq","v":"green","vt":"str"},{"t":"eq","v":"irish","vt":"str"},{"t":"eq","v":"spring_green","vt":"str"},{"t":"eq","v":"cyan","vt":"str"},{"t":"eq","v":"teal","vt":"str"},{"t":"eq","v":"azure","vt":"str"},{"t":"eq","v":"blue","vt":"str"},{"t":"eq","v":"light_purple","vt":"str"},{"t":"eq","v":"purple","vt":"str"},{"t":"eq","v":"violet","vt":"str"},{"t":"eq","v":"light_pink","vt":"str"},{"t":"eq","v":"pink","vt":"str"},{"t":"eq","v":"white","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"true_random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":21,"x":770,"y":460,"wires":[["24eba44b.be043c"],["29484e6d.985c22"],["9f680e18.5d04f"],["67d291ec.e9f9c"],["fa5d6adf.e2b278"],["cc8df5bc.47d9c8"],["136d361a.4ba82a"],["3a671d8f.61fd52"],["699fd353.e1e86c"],["895f93f4.e4446"],["d9e24a81.db4418"],["5a546c17.129624"],["3fc738af.17aa18"],["9acc62e5.b9c1c"],["43c62b5e.14f134"],["cbae533c.14307"],["96770017.8ff7c"],["c6da46f4.03d3e8"],["84349430.689418"],["c39b55c0.257998"],["14bbea53.6556f6"]]},{"id":"24eba44b.be043c","type":"change","z":"622f6fdc.53255","name":"Set Red","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":120,"wires":[[]]},{"id":"cc8df5bc.47d9c8","type":"change","z":"622f6fdc.53255","name":"Set Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"85","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":320,"wires":[[]]},{"id":"9acc62e5.b9c1c","type":"change","z":"622f6fdc.53255","name":"Set Purple","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"177","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":640,"wires":[[]]},{"id":"cbae533c.14307","type":"change","z":"622f6fdc.53255","name":"Set Light_Pink","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"220","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":680,"wires":[[]]},{"id":"5a546c17.129624","type":"change","z":"622f6fdc.53255","name":"Set Blue","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"170","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":560,"wires":[[]]},{"id":"67d291ec.e9f9c","type":"change","z":"622f6fdc.53255","name":"Set Yellow","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"42","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":240,"wires":[[]]},{"id":"14bbea53.6556f6","type":"function","z":"622f6fdc.53255","name":"Throw Color Error","func":"throw(\"Invalid Color Selected. Please choose either red, orange, yellow, yellow_green, green, cyan, teal, blue, purple, light_pink, pink, white, random or true_random. You provided: \" + msg.color)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1070,"y":920,"wires":[]},{"id":"895f93f4.e4446","type":"change","z":"622f6fdc.53255","name":"Set Teal","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"145","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":480,"wires":[[]]},{"id":"96770017.8ff7c","type":"change","z":"622f6fdc.53255","name":"Set Pink","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"234","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":760,"wires":[[]]},{"id":"29484e6d.985c22","type":"change","z":"622f6fdc.53255","name":"Set Orange","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"11","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":160,"wires":[[]]},{"id":"c6da46f4.03d3e8","type":"change","z":"622f6fdc.53255","name":"Set White","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"255","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":800,"wires":[[]]},{"id":"afd4ba78.36e738","type":"change","z":"622f6fdc.53255","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":320,"y":460,"wires":[["51e16179.42c08"]]},{"id":"3a671d8f.61fd52","type":"change","z":"622f6fdc.53255","name":"Set Spring_Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":400,"wires":[[]]},{"id":"fa5d6adf.e2b278","type":"change","z":"622f6fdc.53255","name":"Set Yellow_Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"65","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":280,"wires":[[]]},{"id":"699fd353.e1e86c","type":"change","z":"622f6fdc.53255","name":"Set Cyan","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"127","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":440,"wires":[[]]},{"id":"84349430.689418","type":"function","z":"622f6fdc.53255","name":"Set Random Color","func":"var color = ['0', '11', '28', '42', '65', '85', '95', '110', '127', '145', '164', '170', '177', '195', '212', '220', '234', '255']; \nvar rand = color[(Math.random() * color.length) | 0]\n\nmsg.color_number = {};\nmsg.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1070,"y":840,"wires":[[]]},{"id":"51e16179.42c08","type":"function","z":"622f6fdc.53255","name":"Correct value for color","func":"msg.color = msg.color.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":460,"wires":[["366c6b5d.5d62f4"]]},{"id":"7b266d5e.6cbf74","type":"comment","z":"622f6fdc.53255","name":"Inovelli Switch Colors","info":"","x":440,"y":220,"wires":[]},{"id":"c39b55c0.257998","type":"function","z":"622f6fdc.53255","name":"Set True_Random Color","func":"var rand = Math.floor(Math.random() * 255) + 1;\n\nmsg.color_number = {};\nmsg.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1090,"y":880,"wires":[[]]},{"id":"3fc738af.17aa18","type":"change","z":"622f6fdc.53255","name":"Set Light_Purple","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"195","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":600,"wires":[[]]},{"id":"9f680e18.5d04f","type":"change","z":"622f6fdc.53255","name":"Set Gold","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"28","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":200,"wires":[[]]},{"id":"d9e24a81.db4418","type":"change","z":"622f6fdc.53255","name":"Set Azure","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"164","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":520,"wires":[[]]},{"id":"136d361a.4ba82a","type":"change","z":"622f6fdc.53255","name":"Set Irish","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"95","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":360,"wires":[[]]},{"id":"43c62b5e.14f134","type":"change","z":"622f6fdc.53255","name":"Set Violet","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"212","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":720,"wires":[[]]},{"id":"ced394cd.07a138","type":"subflow","name":"Inovelli Switch Effect Calculator ZwaveJS","info":"Use this Subflow to calculate a notification for either a single entity id or a group of entities within a group titled **group.inovelli_switches**.\n\nAdditionally, this subflow can be used to define a permanent color in place of the solid blue color (170).\n\nLastly, this can also set the on and off brightness of the switch.\n\nFull directions provided in the below link: https://docs.google.com/document/d/1QPAO0wZgsBvZ5d8yD3xoDUpZX2YorPeEuY-Loz3mcRI/edit?usp=sharing","category":"","in":[{"x":280,"y":400,"wires":[{"id":"387f188b.b8e878"}]}],"out":[{"x":3480,"y":2660,"wires":[{"id":"280109e1.7dd616","port":0},{"id":"dccff49c.686cf8","port":0},{"id":"7b15da79.7a5874","port":0},{"id":"d56c5d09.c3c6e","port":0},{"id":"c688ddb9.ac587","port":0},{"id":"cbff6a4d.ab1e98","port":0}]}],"env":[{"name":"single_or_group","type":"str","value":"single"},{"name":"device_id","type":"str","value":"light.under_deck_light_level"},{"name":"is_permanent","type":"str","value":"no"},{"name":"switch_type","type":"str","value":"dimmer"},{"name":"color_name","type":"str","value":"red"},{"name":"brightness","type":"str","value":"10"},{"name":"total_time","type":"str","value":"5"},{"name":"measure_time","type":"str","value":"seconds"},{"name":"effect","type":"str","value":"breath"},{"name":"off_brightness","type":"str","value":""},{"name":"on_brightness","type":"str","value":""}],"color":"#789123","status":{"x":300,"y":220,"wires":[{"id":"5b1abf00.e5c32","port":0}]}},{"id":"5b1abf00.e5c32","type":"status","z":"ced394cd.07a138","name":"","scope":null,"x":180,"y":220,"wires":[[]]},{"id":"6b7bedfd.f99d94","type":"switch","z":"ced394cd.07a138","name":"Make sure there's a color","property":"color_name","propertyType":"env","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":1080,"wires":[["343233db.d0313c"],["762c608d.24285"]]},{"id":"762c608d.24285","type":"subflow:622f6fdc.53255","z":"ced394cd.07a138","name":"","env":[],"x":520,"y":1100,"wires":[["e9b0ba4a.df14b8"]]},{"id":"4cd2d8a3.bde3e8","type":"switch","z":"ced394cd.07a138","name":"What is the brightness value","property":"brightness","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1740,"y":720,"wires":[["f0565f95.619f4"],["70383bf1.4b7384"],["3c82e100.cfedae"]]},{"id":"f0565f95.619f4","type":"function","z":"ced394cd.07a138","name":"Extract Brightness Value","func":"var light = parseInt(msg.brightness);\n\nmsg.bright = {};\nmsg.bright = parseInt(light);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2010,"y":680,"wires":[["6b7bedfd.f99d94"]]},{"id":"3c82e100.cfedae","type":"function","z":"ced394cd.07a138","name":"Throw brightness error","func":"throw(\"Invalid Brightness Selected. Brightness cannot be blank and must be between 1 and 10. You selected: \" + msg.brightness)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2000,"y":760,"wires":[]},{"id":"e9b0ba4a.df14b8","type":"change","z":"ced394cd.07a138","name":"Set msg.color","rules":[{"t":"set","p":"color","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"color_number","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":1100,"wires":[["4ed0e38e.d53aac"]]},{"id":"ca30863e.3b3f18","type":"change","z":"ced394cd.07a138","name":"Set msg.brightness","rules":[{"t":"set","p":"brightness","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"brightness","pt":"msg","to":"brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":720,"wires":[["adbba3a4.23c03"]]},{"id":"ff1489b9.2a33e8","type":"switch","z":"ced394cd.07a138","name":"What is the measure of time?","property":"measure_time","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":2100,"y":1440,"wires":[["8d94f9c3.13a1e8"],["9ae8430.cbb0bc"],["1765a727.a7cbf9"],["c63d35b2.25f678"],["98f8c9ca.731868"],["5d04df19.5b454"]]},{"id":"93d0dd4e.55bfe","type":"change","z":"ced394cd.07a138","name":"set msg.total_time","rules":[{"t":"set","p":"total_time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"total_time","pt":"msg","to":"total_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":1440,"wires":[["c28d364a.c4d0c8"]]},{"id":"8d94f9c3.13a1e8","type":"function","z":"ced394cd.07a138","name":"Calculate for Seconds","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\nmsg.time = parseInt(amount);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2380,"y":1320,"wires":[["c66288ba.effca8"]]},{"id":"9ae8430.cbb0bc","type":"function","z":"ced394cd.07a138","name":"Calculate for Minutes","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\n\nif (amount === 1)\n{\n    msg.time = parseInt(amount * 60);\n}\n\nelse\n{\n    msg.time = parseInt(amount + 60);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2380,"y":1360,"wires":[["c66288ba.effca8"]]},{"id":"1765a727.a7cbf9","type":"function","z":"ced394cd.07a138","name":"Calculate for Hours","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\n\nif (amount === 1)\n{\n    msg.time = parseInt(amount * 120);\n}\n\nelse\n{\n    msg.time = parseInt(amount + 120);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2370,"y":1400,"wires":[["c66288ba.effca8"]]},{"id":"c63d35b2.25f678","type":"function","z":"ced394cd.07a138","name":"Calculate for Forever","func":"msg.time = {};\nmsg.time = parseInt(255);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2380,"y":1440,"wires":[["c66288ba.effca8"]]},{"id":"5d04df19.5b454","type":"function","z":"ced394cd.07a138","name":"Throw time error","func":"throw(\"Invalid Measure of Time Selected. Valid entries inlude seconds, minutes, hours, or forever. You supplied: \" + msg.measure_time)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1520,"wires":[]},{"id":"c66288ba.effca8","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":230,"y":2160,"wires":[["78f7d2f.52d912c"],["56c0899b.f666e8"],["fc9836f9.fe0f28"],["a1bb956f.4b7528"],["48812b47.28b2c4"]]},{"id":"56c0899b.f666e8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 16 (dimmer)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"16","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":2120,"wires":[["ff608c9a.bbf18"]]},{"id":"78f7d2f.52d912c","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 8 (switch)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"8","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":2080,"wires":[["ff608c9a.bbf18"]]},{"id":"48812b47.28b2c4","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":510,"y":2240,"wires":[]},{"id":"ff608c9a.bbf18","type":"change","z":"ced394cd.07a138","name":"Set msg.effect","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"effect","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":2120,"wires":[["14c351bc.5747ae"]]},{"id":"7040998f.d28a98","type":"switch","z":"ced394cd.07a138","name":"Which effect was defined?","property":"effect","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":"blink","vt":"str"},{"t":"eq","v":"pulse","vt":"str"},{"t":"eq","v":"breath","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":1710,"y":1960,"wires":[["fc5a2e0b.2d172"],["5a3101a2.1857e"],["ee3c7827.057288"],["658a2d88.5d1814"],["8e39fc30.452ca"],["8e39fc30.452ca"],["737c2d32.2b9694"],["737c2d32.2b9694"],["e5ff5c32.53818"],["36266957.96bf46"]]},{"id":"5a3101a2.1857e","type":"change","z":"ced394cd.07a138","name":"Set effect to 1","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1860,"wires":[["4a754925.93f358"]]},{"id":"fc5a2e0b.2d172","type":"change","z":"ced394cd.07a138","name":"Set effect to 0","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1820,"wires":[["4a754925.93f358"]]},{"id":"658a2d88.5d1814","type":"change","z":"ced394cd.07a138","name":"Set effect to 3","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1940,"wires":[["4a754925.93f358"]]},{"id":"8e39fc30.452ca","type":"change","z":"ced394cd.07a138","name":"Set effect to 4","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1980,"wires":[["4a754925.93f358"]]},{"id":"737c2d32.2b9694","type":"change","z":"ced394cd.07a138","name":"Set effect to 5","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"5","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2020,"wires":[["4a754925.93f358"]]},{"id":"ee3c7827.057288","type":"change","z":"ced394cd.07a138","name":"Set effect to 2","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1900,"wires":[["4a754925.93f358"]]},{"id":"36266957.96bf46","type":"function","z":"ced394cd.07a138","name":"Throw effect error","func":"throw(\"Invalid Effect Listed. Valid choices for effects include off, solid, chase, fast_blink, slow_blink, blink, pulse, or breath. You selected: \" + msg.effect)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2100,"wires":[]},{"id":"4a754925.93f358","type":"function","z":"ced394cd.07a138","name":"Calculate Parameter Effect","func":"var colorchoice = parseInt(msg.color);\nvar timeamount = parseInt(msg.time);\nvar bright = parseInt(msg.bright);\nvar effectchoice = parseInt(msg.effect);\n\nmsg.calculation = {};\nmsg.calculation = parseInt((colorchoice) + (bright * 256) + (timeamount * 65536) + (effectchoice * 16777216))\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2580,"y":2140,"wires":[["190b03a.0f6b4fc"]]},{"id":"adbba3a4.23c03","type":"function","z":"ced394cd.07a138","name":"Correct value for brightness if needed","func":"msg.brightness = msg.brightness.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1430,"y":720,"wires":[["4cd2d8a3.bde3e8"]]},{"id":"c28d364a.c4d0c8","type":"function","z":"ced394cd.07a138","name":"Correct value for total_time if needed","func":"msg.total_time = msg.total_time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":570,"y":1440,"wires":[["beedc17a.35662"]]},{"id":"bf806ca.915109","type":"function","z":"ced394cd.07a138","name":"Correct value for measure_time if needed","func":"msg.measure_time = msg.measure_time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1180,"y":1440,"wires":[["a605b835.d530b8"]]},{"id":"14c351bc.5747ae","type":"function","z":"ced394cd.07a138","name":"Correct value for effect if needed","func":"msg.effect = msg.effect.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":2120,"wires":[["2d152983.12d8b6"]]},{"id":"70383bf1.4b7384","type":"function","z":"ced394cd.07a138","name":"Set random brightness","func":"var rand = Math.floor(Math.random() * 10) + 1;\n\nmsg.bright = {};\nmsg.bright = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2000,"y":720,"wires":[["6b7bedfd.f99d94"]]},{"id":"cc804692.070ae8","type":"comment","z":"ced394cd.07a138","name":"Define if Single Device or Group","info":"","x":950,"y":320,"wires":[]},{"id":"a605b835.d530b8","type":"switch","z":"ced394cd.07a138","name":"Check if time is valid","property":"total_time","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"255","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"forever","vt":"str"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":1480,"y":1440,"wires":[["ff1489b9.2a33e8"],["641b2be0.2e6764"],["ff1489b9.2a33e8"],["9237fb11.fe9548"],["a412519d.8b225"]]},{"id":"a412519d.8b225","type":"function","z":"ced394cd.07a138","name":"Throw time error","func":"throw(\"Invalid Time Defined. Time must be between 1 and 255, or blank if measure of time is forever. You supplied: \" + msg.total_time)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1720,"y":1560,"wires":[]},{"id":"beedc17a.35662","type":"change","z":"ced394cd.07a138","name":"Set msg.measure_time","rules":[{"t":"set","p":"measure_time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"measure_time","pt":"msg","to":"measure_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":1440,"wires":[["bf806ca.915109"]]},{"id":"9237fb11.fe9548","type":"switch","z":"ced394cd.07a138","name":"Is measure_time forever?","property":"measure_time","propertyType":"msg","rules":[{"t":"eq","v":"forever","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1770,"y":1500,"wires":[["ff1489b9.2a33e8"],["19e5d46b.660abc"]]},{"id":"19e5d46b.660abc","type":"function","z":"ced394cd.07a138","name":"Throw time error","func":"throw(\"Time can only be blank if measure_time is set to forever. Please define a value for total_time or change measure_time to forever and try again.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1980,"y":1560,"wires":[]},{"id":"641b2be0.2e6764","type":"function","z":"ced394cd.07a138","name":"Set random time","func":"var rand = Math.floor(Math.random() * 255) + 1;\n\nmsg.total_time = {};\nmsg.total_time = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1720,"y":1380,"wires":[["ff1489b9.2a33e8"]]},{"id":"98f8c9ca.731868","type":"function","z":"ced394cd.07a138","name":"Calculate for Random","func":"var rand = parseInt(msg.total_time)\n\nmsg.time = {};\nmsg.time = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2380,"y":1480,"wires":[["c66288ba.effca8"]]},{"id":"e5ff5c32.53818","type":"function","z":"ced394cd.07a138","name":"Set random effect","func":"var rand = Math.floor(Math.random() * 5) + 1;\n\nmsg.effect = {};\nmsg.effect = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2060,"wires":[["4a754925.93f358"]]},{"id":"387f188b.b8e878","type":"change","z":"ced394cd.07a138","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":440,"y":400,"wires":[["48c115b1.a1cdcc"]]},{"id":"3cfa6e8f.ecce52","type":"switch","z":"ced394cd.07a138","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":1090,"y":400,"wires":[["4b16dd5f.e88624"],["d763fdc8.f1ebf"],["ac4e743d.fcec78"]]},{"id":"ac4e743d.fcec78","type":"function","z":"ced394cd.07a138","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":1370,"y":480,"wires":[]},{"id":"48c115b1.a1cdcc","type":"function","z":"ced394cd.07a138","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":740,"y":400,"wires":[["3cfa6e8f.ecce52"]]},{"id":"4b16dd5f.e88624","type":"change","z":"ced394cd.07a138","name":"Set device ID","rules":[{"t":"set","p":"node","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"device_id","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":320,"wires":[["b55ed425.618328"]]},{"id":"78119ef8.149e2","type":"change","z":"ced394cd.07a138","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":1930,"y":400,"wires":[["3993c503.2a334a","ce2b44ff.566188"]]},{"id":"d763fdc8.f1ebf","type":"ha-get-entities","z":"ced394cd.07a138","name":"Get all Inovelli switches","server":"497693ef.d5e6bc","version":0,"rules":[{"property":"entity_id","logic":"in_group","value":"group.inovelli_switches","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":1390,"y":400,"wires":[["548017f8.8fc668"]]},{"id":"548017f8.8fc668","type":"split","z":"ced394cd.07a138","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1590,"y":400,"wires":[["36b39b6b.69adc4"]]},{"id":"36b39b6b.69adc4","type":"delay","z":"ced394cd.07a138","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"0.01","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1750,"y":400,"wires":[["78119ef8.149e2"]]},{"id":"cc4fff5d.2c35a","type":"function","z":"ced394cd.07a138","name":"Throw permanence error","func":"throw(\"Invalid selection for is_permanent. Valid entries are yes (permanent change) or no (this is a notification). You provided: \" + msg.ispermanent)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1170,"y":780,"wires":[]},{"id":"e83f8a25.9ee728","type":"switch","z":"ced394cd.07a138","name":"Is this change permanent?","property":"ispermanent","propertyType":"msg","rules":[{"t":"eq","v":"no","vt":"str"},{"t":"eq","v":"yes","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":900,"y":740,"wires":[["ca30863e.3b3f18"],["6b7bedfd.f99d94"],["cc4fff5d.2c35a"]]},{"id":"dccff49c.686cf8","type":"join","z":"ced394cd.07a138","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":3170,"y":2220,"wires":[[]]},{"id":"280109e1.7dd616","type":"switch","z":"ced394cd.07a138","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":3140,"y":2140,"wires":[[],["dccff49c.686cf8"]]},{"id":"208ad7a9.681698","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":2090,"y":1100,"wires":[["f7f6c719.08b8a8"],["a5241186.7274d"],["652d0e43.7d5dd"],["5397edc9.817994"],["7e3465a4.fee7dc"]]},{"id":"f7f6c719.08b8a8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 13 (dimmer)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"13","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2410,"y":1000,"wires":[["f55f6e2a.9a6e"]]},{"id":"7e3465a4.fee7dc","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2370,"y":1200,"wires":[]},{"id":"4ed0e38e.d53aac","type":"change","z":"ced394cd.07a138","name":"Set Switch Type","rules":[{"t":"set","p":"switch","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"switch","pt":"msg","to":"switch_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":1100,"wires":[["aec81b3c.aa42c8"]]},{"id":"aec81b3c.aa42c8","type":"function","z":"ced394cd.07a138","name":"Correct value for switch if needed","func":"msg.switch = msg.switch.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":1100,"wires":[["4bfc94ec.ec9a5c"]]},{"id":"f55f6e2a.9a6e","type":"change","z":"ced394cd.07a138","name":"Set msg.calculation","rules":[{"t":"set","p":"calculation","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"calculation","pt":"msg","to":"color","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2650,"y":1080,"wires":[["190b03a.0f6b4fc"]]},{"id":"28fb6ee7.af7092","type":"change","z":"ced394cd.07a138","name":"Set msg.offbright","rules":[{"t":"set","p":"offbright","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"offbright","pt":"msg","to":"off_brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":2840,"wires":[["eed01666.fa20c8"]]},{"id":"eed01666.fa20c8","type":"function","z":"ced394cd.07a138","name":"Correct value for offbright if needed","func":"msg.offbright = msg.offbright.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":2840,"wires":[["c0ea2e78.2a6c8"]]},{"id":"8c493c95.38053","type":"change","z":"ced394cd.07a138","name":"Set msg.onbright","rules":[{"t":"set","p":"onbright","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"onbright","pt":"msg","to":"on_brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":2600,"wires":[["7756c42c.28689c"]]},{"id":"7756c42c.28689c","type":"function","z":"ced394cd.07a138","name":"Correct value for onbright if needed","func":"msg.onbright = msg.onbright.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":2600,"wires":[["bd5bac16.10df9"]]},{"id":"c0ea2e78.2a6c8","type":"switch","z":"ced394cd.07a138","name":"Is off_brightness between 1 and 10?","property":"offbright","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1590,"y":2840,"wires":[["35b081c6.950bee"],[],["13288cce.42ac03"]]},{"id":"bd5bac16.10df9","type":"switch","z":"ced394cd.07a138","name":"Is on_brightness between 1 and 10?","property":"onbright","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1590,"y":2600,"wires":[["824dbf13.5af8e"],[],["68f11a70.274fb4"]]},{"id":"cbff6a4d.ab1e98","type":"join","z":"ced394cd.07a138","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":3190,"y":2700,"wires":[[]]},{"id":"7b15da79.7a5874","type":"switch","z":"ced394cd.07a138","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":3160,"y":2800,"wires":[[],["d56c5d09.c3c6e"]]},{"id":"c688ddb9.ac587","type":"switch","z":"ced394cd.07a138","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":3140,"y":2620,"wires":[[],["cbff6a4d.ab1e98"]]},{"id":"385c0b27.521f24","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1990,"y":2920,"wires":[]},{"id":"a2f806fd.9da5a8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 19 (combo_light)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"19","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2360,"y":2600,"wires":[["fa33dfb6.6358c"]]},{"id":"fbab1076.c7166","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1970,"y":2680,"wires":[]},{"id":"652d0e43.7d5dd","type":"function","z":"ced394cd.07a138","name":"Set Parameter 18 to Calculation (combo_light)","func":"var hue = parseInt(msg.color);\n\nmsg.parameter = {};\nmsg.parameter = 18;\n\nmsg.calculation = {};\nmsg.calculation = parseInt(hue / 255 * 350);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2460,"y":1120,"wires":[["190b03a.0f6b4fc"]]},{"id":"3993c503.2a334a","type":"change","z":"ced394cd.07a138","name":"Set Switch Type","rules":[{"t":"set","p":"switch","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"switch","pt":"msg","to":"switch_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":2660,"wires":[["4c119950.cea458"]]},{"id":"4c119950.cea458","type":"function","z":"ced394cd.07a138","name":"Correct value for switch if needed","func":"msg.switch = msg.switch.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":700,"y":2660,"wires":[["28fb6ee7.af7092","8c493c95.38053"]]},{"id":"13288cce.42ac03","type":"function","z":"ced394cd.07a138","name":"Throw offbright error","func":"throw(\"Invalid Off Brightness Defined. Value must be between 1 and 10, or blank. You supplied: \" + msg.offbright)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1640,"y":2900,"wires":[]},{"id":"68f11a70.274fb4","type":"function","z":"ced394cd.07a138","name":"Throw onbright error","func":"throw(\"Invalid On Brightness Defined. Value must be between 1 and 10, or blank. You supplied: \" + msg.onbright)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1640,"y":2660,"wires":[]},{"id":"d56c5d09.c3c6e","type":"join","z":"ced394cd.07a138","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":3210,"y":2880,"wires":[[]]},{"id":"d4bdbb6f.224108","type":"function","z":"ced394cd.07a138","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":1950,"y":320,"wires":[]},{"id":"61de5933.0f9dd8","type":"comment","z":"ced394cd.07a138","name":"On/Off Brightness Set","info":"","x":1540,"y":2500,"wires":[]},{"id":"a597a01b.bdfe3","type":"comment","z":"ced394cd.07a138","name":"Set Permanent Color","info":"","x":2340,"y":880,"wires":[]},{"id":"190b03a.0f6b4fc","type":"api-call-service","z":"ced394cd.07a138","name":"Set ZWaveJS Notification","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\": msg.parameter,    \t    \"value\": msg.calculation\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2870,"y":2140,"wires":[["280109e1.7dd616"]]},{"id":"2d152983.12d8b6","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"eq","v":"switch","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1430,"y":2120,"wires":[["7040998f.d28a98"],["7040998f.d28a98"],["7040998f.d28a98"],["fa221846.cfe7c8"]]},{"id":"a3ffebf5.ed6b58","type":"function","z":"ced394cd.07a138","name":"Throw chase effect error","func":"throw(\"Switches cannot use the Chase effect. Please define another effect and try again.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2190,"y":2400,"wires":[]},{"id":"fa221846.cfe7c8","type":"switch","z":"ced394cd.07a138","name":"Which effect was defined?","property":"effect","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"solid","vt":"str"},{"t":"eq","v":"fast_blink","vt":"str"},{"t":"eq","v":"slow_blink","vt":"str"},{"t":"eq","v":"blink","vt":"str"},{"t":"eq","v":"pulse","vt":"str"},{"t":"eq","v":"breath","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"chase","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":1710,"y":2280,"wires":[["82695a04.b00148"],["7a523732.1cf438"],["36311aa4.228166"],["fe852e0d.7df8d"],["fe852e0d.7df8d"],["8d12b5e4.70ec88"],["8d12b5e4.70ec88"],["69273ae6.26f3f4"],["a3ffebf5.ed6b58"],[]]},{"id":"7a523732.1cf438","type":"change","z":"ced394cd.07a138","name":"Set effect to 1","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2200,"wires":[["4a754925.93f358"]]},{"id":"82695a04.b00148","type":"change","z":"ced394cd.07a138","name":"Set effect to 0","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2160,"wires":[["4a754925.93f358"]]},{"id":"fe852e0d.7df8d","type":"change","z":"ced394cd.07a138","name":"Set effect to 3","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2280,"wires":[["4a754925.93f358"]]},{"id":"8d12b5e4.70ec88","type":"change","z":"ced394cd.07a138","name":"Set effect to 4","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2320,"wires":[["4a754925.93f358"]]},{"id":"69273ae6.26f3f4","type":"function","z":"ced394cd.07a138","name":"Set random effect","func":"var rand = Math.floor(Math.random() * 5) + 1;\n\nmsg.effect = {};\nmsg.effect = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2360,"wires":[["4a754925.93f358"]]},{"id":"bd14b20a.9cd69","type":"comment","z":"ced394cd.07a138","name":"Define Effect On/Off Switch","info":"","x":1710,"y":2140,"wires":[]},{"id":"56a85fe6.70732","type":"comment","z":"ced394cd.07a138","name":"Define Effect All Other Switches","info":"","x":1710,"y":1820,"wires":[]},{"id":"36311aa4.228166","type":"change","z":"ced394cd.07a138","name":"Set effect to 2","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2240,"wires":[["4a754925.93f358"]]},{"id":"fb0be354.bad6c","type":"comment","z":"ced394cd.07a138","name":"Define Time","info":"","x":1270,"y":1300,"wires":[]},{"id":"870f1804.cbbb58","type":"comment","z":"ced394cd.07a138","name":"Define Brightness","info":"","x":1490,"y":640,"wires":[]},{"id":"7c075f15.51bfc","type":"comment","z":"ced394cd.07a138","name":"Define Color","info":"","x":1390,"y":1000,"wires":[]},{"id":"cd542bce.675398","type":"comment","z":"ced394cd.07a138","name":"Define Notification Parameter","info":"","x":580,"y":1900,"wires":[]},{"id":"abe01825.67c988","type":"api-call-service","z":"ced394cd.07a138","name":"Set ZWaveJS Notification","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\": msg.parameter,    \t    \"value\": msg.offbright\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2890,"y":2820,"wires":[["7b15da79.7a5874"]]},{"id":"fa33dfb6.6358c","type":"api-call-service","z":"ced394cd.07a138","name":"Set ZWaveJS Notification","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\": msg.parameter,    \t    \"value\": msg.onbright\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2870,"y":2600,"wires":[["c688ddb9.ac587"]]},{"id":"fda28d12.be4d3","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 22 (combo_light)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"22","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2360,"y":2840,"wires":[["abe01825.67c988"]]},{"id":"5816bfbc.f4a31","type":"comment","z":"ced394cd.07a138","name":"Main Calculation","info":"","x":2560,"y":2040,"wires":[]},{"id":"b55ed425.618328","type":"switch","z":"ced394cd.07a138","name":"Make sure there's a device defined","property":"node","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1600,"y":320,"wires":[["3993c503.2a334a","ce2b44ff.566188"],["d4bdbb6f.224108"]]},{"id":"343233db.d0313c","type":"function","z":"ced394cd.07a138","name":"Throw color error","func":"throw(\"Invalid Color Selected. Color cannot be blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":510,"y":1040,"wires":[]},{"id":"f9b0a5d0.3d69c8","type":"function","z":"ced394cd.07a138","name":"Correct value for ispermanent if needed","func":"msg.ispermanent = msg.ispermanent.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":740,"wires":[["e83f8a25.9ee728"]]},{"id":"ce2b44ff.566188","type":"change","z":"ced394cd.07a138","name":"Set msg.ispermanent","rules":[{"t":"set","p":"ispermanent","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"ispermanent","pt":"msg","to":"is_permanent","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":740,"wires":[["f9b0a5d0.3d69c8"]]},{"id":"e1c997bd.a509e8","type":"comment","z":"ced394cd.07a138","name":"Check if permanent or not","info":"","x":730,"y":640,"wires":[]},{"id":"4bfc94ec.ec9a5c","type":"switch","z":"ced394cd.07a138","name":"Is this change permanent?","property":"ispermanent","propertyType":"msg","rules":[{"t":"eq","v":"yes","vt":"str"},{"t":"eq","v":"no","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1500,"y":1100,"wires":[["208ad7a9.681698"],["93d0dd4e.55bfe"],["a27f8ab5.11ef28"]]},{"id":"a27f8ab5.11ef28","type":"function","z":"ced394cd.07a138","name":"Throw permanence error","func":"throw(\"Invalid selection for is_permanent. Valid entries are yes (permanent change) or no (this is a notification). You provided: \" + msg.ispermanent)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1750,"y":1160,"wires":[]},{"id":"a5241186.7274d","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 5 (switch)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"5","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":1040,"wires":[["f55f6e2a.9a6e"]]},{"id":"35b081c6.950bee","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":1950,"y":2840,"wires":[["92d23623.63edf8"],["f1d1beb0.cfe7a"],["fda28d12.be4d3"],["109b9bf9.7b6e14"],["385c0b27.521f24"]]},{"id":"824dbf13.5af8e","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":1930,"y":2600,"wires":[["b0108f40.b9254"],["f679017f.03cdc"],["a2f806fd.9da5a8"],["dba05209.17825"],["fbab1076.c7166"]]},{"id":"5397edc9.817994","type":"function","z":"ced394cd.07a138","name":"Set Parameter 20 to Calculation (combo_fan)","func":"var hue = parseInt(msg.color);\n\nmsg.parameter = {};\nmsg.parameter = 20;\n\nmsg.calculation = {};\nmsg.calculation = parseInt(hue / 255 * 350);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2450,"y":1160,"wires":[["190b03a.0f6b4fc"]]},{"id":"109b9bf9.7b6e14","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 23 (combo_fan)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"23","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2360,"y":2880,"wires":[["abe01825.67c988"]]},{"id":"dba05209.17825","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 21 (combo_fan)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"21","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2360,"y":2640,"wires":[["fa33dfb6.6358c"]]},{"id":"92d23623.63edf8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 15 (dimmer)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"15","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2350,"y":2760,"wires":[["abe01825.67c988"]]},{"id":"f1d1beb0.cfe7a","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 7 (switch)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"7","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2340,"y":2800,"wires":[["abe01825.67c988"]]},{"id":"b0108f40.b9254","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 14 (dimmer)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"14","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2350,"y":2520,"wires":[["fa33dfb6.6358c"]]},{"id":"f679017f.03cdc","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 6 (switch)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"6","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2340,"y":2560,"wires":[["fa33dfb6.6358c"]]},{"id":"fc9836f9.fe0f28","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 24 (combo_light)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"24","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":2160,"wires":[["ff608c9a.bbf18"]]},{"id":"a1bb956f.4b7528","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 25 (combo_fan)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"25","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":2200,"wires":[["ff608c9a.bbf18"]]},{"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":"b35dc4b9a551831a","type":"subflow:ced394cd.07a138","z":"3fb9afca21427e1d","name":"Set Red","env":[{"name":"device_id","value":"light.bottom_stairs","type":"str"}],"x":760,"y":960,"wires":[["e2f32b1b7674f16f"]]},{"id":"2d46c294afd30b71","type":"inject","z":"3fb9afca21427e1d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":600,"y":960,"wires":[["b35dc4b9a551831a"]]},{"id":"e2f32b1b7674f16f","type":"debug","z":"3fb9afca21427e1d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":910,"y":960,"wires":[]}]
1 Like

That worked for me. I see you updated to the bulk_set_partial_config_parameters.

Here is my modified version. I haven’t had a chance to thoroughly test it. It works with dimmers.

[{"id":"f41b7fd30c01ae54","type":"subflow","name":"Inovelli Switch Colors","info":"","category":"","in":[{"x":180,"y":460,"wires":[{"id":"ce41a748e25648e5"}]}],"out":[{"x":1340,"y":460,"wires":[{"id":"f95ffbdf4fc27534","port":0},{"id":"ad54c3487bf752a6","port":0},{"id":"f21623b3f4c934c7","port":0},{"id":"a0fc15346a904f8d","port":0},{"id":"570e06d8623e315f","port":0},{"id":"f147f375627a2dd6","port":0},{"id":"c5a0d0ae95bfb388","port":0},{"id":"15ebcf1eb7e24d9e","port":0},{"id":"b46644a212e7cf6e","port":0},{"id":"a34f1ccfa1d0503f","port":0},{"id":"7f92397d53dcf506","port":0},{"id":"8373cd3ac6e3f715","port":0},{"id":"2335c79fb8165bb8","port":0},{"id":"7b8cd6aaa282e237","port":0},{"id":"41c35fd376f14d56","port":0},{"id":"877bbfb2c81d967d","port":0},{"id":"e87fc13c443c6668","port":0},{"id":"e95d432c355005ee","port":0},{"id":"790967edba37efbf","port":0},{"id":"bc594feb3e27b60f","port":0}]}],"env":[{"name":"color","type":"str","value":""}],"color":"#DDBBCC"},{"id":"08fb2f30e29be807","type":"switch","z":"f41b7fd30c01ae54","name":"Notification Color","property":"color","propertyType":"msg","rules":[{"t":"eq","v":"red","vt":"str"},{"t":"eq","v":"orange","vt":"str"},{"t":"eq","v":"gold","vt":"str"},{"t":"eq","v":"yellow","vt":"str"},{"t":"eq","v":"yellow_green","vt":"str"},{"t":"eq","v":"green","vt":"str"},{"t":"eq","v":"irish","vt":"str"},{"t":"eq","v":"spring_green","vt":"str"},{"t":"eq","v":"cyan","vt":"str"},{"t":"eq","v":"teal","vt":"str"},{"t":"eq","v":"azure","vt":"str"},{"t":"eq","v":"blue","vt":"str"},{"t":"eq","v":"light_purple","vt":"str"},{"t":"eq","v":"purple","vt":"str"},{"t":"eq","v":"violet","vt":"str"},{"t":"eq","v":"light_pink","vt":"str"},{"t":"eq","v":"pink","vt":"str"},{"t":"eq","v":"white","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"true_random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":21,"x":770,"y":460,"wires":[["f95ffbdf4fc27534"],["ad54c3487bf752a6"],["e95d432c355005ee"],["f21623b3f4c934c7"],["a0fc15346a904f8d"],["570e06d8623e315f"],["790967edba37efbf"],["f147f375627a2dd6"],["c5a0d0ae95bfb388"],["15ebcf1eb7e24d9e"],["e87fc13c443c6668"],["b46644a212e7cf6e"],["877bbfb2c81d967d"],["a34f1ccfa1d0503f"],["bc594feb3e27b60f"],["7f92397d53dcf506"],["8373cd3ac6e3f715"],["2335c79fb8165bb8"],["7b8cd6aaa282e237"],["41c35fd376f14d56"],["a1370a6d6207fd18"]]},{"id":"f95ffbdf4fc27534","type":"change","z":"f41b7fd30c01ae54","name":"Set Red","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":120,"wires":[[]]},{"id":"570e06d8623e315f","type":"change","z":"f41b7fd30c01ae54","name":"Set Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"85","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":320,"wires":[[]]},{"id":"a34f1ccfa1d0503f","type":"change","z":"f41b7fd30c01ae54","name":"Set Purple","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"177","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":640,"wires":[[]]},{"id":"7f92397d53dcf506","type":"change","z":"f41b7fd30c01ae54","name":"Set Light_Pink","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"220","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":680,"wires":[[]]},{"id":"b46644a212e7cf6e","type":"change","z":"f41b7fd30c01ae54","name":"Set Blue","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"170","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":560,"wires":[[]]},{"id":"f21623b3f4c934c7","type":"change","z":"f41b7fd30c01ae54","name":"Set Yellow","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"42","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":240,"wires":[[]]},{"id":"a1370a6d6207fd18","type":"function","z":"f41b7fd30c01ae54","name":"Throw Color Error","func":"throw(\"Invalid Color Selected. Please choose either red, orange, yellow, yellow_green, green, cyan, teal, blue, purple, light_pink, pink, white, random or true_random. You provided: \" + msg.color)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1070,"y":920,"wires":[]},{"id":"15ebcf1eb7e24d9e","type":"change","z":"f41b7fd30c01ae54","name":"Set Teal","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"145","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":480,"wires":[[]]},{"id":"8373cd3ac6e3f715","type":"change","z":"f41b7fd30c01ae54","name":"Set Pink","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"234","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":760,"wires":[[]]},{"id":"ad54c3487bf752a6","type":"change","z":"f41b7fd30c01ae54","name":"Set Orange","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"11","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":160,"wires":[[]]},{"id":"2335c79fb8165bb8","type":"change","z":"f41b7fd30c01ae54","name":"Set White","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"255","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":800,"wires":[[]]},{"id":"ce41a748e25648e5","type":"change","z":"f41b7fd30c01ae54","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":320,"y":460,"wires":[["1b73c1cf441d2ea1"]]},{"id":"f147f375627a2dd6","type":"change","z":"f41b7fd30c01ae54","name":"Set Spring_Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":400,"wires":[[]]},{"id":"a0fc15346a904f8d","type":"change","z":"f41b7fd30c01ae54","name":"Set Yellow_Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"65","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":280,"wires":[[]]},{"id":"c5a0d0ae95bfb388","type":"change","z":"f41b7fd30c01ae54","name":"Set Cyan","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"127","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":440,"wires":[[]]},{"id":"7b8cd6aaa282e237","type":"function","z":"f41b7fd30c01ae54","name":"Set Random Color","func":"var color = ['0', '11', '28', '42', '65', '85', '95', '110', '127', '145', '164', '170', '177', '195', '212', '220', '234', '255']; \nvar rand = color[(Math.random() * color.length) | 0]\n\nmsg.color_number = {};\nmsg.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1070,"y":840,"wires":[[]]},{"id":"1b73c1cf441d2ea1","type":"function","z":"f41b7fd30c01ae54","name":"Correct value for color","func":"msg.color = msg.color.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":460,"wires":[["08fb2f30e29be807"]]},{"id":"8b49a18f5d81afb7","type":"comment","z":"f41b7fd30c01ae54","name":"Inovelli Switch Colors","info":"","x":440,"y":220,"wires":[]},{"id":"41c35fd376f14d56","type":"function","z":"f41b7fd30c01ae54","name":"Set True_Random Color","func":"var rand = Math.floor(Math.random() * 255) + 1;\n\nmsg.color_number = {};\nmsg.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1090,"y":880,"wires":[[]]},{"id":"877bbfb2c81d967d","type":"change","z":"f41b7fd30c01ae54","name":"Set Light_Purple","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"195","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":600,"wires":[[]]},{"id":"e95d432c355005ee","type":"change","z":"f41b7fd30c01ae54","name":"Set Gold","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"28","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":200,"wires":[[]]},{"id":"e87fc13c443c6668","type":"change","z":"f41b7fd30c01ae54","name":"Set Azure","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"164","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":520,"wires":[[]]},{"id":"790967edba37efbf","type":"change","z":"f41b7fd30c01ae54","name":"Set Irish","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"95","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":360,"wires":[[]]},{"id":"bc594feb3e27b60f","type":"change","z":"f41b7fd30c01ae54","name":"Set Violet","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"212","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":720,"wires":[[]]},{"id":"e886aa8682dc5bd9","type":"subflow","name":"Inovelli Switch Effect Calculator ZwaveJS","info":"Use this Subflow to calculate a notification for either a single entity id or a group of entities within a group titled **group.inovelli_switches**.\n\nAdditionally, this subflow can be used to define a permanent color in place of the solid blue color (170).\n\nLastly, this can also set the on and off brightness of the switch.\n\nFull directions provided in the below link: https://docs.google.com/document/d/1QPAO0wZgsBvZ5d8yD3xoDUpZX2YorPeEuY-Loz3mcRI/edit?usp=sharing","category":"","in":[{"x":140,"y":400,"wires":[{"id":"0fe37a88c4f8446c"}]}],"out":[{"x":3240,"y":2720,"wires":[{"id":"ab0495ddc1e0b1e2","port":0},{"id":"65a3d2a52508dc6d","port":0},{"id":"c469f3485a4c3442","port":0},{"id":"ea9ef0ea565b7be1","port":0},{"id":"1577740f31df0d08","port":0},{"id":"641096699313655c","port":0}]}],"env":[{"name":"single_or_group","type":"str","value":"single"},{"name":"device_id","type":"str","value":"light.under_deck_light_level"},{"name":"is_permanent","type":"str","value":"no"},{"name":"switch_type","type":"str","value":"dimmer"},{"name":"color_name","type":"str","value":"red"},{"name":"brightness","type":"str","value":"10"},{"name":"total_time","type":"str","value":"5"},{"name":"measure_time","type":"str","value":"seconds"},{"name":"effect","type":"str","value":"breath"},{"name":"off_brightness","type":"str","value":""},{"name":"on_brightness","type":"str","value":""}],"color":"#789123","status":{"x":300,"y":40,"wires":[{"id":"e229ad9d7953065e","port":0}]}},{"id":"e229ad9d7953065e","type":"status","z":"e886aa8682dc5bd9","name":"","scope":null,"x":180,"y":40,"wires":[[]]},{"id":"2653a646c5b65398","type":"comment","z":"e886aa8682dc5bd9","name":"Define if Single Device or Group","info":"","x":950,"y":320,"wires":[]},{"id":"75f28fc6486dd557","type":"comment","z":"e886aa8682dc5bd9","name":"On/Off Brightness Set","info":"","x":1540,"y":2620,"wires":[]},{"id":"d0db4df26768930d","type":"comment","z":"e886aa8682dc5bd9","name":"Set Permanent Color","info":"","x":2340,"y":980,"wires":[]},{"id":"fee5a07546c3b6c4","type":"comment","z":"e886aa8682dc5bd9","name":"Define Effect On/Off Switch","info":"","x":1710,"y":2260,"wires":[]},{"id":"d8874edfa0f19dd7","type":"comment","z":"e886aa8682dc5bd9","name":"Define Effect All Other Switches","info":"","x":1710,"y":1880,"wires":[]},{"id":"2de2c4099265a27a","type":"comment","z":"e886aa8682dc5bd9","name":"Define Time","info":"","x":1250,"y":1380,"wires":[]},{"id":"b4a7e48a874db4de","type":"comment","z":"e886aa8682dc5bd9","name":"Define Brightness","info":"","x":1490,"y":640,"wires":[]},{"id":"d56f028ccaaff6bc","type":"comment","z":"e886aa8682dc5bd9","name":"Define Color","info":"","x":1390,"y":1000,"wires":[]},{"id":"adce2b1f2e34a819","type":"comment","z":"e886aa8682dc5bd9","name":"Define Notification Parameter","info":"","x":580,"y":1960,"wires":[]},{"id":"64bec1d0abdad202","type":"comment","z":"e886aa8682dc5bd9","name":"**Temporary work around for API error concerning values over 83823359, delete when no longer needed**","info":"","x":3600,"y":2100,"wires":[]},{"id":"58e211c18c431106","type":"comment","z":"e886aa8682dc5bd9","name":"Main Calculation","info":"","x":2740,"y":2100,"wires":[]},{"id":"6af4866737a3d5a8","type":"comment","z":"e886aa8682dc5bd9","name":"Check if permanent or not","info":"","x":730,"y":640,"wires":[]},{"id":"e56761bb73c6a8a4","type":"function","z":"e886aa8682dc5bd9","name":"Set Parameter LED Indicator Color to Calculation","func":"var hue = parseInt(msg.color);\n\nmsg.parameter = {};\nmsg.parameter = \"LED Indicator Color\";\n\nmsg.calculation = {};\nmsg.calculation = parseInt(hue / 255 * 350);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2470,"y":1120,"wires":[["652765c0aaf17cbe"]]},{"id":"04d5d7abe935c41b","type":"switch","z":"e886aa8682dc5bd9","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":1830,"y":1060,"wires":[["c7579ead63261aa5"],["c7579ead63261aa5"],["e56761bb73c6a8a4"],["e56761bb73c6a8a4"],["b81ad080a6163810"]]},{"id":"652765c0aaf17cbe","type":"api-call-service","z":"e886aa8682dc5bd9","name":"Set ZWaveJS Notification","server":"e976d2f1.a9534","version":3,"debugenabled":false,"service_domain":"zwave_js","service":"bulk_set_partial_config_parameters","entityId":"","data":"{\t   \"entity_id\":msg.node,\t   \"parameter\":msg.switch_enum,\t    \"value\": msg.calculation\t}\t","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2650,"y":2460,"wires":[["ab0495ddc1e0b1e2"]]},{"id":"8e87ea798f601b71","type":"switch","z":"e886aa8682dc5bd9","name":"Is this change permanent?","property":"ispermanent","propertyType":"msg","rules":[{"t":"eq","v":"yes","vt":"str"},{"t":"eq","v":"no","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1500,"y":1100,"wires":[["04d5d7abe935c41b"],["028e7c38a400c975"],["1ddba271351dcf60"]]},{"id":"c7579ead63261aa5","type":"change","z":"e886aa8682dc5bd9","name":"Set Parameter to LED Indicator Color","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Indicator Color","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2430,"y":1080,"wires":[["b56c49b6bc466eaf"]]},{"id":"b81ad080a6163810","type":"function","z":"e886aa8682dc5bd9","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2370,"y":1180,"wires":[]},{"id":"b56c49b6bc466eaf","type":"change","z":"e886aa8682dc5bd9","name":"Set msg.calculation","rules":[{"t":"set","p":"calculation","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"calculation","pt":"msg","to":"color","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2770,"y":1080,"wires":[["652765c0aaf17cbe"]]},{"id":"cd5ff0c6b9eb0fe6","type":"switch","z":"e886aa8682dc5bd9","name":"Is calculation over 83823359?","property":"calculation","propertyType":"msg","rules":[{"t":"gt","v":"83823359","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":3430,"y":2200,"wires":[["60b6ce263e35fef9"],["652765c0aaf17cbe"]]},{"id":"60b6ce263e35fef9","type":"change","z":"e886aa8682dc5bd9","name":"Change to red chase 6 seconds","rules":[{"t":"set","p":"calculation","pt":"msg","to":"33950208","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":3830,"y":2200,"wires":[["652765c0aaf17cbe"]]},{"id":"ab0495ddc1e0b1e2","type":"switch","z":"e886aa8682dc5bd9","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":2920,"y":2460,"wires":[[],["65a3d2a52508dc6d"]]},{"id":"8ef8d6c95e248e55","type":"function","z":"e886aa8682dc5bd9","name":"Correct value for switch if needed","func":"msg.switch = msg.switch.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":1100,"wires":[["5e33b8b2c40172e5"]]},{"id":"028e7c38a400c975","type":"change","z":"e886aa8682dc5bd9","name":"set msg.total_time","rules":[{"t":"set","p":"total_time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"total_time","pt":"msg","to":"total_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":1520,"wires":[["f885ca92436abe20"]]},{"id":"1ddba271351dcf60","type":"function","z":"e886aa8682dc5bd9","name":"Throw permanence error","func":"throw(\"Invalid selection for is_permanent. Valid entries are yes (permanent change) or no (this is a notification). You provided: \" + msg.ispermanent)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1750,"y":1160,"wires":[]},{"id":"1dfc29b76e7a64d2","type":"function","z":"e886aa8682dc5bd9","name":"Calculate Parameter Effect","func":"var colorchoice = parseInt(msg.color);\nvar timeamount = parseInt(msg.time);\nvar bright = parseInt(msg.bright);\nvar effectchoice = parseInt(msg.effect);\n\nmsg.calculation = {};\nmsg.calculation = parseInt((colorchoice) + (bright * 256) + (timeamount * 65536) + (effectchoice * 16777216))\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2740,"y":2200,"wires":[["652765c0aaf17cbe"]]},{"id":"65a3d2a52508dc6d","type":"join","z":"e886aa8682dc5bd9","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":2950,"y":2540,"wires":[[]]},{"id":"0a38dc4a9beebebb","type":"change","z":"e886aa8682dc5bd9","name":"Set Switch Type","rules":[{"t":"set","p":"switch","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"switch","pt":"msg","to":"switch_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":1100,"wires":[["8ef8d6c95e248e55"]]},{"id":"f885ca92436abe20","type":"function","z":"e886aa8682dc5bd9","name":"Correct value for total_time if needed","func":"msg.total_time = msg.total_time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":550,"y":1520,"wires":[["790ba77ffa4ea37b"]]},{"id":"2859ea8be7046b1a","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 1","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1920,"wires":[["1dfc29b76e7a64d2"]]},{"id":"947c3fd8144d5b6f","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 0","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1880,"wires":[["1dfc29b76e7a64d2"]]},{"id":"dd58bd31c5366e0b","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 3","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2000,"wires":[["1dfc29b76e7a64d2"]]},{"id":"2af4e2ea02ed04c8","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 4","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2040,"wires":[["1dfc29b76e7a64d2"]]},{"id":"83f5dd6f9d178928","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 5","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"5","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2080,"wires":[["1dfc29b76e7a64d2"]]},{"id":"721dfa72d920e38d","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 2","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1960,"wires":[["1dfc29b76e7a64d2"]]},{"id":"654b6cd7c7c8d08b","type":"function","z":"e886aa8682dc5bd9","name":"Set random effect","func":"var rand = Math.floor(Math.random() * 5) + 1;\n\nmsg.effect = {};\nmsg.effect = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2120,"wires":[["1dfc29b76e7a64d2"]]},{"id":"91645a3a0fd207f0","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 1","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2320,"wires":[["1dfc29b76e7a64d2"]]},{"id":"725a27564cbb7024","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 0","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2280,"wires":[["1dfc29b76e7a64d2"]]},{"id":"0f7a742ca18b9b41","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 3","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2400,"wires":[["1dfc29b76e7a64d2"]]},{"id":"66030dc98bfeda43","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 4","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2440,"wires":[["1dfc29b76e7a64d2"]]},{"id":"215e31a6801dfe43","type":"function","z":"e886aa8682dc5bd9","name":"Set random effect","func":"var rand = Math.floor(Math.random() * 5) + 1;\n\nmsg.effect = {};\nmsg.effect = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2480,"wires":[["1dfc29b76e7a64d2"]]},{"id":"a6dcb47ca5706e2e","type":"change","z":"e886aa8682dc5bd9","name":"Set effect to 2","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2360,"wires":[["1dfc29b76e7a64d2"]]},{"id":"c469f3485a4c3442","type":"switch","z":"e886aa8682dc5bd9","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":2900,"y":2700,"wires":[[],["ea9ef0ea565b7be1"]]},{"id":"ea9ef0ea565b7be1","type":"join","z":"e886aa8682dc5bd9","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":2950,"y":2780,"wires":[[]]},{"id":"1577740f31df0d08","type":"switch","z":"e886aa8682dc5bd9","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":2900,"y":2860,"wires":[[],["641096699313655c"]]},{"id":"641096699313655c","type":"join","z":"e886aa8682dc5bd9","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":2950,"y":2940,"wires":[[]]},{"id":"7a6f57bc42d9b373","type":"change","z":"e886aa8682dc5bd9","name":"Set msg.color","rules":[{"t":"set","p":"color","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"color_number","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":1100,"wires":[["0a38dc4a9beebebb"]]},{"id":"790ba77ffa4ea37b","type":"change","z":"e886aa8682dc5bd9","name":"Set msg.measure_time","rules":[{"t":"set","p":"measure_time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"measure_time","pt":"msg","to":"measure_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":850,"y":1520,"wires":[["2d7dc7e075e07328"]]},{"id":"eb05e009cce4394d","type":"switch","z":"e886aa8682dc5bd9","name":"Which effect was defined?","property":"effect","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":"blink","vt":"str"},{"t":"eq","v":"pulse","vt":"str"},{"t":"eq","v":"breath","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":1710,"y":2020,"wires":[["947c3fd8144d5b6f"],["2859ea8be7046b1a"],["721dfa72d920e38d"],["dd58bd31c5366e0b"],["2af4e2ea02ed04c8"],["2af4e2ea02ed04c8"],["83f5dd6f9d178928"],["83f5dd6f9d178928"],["654b6cd7c7c8d08b"],["f4c41df5b150c72a"]]},{"id":"0a20bbd8c1596599","type":"switch","z":"e886aa8682dc5bd9","name":"Which effect was defined?","property":"effect","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"solid","vt":"str"},{"t":"eq","v":"fast_blink","vt":"str"},{"t":"eq","v":"slow_blink","vt":"str"},{"t":"eq","v":"blink","vt":"str"},{"t":"eq","v":"pulse","vt":"str"},{"t":"eq","v":"breath","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"chase","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":1710,"y":2400,"wires":[["725a27564cbb7024"],["91645a3a0fd207f0"],["a6dcb47ca5706e2e"],["0f7a742ca18b9b41"],["0f7a742ca18b9b41"],["66030dc98bfeda43"],["66030dc98bfeda43"],["215e31a6801dfe43"],["7428365a24a4c72a"],[]]},{"id":"9afe9e99898db01f","type":"api-call-service","z":"e886aa8682dc5bd9","name":"Set ZWaveJS Notification","server":"e976d2f1.a9534","version":3,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"","data":"{    \t    \"entity_id\": msg.node,\t    \"parameter\": msg.parameter,    \t    \"value\": msg.offbright\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2630,"y":2720,"wires":[["c469f3485a4c3442"]]},{"id":"a865167818ac566d","type":"api-call-service","z":"e886aa8682dc5bd9","name":"Set ZWaveJS Notification","server":"e976d2f1.a9534","version":3,"debugenabled":false,"service_domain":"zwave_js","service":"set_config_parameter","entityId":"","data":"{    \t    \"entity_id\": msg.node,\t    \"parameter\": msg.parameter,    \t    \"value\": msg.onbright\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2630,"y":2840,"wires":[["1577740f31df0d08"]]},{"id":"9ab82748882b841e","type":"subflow:f41b7fd30c01ae54","z":"e886aa8682dc5bd9","name":"","env":[],"x":520,"y":1100,"wires":[["7a6f57bc42d9b373"]]},{"id":"2d7dc7e075e07328","type":"function","z":"e886aa8682dc5bd9","name":"Correct value for measure_time if needed","func":"msg.measure_time = msg.measure_time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1160,"y":1520,"wires":[["f10aef0795df7ede"]]},{"id":"51a8efbb022185b9","type":"switch","z":"e886aa8682dc5bd9","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"eq","v":"switch","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1430,"y":2180,"wires":[["eb05e009cce4394d"],["eb05e009cce4394d"],["eb05e009cce4394d"],["0a20bbd8c1596599"]]},{"id":"f4c41df5b150c72a","type":"function","z":"e886aa8682dc5bd9","name":"Throw effect error","func":"throw(\"Invalid Effect Listed. Valid choices for effects include off, solid, chase, fast_blink, slow_blink, blink, pulse, or breath. You selected: \" + msg.effect)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2160,"wires":[]},{"id":"7428365a24a4c72a","type":"function","z":"e886aa8682dc5bd9","name":"Throw chase effect error","func":"throw(\"Switches cannot use the Chase effect. Please define another effect and try again.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2190,"y":2520,"wires":[]},{"id":"a9b029b63e8110a0","type":"change","z":"e886aa8682dc5bd9","name":"Set Parameter to LED Indicator Intensity (When Off)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Indicator Intensity (When Off)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2270,"y":2720,"wires":[["9afe9e99898db01f"]]},{"id":"019e0b07e14bfa41","type":"change","z":"e886aa8682dc5bd9","name":"Set Parameter to LED Indicator Intensity","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Indicator Intensity","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2240,"y":2840,"wires":[["a865167818ac566d"]]},{"id":"57624b43020cac6b","type":"switch","z":"e886aa8682dc5bd9","name":"Make sure there's a color","property":"color_name","propertyType":"env","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":1080,"wires":[["c2c3d4e6050dee94"],["9ab82748882b841e"]]},{"id":"f10aef0795df7ede","type":"switch","z":"e886aa8682dc5bd9","name":"Check if time is valid","property":"total_time","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"255","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"forever","vt":"str"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":1460,"y":1520,"wires":[["60745a897bb9733b"],["945436bfcacc41e1"],["60745a897bb9733b"],["e3f272d861b85265"],["895cbbda60a239f4"]]},{"id":"36b13866654c8940","type":"function","z":"e886aa8682dc5bd9","name":"Correct value for effect if needed","func":"msg.effect = msg.effect.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":2180,"wires":[["51a8efbb022185b9"]]},{"id":"188f2d92b308aab4","type":"switch","z":"e886aa8682dc5bd9","name":"Is there a switch defined?","property":"switch","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1890,"y":2720,"wires":[["a9b029b63e8110a0"],["31f9c9500ca71580"]]},{"id":"9af0e60e1a9bf30e","type":"switch","z":"e886aa8682dc5bd9","name":"Is there a switch defined?","property":"switch","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1890,"y":2840,"wires":[["019e0b07e14bfa41"],["f21592b8bfbc6dfa"]]},{"id":"316aa412d00e026a","type":"function","z":"e886aa8682dc5bd9","name":"Extract Brightness Value","func":"var light = parseInt(msg.brightness);\n\nmsg.bright = {};\nmsg.bright = parseInt(light);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2010,"y":680,"wires":[["57624b43020cac6b"]]},{"id":"e7edf71457bd5727","type":"function","z":"e886aa8682dc5bd9","name":"Set random brightness","func":"var rand = Math.floor(Math.random() * 10) + 1;\n\nmsg.bright = {};\nmsg.bright = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2000,"y":720,"wires":[["57624b43020cac6b"]]},{"id":"ef383659100a1ef6","type":"switch","z":"e886aa8682dc5bd9","name":"Is this change permanent?","property":"ispermanent","propertyType":"msg","rules":[{"t":"eq","v":"no","vt":"str"},{"t":"eq","v":"yes","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":900,"y":740,"wires":[["e1a00acee7db3a8d"],["57624b43020cac6b"],["0c287a95d368c7b6"]]},{"id":"c2c3d4e6050dee94","type":"function","z":"e886aa8682dc5bd9","name":"Throw color error","func":"throw(\"Invalid Color Selected. Color cannot be blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":510,"y":1040,"wires":[]},{"id":"60745a897bb9733b","type":"switch","z":"e886aa8682dc5bd9","name":"What is the measure of time?","property":"measure_time","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":2080,"y":1520,"wires":[["9ce7d3e5501f7b88"],["41c1ca7a96e2c61d"],["169dcd139f6ddb6e"],["a39013601ec8910d"],["8350bdb9684db64c"],["945ffbf7bda81718"]]},{"id":"945436bfcacc41e1","type":"function","z":"e886aa8682dc5bd9","name":"Set random time","func":"var rand = Math.floor(Math.random() * 255) + 1;\n\nmsg.total_time = {};\nmsg.total_time = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1700,"y":1460,"wires":[["60745a897bb9733b"]]},{"id":"e3f272d861b85265","type":"switch","z":"e886aa8682dc5bd9","name":"Is measure_time forever?","property":"measure_time","propertyType":"msg","rules":[{"t":"eq","v":"forever","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1750,"y":1580,"wires":[["60745a897bb9733b"],["4e5351d206406509"]]},{"id":"895cbbda60a239f4","type":"function","z":"e886aa8682dc5bd9","name":"Throw time error","func":"throw(\"Invalid Time Defined. Time must be between 1 and 255, or blank if measure of time is forever. You supplied: \" + msg.total_time)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1700,"y":1640,"wires":[]},{"id":"0a687bec88623d21","type":"change","z":"e886aa8682dc5bd9","name":"Set msg.effect","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"effect","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":2180,"wires":[["36b13866654c8940"]]},{"id":"da82cd76985e5380","type":"switch","z":"e886aa8682dc5bd9","name":"Is off_brightness between 1 and 10?","property":"offbright","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1570,"y":2740,"wires":[["188f2d92b308aab4"],[],["d3768312441dfe95"]]},{"id":"31f9c9500ca71580","type":"function","z":"e886aa8682dc5bd9","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2760,"wires":[]},{"id":"9b761357d07d6ec8","type":"switch","z":"e886aa8682dc5bd9","name":"Is on_brightness between 1 and 10?","property":"onbright","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1570,"y":2840,"wires":[["9af0e60e1a9bf30e"],[],["3604a6f50221e8f4"]]},{"id":"f21592b8bfbc6dfa","type":"function","z":"e886aa8682dc5bd9","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2880,"wires":[]},{"id":"cb3f6da3ee3360fb","type":"switch","z":"e886aa8682dc5bd9","name":"What is the brightness value","property":"brightness","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1740,"y":720,"wires":[["316aa412d00e026a"],["e7edf71457bd5727"],["32ad80b61d54c0b3"]]},{"id":"26f28a9230965706","type":"function","z":"e886aa8682dc5bd9","name":"Correct value for ispermanent if needed","func":"msg.ispermanent = msg.ispermanent.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":740,"wires":[["ef383659100a1ef6"]]},{"id":"e1a00acee7db3a8d","type":"change","z":"e886aa8682dc5bd9","name":"Set msg.brightness","rules":[{"t":"set","p":"brightness","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"brightness","pt":"msg","to":"brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":720,"wires":[["d5ae66ce9abec2f9"]]},{"id":"0c287a95d368c7b6","type":"function","z":"e886aa8682dc5bd9","name":"Throw permanence error","func":"throw(\"Invalid selection for is_permanent. Valid entries are yes (permanent change) or no (this is a notification). You provided: \" + msg.ispermanent)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1170,"y":780,"wires":[]},{"id":"9ce7d3e5501f7b88","type":"function","z":"e886aa8682dc5bd9","name":"Calculate for Seconds","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\nmsg.time = parseInt(amount);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1400,"wires":[["7fad9329aa560655"]]},{"id":"41c1ca7a96e2c61d","type":"function","z":"e886aa8682dc5bd9","name":"Calculate for Minutes","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\n\nif (amount === '1')\n{\n    msg.time = parseInt(amount * 60);\n}\n\nelse\n{\n    msg.time = parseInt(amount + 60);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1440,"wires":[["7fad9329aa560655"]]},{"id":"169dcd139f6ddb6e","type":"function","z":"e886aa8682dc5bd9","name":"Calculate for Hours","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\n\nif (amount === '1')\n{\n    msg.time = parseInt(amount * 120);\n}\n\nelse\n{\n    msg.time = parseInt(amount + 120);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2350,"y":1480,"wires":[["7fad9329aa560655"]]},{"id":"a39013601ec8910d","type":"function","z":"e886aa8682dc5bd9","name":"Calculate for Forever","func":"msg.time = {};\nmsg.time = parseInt(255);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1520,"wires":[["7fad9329aa560655"]]},{"id":"8350bdb9684db64c","type":"function","z":"e886aa8682dc5bd9","name":"Calculate for Random","func":"var rand = parseInt(msg.total_time)\n\nmsg.time = {};\nmsg.time = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1560,"wires":[["7fad9329aa560655"]]},{"id":"945ffbf7bda81718","type":"function","z":"e886aa8682dc5bd9","name":"Throw time error","func":"throw(\"Invalid Measure of Time Selected. Valid entries inlude seconds, minutes, hours, or forever. You supplied: \" + msg.measure_time)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2340,"y":1600,"wires":[]},{"id":"4e5351d206406509","type":"function","z":"e886aa8682dc5bd9","name":"Throw time error","func":"throw(\"Time can only be blank if measure_time is set to forever. Please define a value for total_time or change measure_time to forever and try again.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1960,"y":1640,"wires":[]},{"id":"333e889c3d9cdcd7","type":"change","z":"e886aa8682dc5bd9","name":"Set Parameter to LED Strip Effect","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Strip Effect","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":2220,"wires":[["0a687bec88623d21"]]},{"id":"3ab7a924edf3c617","type":"change","z":"e886aa8682dc5bd9","name":"Set Parameter to LED Strip Effect (Color)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"LED Strip Effect (Color)","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":580,"y":2180,"wires":[["0a687bec88623d21"]]},{"id":"86c4f35bae5d6e0a","type":"function","z":"e886aa8682dc5bd9","name":"Correct value for offbright if needed","func":"msg.offbright = msg.offbright.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1240,"y":2740,"wires":[["da82cd76985e5380"]]},{"id":"d3768312441dfe95","type":"function","z":"e886aa8682dc5bd9","name":"Throw offbright error","func":"throw(\"Invalid Off Brightness Defined. Value must be between 1 and 10, or blank. You supplied: \" + msg.offbright)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1880,"y":2760,"wires":[]},{"id":"1a352a2543ad6d62","type":"function","z":"e886aa8682dc5bd9","name":"Correct value for onbright if needed","func":"msg.onbright = msg.onbright.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1240,"y":2840,"wires":[["9b761357d07d6ec8"]]},{"id":"3604a6f50221e8f4","type":"function","z":"e886aa8682dc5bd9","name":"Throw onbright error","func":"throw(\"Invalid On Brightness Defined. Value must be between 1 and 10, or blank. You supplied: \" + msg.onbright)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1880,"y":2880,"wires":[]},{"id":"d5ae66ce9abec2f9","type":"function","z":"e886aa8682dc5bd9","name":"Correct value for brightness if needed","func":"msg.brightness = msg.brightness.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1430,"y":720,"wires":[["cb3f6da3ee3360fb"]]},{"id":"32ad80b61d54c0b3","type":"function","z":"e886aa8682dc5bd9","name":"Throw brightness error","func":"throw(\"Invalid Brightness Selected. Brightness cannot be blank and must be between 1 and 10. You selected: \" + msg.brightness)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2000,"y":760,"wires":[]},{"id":"0adccc538fde2aa1","type":"change","z":"e886aa8682dc5bd9","name":"Set msg.ispermanent","rules":[{"t":"set","p":"ispermanent","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"ispermanent","pt":"msg","to":"is_permanent","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":740,"wires":[["26f28a9230965706"]]},{"id":"7fad9329aa560655","type":"switch","z":"e886aa8682dc5bd9","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":230,"y":2220,"wires":[["3ab7a924edf3c617"],["333e889c3d9cdcd7"],["333e889c3d9cdcd7"],["333e889c3d9cdcd7"],["1f2d9f57e001793e"]]},{"id":"5673e95a0b47f49b","type":"change","z":"e886aa8682dc5bd9","name":"Set msg.offbright","rules":[{"t":"set","p":"offbright","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"offbright","pt":"msg","to":"off_brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":2740,"wires":[["86c4f35bae5d6e0a"]]},{"id":"af6db5405259b975","type":"change","z":"e886aa8682dc5bd9","name":"Set msg.onbright","rules":[{"t":"set","p":"onbright","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"onbright","pt":"msg","to":"on_brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":2840,"wires":[["1a352a2543ad6d62"]]},{"id":"ae11479204949613","type":"change","z":"e886aa8682dc5bd9","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":1930,"y":400,"wires":[["0adccc538fde2aa1","bfa2cdea69edef8b"]]},{"id":"c71af0a0683d62cc","type":"switch","z":"e886aa8682dc5bd9","name":"Make sure there's a device defined","property":"node","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1600,"y":320,"wires":[["0adccc538fde2aa1","bfa2cdea69edef8b"],["b800f1849a4fddef"]]},{"id":"1f2d9f57e001793e","type":"function","z":"e886aa8682dc5bd9","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":510,"y":2260,"wires":[]},{"id":"8917ed269e5616c1","type":"function","z":"e886aa8682dc5bd9","name":"Correct value for switch if needed","func":"msg.switch = msg.switch.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":700,"y":2780,"wires":[["5673e95a0b47f49b","af6db5405259b975"]]},{"id":"cea2232a6b922744","type":"delay","z":"e886aa8682dc5bd9","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"0.25","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1750,"y":400,"wires":[["ae11479204949613"]]},{"id":"bfa2cdea69edef8b","type":"change","z":"e886aa8682dc5bd9","name":"Set Switch Type","rules":[{"t":"set","p":"switch","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"switch","pt":"msg","to":"switch_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":2780,"wires":[["8917ed269e5616c1"]]},{"id":"2b9c53b0a06d98c2","type":"change","z":"e886aa8682dc5bd9","name":"Set device ID","rules":[{"t":"set","p":"node","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"device_id","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":320,"wires":[["c71af0a0683d62cc"]]},{"id":"b800f1849a4fddef","type":"function","z":"e886aa8682dc5bd9","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":1950,"y":320,"wires":[]},{"id":"8625fe151d5ebe5d","type":"split","z":"e886aa8682dc5bd9","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1590,"y":400,"wires":[["cea2232a6b922744"]]},{"id":"a472e32b240f2af2","type":"switch","z":"e886aa8682dc5bd9","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":1090,"y":400,"wires":[["2b9c53b0a06d98c2"],["64792c976215b28a"],["b2fc8cacebadad67"]]},{"id":"64792c976215b28a","type":"ha-get-entities","z":"e886aa8682dc5bd9","name":"Get all Inovelli switches","server":"e976d2f1.a9534","version":0,"rules":[{"property":"entity_id","logic":"in_group","value":"group.inovelli_switches","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":1390,"y":400,"wires":[["8625fe151d5ebe5d"]]},{"id":"faaff10a275bbae5","type":"function","z":"e886aa8682dc5bd9","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":600,"y":400,"wires":[["a472e32b240f2af2"]]},{"id":"b2fc8cacebadad67","type":"function","z":"e886aa8682dc5bd9","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":1470,"y":500,"wires":[]},{"id":"0fe37a88c4f8446c","type":"change","z":"e886aa8682dc5bd9","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":300,"y":400,"wires":[["faaff10a275bbae5"]]},{"id":"5e33b8b2c40172e5","type":"function","z":"e886aa8682dc5bd9","name":"Add Switch Enum","func":"msg.switch_enum = {};\nif (msg.switch == \"dimmer\")\n{\n    msg.switch_enum=16\n}\nelse if (msg.switch == \"switch\")\n{\n    msg.switch_enum=8\n}\nelse if (msg.switch == \"combo_light\")\n{\n    msg.switch_enum=24\n}\nelse if (msg.switch == \"combo_fan\")\n{\n    msg.switch_enum=25\n}\nelse\n{\n    msg.switch_enum=-1\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":870,"y":1200,"wires":[["63bd32d6f1d8714c"]]},{"id":"63bd32d6f1d8714c","type":"switch","z":"e886aa8682dc5bd9","name":"Check Valid Switch Type","property":"switch_enum","propertyType":"msg","rules":[{"t":"nnull"},{"t":"eq","v":"-1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1110,"y":1180,"wires":[["8e87ea798f601b71"],["5b8dcaee8454d167"]]},{"id":"5b8dcaee8454d167","type":"function","z":"e886aa8682dc5bd9","name":"Throw switch type error","func":"throw(\"Invalid selection for switch_type. Valid entries are dimmer, switch, combo_switch, combo_fan. You provided: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1650,"y":1320,"wires":[]},{"id":"ca0a55ab4a368fb1","type":"comment","z":"e886aa8682dc5bd9","name":"**Not needed anymore","info":"","x":3340,"y":2140,"wires":[]},{"id":"e976d2f1.a9534","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true}]
1 Like

Just a reminder that node-red-contrib-ha-inovelli-manager (node) - Node-RED exists. Might not correspond to this need, but works GREAT for me for LED color and notifications calculations!

2 Likes

Yeah it is a great option as well!

I ended up creating the subflow above mainly for me to see if I could do it (and to combine the necessary service node at the end), but also because early on this node didn’t have the correct support I needed and got a little tired of waiting for an update. For anyone coming to this thread, that node is definitely the better option for these calculations at this time!

In case anyone was interested, I’ve updated the subflow to use multicast instead of bulk_set. Thanks to everyone over in this thread for figuring out how to get it working!

[{"id":"622f6fdc.53255","type":"subflow","name":"Inovelli Switch Colors","info":"","category":"","in":[{"x":180,"y":460,"wires":[{"id":"afd4ba78.36e738"}]}],"out":[{"x":1340,"y":460,"wires":[{"id":"24eba44b.be043c","port":0},{"id":"29484e6d.985c22","port":0},{"id":"67d291ec.e9f9c","port":0},{"id":"fa5d6adf.e2b278","port":0},{"id":"cc8df5bc.47d9c8","port":0},{"id":"3a671d8f.61fd52","port":0},{"id":"699fd353.e1e86c","port":0},{"id":"895f93f4.e4446","port":0},{"id":"5a546c17.129624","port":0},{"id":"9acc62e5.b9c1c","port":0},{"id":"cbae533c.14307","port":0},{"id":"96770017.8ff7c","port":0},{"id":"c6da46f4.03d3e8","port":0},{"id":"84349430.689418","port":0},{"id":"c39b55c0.257998","port":0},{"id":"3fc738af.17aa18","port":0},{"id":"d9e24a81.db4418","port":0},{"id":"9f680e18.5d04f","port":0},{"id":"136d361a.4ba82a","port":0},{"id":"43c62b5e.14f134","port":0}]}],"env":[{"name":"color","type":"str","value":""}],"color":"#DDBBCC"},{"id":"366c6b5d.5d62f4","type":"switch","z":"622f6fdc.53255","name":"Notification Color","property":"color","propertyType":"msg","rules":[{"t":"eq","v":"red","vt":"str"},{"t":"eq","v":"orange","vt":"str"},{"t":"eq","v":"gold","vt":"str"},{"t":"eq","v":"yellow","vt":"str"},{"t":"eq","v":"yellow_green","vt":"str"},{"t":"eq","v":"green","vt":"str"},{"t":"eq","v":"irish","vt":"str"},{"t":"eq","v":"spring_green","vt":"str"},{"t":"eq","v":"cyan","vt":"str"},{"t":"eq","v":"teal","vt":"str"},{"t":"eq","v":"azure","vt":"str"},{"t":"eq","v":"blue","vt":"str"},{"t":"eq","v":"light_purple","vt":"str"},{"t":"eq","v":"purple","vt":"str"},{"t":"eq","v":"violet","vt":"str"},{"t":"eq","v":"light_pink","vt":"str"},{"t":"eq","v":"pink","vt":"str"},{"t":"eq","v":"white","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"true_random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":21,"x":770,"y":460,"wires":[["24eba44b.be043c"],["29484e6d.985c22"],["9f680e18.5d04f"],["67d291ec.e9f9c"],["fa5d6adf.e2b278"],["cc8df5bc.47d9c8"],["136d361a.4ba82a"],["3a671d8f.61fd52"],["699fd353.e1e86c"],["895f93f4.e4446"],["d9e24a81.db4418"],["5a546c17.129624"],["3fc738af.17aa18"],["9acc62e5.b9c1c"],["43c62b5e.14f134"],["cbae533c.14307"],["96770017.8ff7c"],["c6da46f4.03d3e8"],["84349430.689418"],["c39b55c0.257998"],["14bbea53.6556f6"]]},{"id":"24eba44b.be043c","type":"change","z":"622f6fdc.53255","name":"Set Red","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":120,"wires":[[]]},{"id":"cc8df5bc.47d9c8","type":"change","z":"622f6fdc.53255","name":"Set Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"85","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":320,"wires":[[]]},{"id":"9acc62e5.b9c1c","type":"change","z":"622f6fdc.53255","name":"Set Purple","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"177","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":640,"wires":[[]]},{"id":"cbae533c.14307","type":"change","z":"622f6fdc.53255","name":"Set Light_Pink","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"220","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":680,"wires":[[]]},{"id":"5a546c17.129624","type":"change","z":"622f6fdc.53255","name":"Set Blue","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"170","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":560,"wires":[[]]},{"id":"67d291ec.e9f9c","type":"change","z":"622f6fdc.53255","name":"Set Yellow","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"42","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":240,"wires":[[]]},{"id":"14bbea53.6556f6","type":"function","z":"622f6fdc.53255","name":"Throw Color Error","func":"throw(\"Invalid Color Selected. Please choose either red, orange, yellow, yellow_green, green, cyan, teal, blue, purple, light_pink, pink, white, random or true_random. You provided: \" + msg.color)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1070,"y":920,"wires":[]},{"id":"895f93f4.e4446","type":"change","z":"622f6fdc.53255","name":"Set Teal","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"145","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":480,"wires":[[]]},{"id":"96770017.8ff7c","type":"change","z":"622f6fdc.53255","name":"Set Pink","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"234","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":760,"wires":[[]]},{"id":"29484e6d.985c22","type":"change","z":"622f6fdc.53255","name":"Set Orange","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"11","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":160,"wires":[[]]},{"id":"c6da46f4.03d3e8","type":"change","z":"622f6fdc.53255","name":"Set White","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"255","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":800,"wires":[[]]},{"id":"afd4ba78.36e738","type":"change","z":"622f6fdc.53255","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":320,"y":460,"wires":[["51e16179.42c08"]]},{"id":"3a671d8f.61fd52","type":"change","z":"622f6fdc.53255","name":"Set Spring_Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"110","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":400,"wires":[[]]},{"id":"fa5d6adf.e2b278","type":"change","z":"622f6fdc.53255","name":"Set Yellow_Green","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"65","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":280,"wires":[[]]},{"id":"699fd353.e1e86c","type":"change","z":"622f6fdc.53255","name":"Set Cyan","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"127","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":440,"wires":[[]]},{"id":"84349430.689418","type":"function","z":"622f6fdc.53255","name":"Set Random Color","func":"var color = ['0', '11', '28', '42', '65', '85', '95', '110', '127', '145', '164', '170', '177', '195', '212', '220', '234', '255']; \nvar rand = color[(Math.random() * color.length) | 0]\n\nmsg.color_number = {};\nmsg.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1070,"y":840,"wires":[[]]},{"id":"51e16179.42c08","type":"function","z":"622f6fdc.53255","name":"Correct value for color","func":"msg.color = msg.color.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":540,"y":460,"wires":[["366c6b5d.5d62f4"]]},{"id":"7b266d5e.6cbf74","type":"comment","z":"622f6fdc.53255","name":"Inovelli Switch Colors","info":"","x":440,"y":220,"wires":[]},{"id":"c39b55c0.257998","type":"function","z":"622f6fdc.53255","name":"Set True_Random Color","func":"var rand = Math.floor(Math.random() * 255) + 1;\n\nmsg.color_number = {};\nmsg.color_number = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1090,"y":880,"wires":[[]]},{"id":"3fc738af.17aa18","type":"change","z":"622f6fdc.53255","name":"Set Light_Purple","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"195","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1070,"y":600,"wires":[[]]},{"id":"9f680e18.5d04f","type":"change","z":"622f6fdc.53255","name":"Set Gold","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"28","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":200,"wires":[[]]},{"id":"d9e24a81.db4418","type":"change","z":"622f6fdc.53255","name":"Set Azure","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"164","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":520,"wires":[[]]},{"id":"136d361a.4ba82a","type":"change","z":"622f6fdc.53255","name":"Set Irish","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"95","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":360,"wires":[[]]},{"id":"43c62b5e.14f134","type":"change","z":"622f6fdc.53255","name":"Set Violet","rules":[{"t":"set","p":"color_number","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color_number","pt":"msg","to":"212","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1040,"y":720,"wires":[[]]},{"id":"ced394cd.07a138","type":"subflow","name":"Inovelli Switch Effect Calculator ZwaveJS","info":"Use this Subflow to calculate a notification for either a single entity id or a group of entities within a group titled **group.inovelli_switches**.\n\nAdditionally, this subflow can be used to define a permanent color in place of the solid blue color (170).\n\nLastly, this can also set the on and off brightness of the switch.\n\nFull directions provided in the below link: https://docs.google.com/document/d/1QPAO0wZgsBvZ5d8yD3xoDUpZX2YorPeEuY-Loz3mcRI/edit?usp=sharing","category":"","in":[{"x":280,"y":400,"wires":[{"id":"387f188b.b8e878"}]}],"out":[{"x":3480,"y":2660,"wires":[{"id":"280109e1.7dd616","port":0},{"id":"dccff49c.686cf8","port":0},{"id":"7b15da79.7a5874","port":0},{"id":"d56c5d09.c3c6e","port":0},{"id":"c688ddb9.ac587","port":0},{"id":"cbff6a4d.ab1e98","port":0}]}],"env":[{"name":"single_or_group","type":"str","value":"single"},{"name":"device_id","type":"str","value":"light.under_deck_light_level"},{"name":"is_permanent","type":"str","value":"no"},{"name":"switch_type","type":"str","value":"dimmer"},{"name":"color_name","type":"str","value":"red"},{"name":"brightness","type":"str","value":"10"},{"name":"total_time","type":"str","value":"5"},{"name":"measure_time","type":"str","value":"seconds"},{"name":"effect","type":"str","value":"breath"},{"name":"off_brightness","type":"str","value":""},{"name":"on_brightness","type":"str","value":""}],"color":"#789123","status":{"x":300,"y":220,"wires":[{"id":"5b1abf00.e5c32","port":0}]}},{"id":"5b1abf00.e5c32","type":"status","z":"ced394cd.07a138","name":"","scope":null,"x":180,"y":220,"wires":[[]]},{"id":"6b7bedfd.f99d94","type":"switch","z":"ced394cd.07a138","name":"Make sure there's a color","property":"color_name","propertyType":"env","rules":[{"t":"empty"},{"t":"nempty"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":1080,"wires":[["343233db.d0313c"],["762c608d.24285"]]},{"id":"762c608d.24285","type":"subflow:622f6fdc.53255","z":"ced394cd.07a138","name":"","env":[],"x":520,"y":1100,"wires":[["e9b0ba4a.df14b8"]]},{"id":"4cd2d8a3.bde3e8","type":"switch","z":"ced394cd.07a138","name":"What is the brightness value","property":"brightness","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1740,"y":720,"wires":[["f0565f95.619f4"],["70383bf1.4b7384"],["3c82e100.cfedae"]]},{"id":"f0565f95.619f4","type":"function","z":"ced394cd.07a138","name":"Extract Brightness Value","func":"var light = parseInt(msg.brightness);\n\nmsg.bright = {};\nmsg.bright = parseInt(light);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2010,"y":680,"wires":[["6b7bedfd.f99d94"]]},{"id":"3c82e100.cfedae","type":"function","z":"ced394cd.07a138","name":"Throw brightness error","func":"throw(\"Invalid Brightness Selected. Brightness cannot be blank and must be between 1 and 10. You selected: \" + msg.brightness)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2000,"y":760,"wires":[]},{"id":"e9b0ba4a.df14b8","type":"change","z":"ced394cd.07a138","name":"Set msg.color","rules":[{"t":"set","p":"color","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"color","pt":"msg","to":"color_number","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":1100,"wires":[["4ed0e38e.d53aac"]]},{"id":"ca30863e.3b3f18","type":"change","z":"ced394cd.07a138","name":"Set msg.brightness","rules":[{"t":"set","p":"brightness","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"brightness","pt":"msg","to":"brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":720,"wires":[["adbba3a4.23c03"]]},{"id":"ff1489b9.2a33e8","type":"switch","z":"ced394cd.07a138","name":"What is the measure of time?","property":"measure_time","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":2100,"y":1440,"wires":[["8d94f9c3.13a1e8"],["9ae8430.cbb0bc"],["1765a727.a7cbf9"],["c63d35b2.25f678"],["98f8c9ca.731868"],["5d04df19.5b454"]]},{"id":"93d0dd4e.55bfe","type":"change","z":"ced394cd.07a138","name":"set msg.total_time","rules":[{"t":"set","p":"total_time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"total_time","pt":"msg","to":"total_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":1440,"wires":[["c28d364a.c4d0c8"]]},{"id":"8d94f9c3.13a1e8","type":"function","z":"ced394cd.07a138","name":"Calculate for Seconds","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\nmsg.time = parseInt(amount);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2380,"y":1320,"wires":[["c66288ba.effca8"]]},{"id":"9ae8430.cbb0bc","type":"function","z":"ced394cd.07a138","name":"Calculate for Minutes","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\n\nif (amount === 1)\n{\n    msg.time = parseInt(amount * 60);\n}\n\nelse\n{\n    msg.time = parseInt(amount + 60);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2380,"y":1360,"wires":[["c66288ba.effca8"]]},{"id":"1765a727.a7cbf9","type":"function","z":"ced394cd.07a138","name":"Calculate for Hours","func":"var amount = parseInt(msg.total_time);\n\nmsg.time = {};\n\nif (amount === 1)\n{\n    msg.time = parseInt(amount * 120);\n}\n\nelse\n{\n    msg.time = parseInt(amount + 120);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2370,"y":1400,"wires":[["c66288ba.effca8"]]},{"id":"c63d35b2.25f678","type":"function","z":"ced394cd.07a138","name":"Calculate for Forever","func":"msg.time = {};\nmsg.time = parseInt(255);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2380,"y":1440,"wires":[["c66288ba.effca8"]]},{"id":"5d04df19.5b454","type":"function","z":"ced394cd.07a138","name":"Throw time error","func":"throw(\"Invalid Measure of Time Selected. Valid entries inlude seconds, minutes, hours, or forever. You supplied: \" + msg.measure_time)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2360,"y":1520,"wires":[]},{"id":"c66288ba.effca8","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":230,"y":2160,"wires":[["78f7d2f.52d912c"],["56c0899b.f666e8"],["fc9836f9.fe0f28"],["a1bb956f.4b7528"],["48812b47.28b2c4"]]},{"id":"56c0899b.f666e8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 16 (dimmer)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"16","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":2120,"wires":[["ff608c9a.bbf18"]]},{"id":"78f7d2f.52d912c","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 8 (switch)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"8","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":540,"y":2080,"wires":[["ff608c9a.bbf18"]]},{"id":"48812b47.28b2c4","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":510,"y":2240,"wires":[]},{"id":"ff608c9a.bbf18","type":"change","z":"ced394cd.07a138","name":"Set msg.effect","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"effect","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":880,"y":2120,"wires":[["14c351bc.5747ae"]]},{"id":"7040998f.d28a98","type":"switch","z":"ced394cd.07a138","name":"Which effect was defined?","property":"effect","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":"blink","vt":"str"},{"t":"eq","v":"pulse","vt":"str"},{"t":"eq","v":"breath","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":1710,"y":1960,"wires":[["fc5a2e0b.2d172"],["5a3101a2.1857e"],["ee3c7827.057288"],["658a2d88.5d1814"],["8e39fc30.452ca"],["8e39fc30.452ca"],["737c2d32.2b9694"],["737c2d32.2b9694"],["e5ff5c32.53818"],["36266957.96bf46"]]},{"id":"5a3101a2.1857e","type":"change","z":"ced394cd.07a138","name":"Set effect to 1","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1860,"wires":[["4a754925.93f358"]]},{"id":"fc5a2e0b.2d172","type":"change","z":"ced394cd.07a138","name":"Set effect to 0","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1820,"wires":[["4a754925.93f358"]]},{"id":"658a2d88.5d1814","type":"change","z":"ced394cd.07a138","name":"Set effect to 3","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1940,"wires":[["4a754925.93f358"]]},{"id":"8e39fc30.452ca","type":"change","z":"ced394cd.07a138","name":"Set effect to 4","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1980,"wires":[["4a754925.93f358"]]},{"id":"737c2d32.2b9694","type":"change","z":"ced394cd.07a138","name":"Set effect to 5","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"5","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2020,"wires":[["4a754925.93f358"]]},{"id":"ee3c7827.057288","type":"change","z":"ced394cd.07a138","name":"Set effect to 2","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":1900,"wires":[["4a754925.93f358"]]},{"id":"36266957.96bf46","type":"function","z":"ced394cd.07a138","name":"Throw effect error","func":"throw(\"Invalid Effect Listed. Valid choices for effects include off, solid, chase, fast_blink, slow_blink, blink, pulse, or breath. You selected: \" + msg.effect)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2100,"wires":[]},{"id":"4a754925.93f358","type":"function","z":"ced394cd.07a138","name":"Calculate Parameter Effect","func":"var colorchoice = parseInt(msg.color);\nvar timeamount = parseInt(msg.time);\nvar bright = parseInt(msg.bright);\nvar effectchoice = parseInt(msg.effect);\n\nmsg.calculation = {};\nmsg.calculation = parseInt((colorchoice) + (bright * 256) + (timeamount * 65536) + (effectchoice * 16777216))\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2580,"y":2140,"wires":[["190b03a.0f6b4fc"]]},{"id":"adbba3a4.23c03","type":"function","z":"ced394cd.07a138","name":"Correct value for brightness if needed","func":"msg.brightness = msg.brightness.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1430,"y":720,"wires":[["4cd2d8a3.bde3e8"]]},{"id":"c28d364a.c4d0c8","type":"function","z":"ced394cd.07a138","name":"Correct value for total_time if needed","func":"msg.total_time = msg.total_time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":570,"y":1440,"wires":[["beedc17a.35662"]]},{"id":"bf806ca.915109","type":"function","z":"ced394cd.07a138","name":"Correct value for measure_time if needed","func":"msg.measure_time = msg.measure_time.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1180,"y":1440,"wires":[["a605b835.d530b8"]]},{"id":"14c351bc.5747ae","type":"function","z":"ced394cd.07a138","name":"Correct value for effect if needed","func":"msg.effect = msg.effect.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1130,"y":2120,"wires":[["2d152983.12d8b6"]]},{"id":"70383bf1.4b7384","type":"function","z":"ced394cd.07a138","name":"Set random brightness","func":"var rand = Math.floor(Math.random() * 10) + 1;\n\nmsg.bright = {};\nmsg.bright = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2000,"y":720,"wires":[["6b7bedfd.f99d94"]]},{"id":"cc804692.070ae8","type":"comment","z":"ced394cd.07a138","name":"Define if Single Device or Group","info":"","x":950,"y":320,"wires":[]},{"id":"a605b835.d530b8","type":"switch","z":"ced394cd.07a138","name":"Check if time is valid","property":"total_time","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"255","v2t":"num"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"forever","vt":"str"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":1480,"y":1440,"wires":[["ff1489b9.2a33e8"],["641b2be0.2e6764"],["ff1489b9.2a33e8"],["9237fb11.fe9548"],["a412519d.8b225"]]},{"id":"a412519d.8b225","type":"function","z":"ced394cd.07a138","name":"Throw time error","func":"throw(\"Invalid Time Defined. Time must be between 1 and 255, or blank if measure of time is forever. You supplied: \" + msg.total_time)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1720,"y":1560,"wires":[]},{"id":"beedc17a.35662","type":"change","z":"ced394cd.07a138","name":"Set msg.measure_time","rules":[{"t":"set","p":"measure_time","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"measure_time","pt":"msg","to":"measure_time","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":870,"y":1440,"wires":[["bf806ca.915109"]]},{"id":"9237fb11.fe9548","type":"switch","z":"ced394cd.07a138","name":"Is measure_time forever?","property":"measure_time","propertyType":"msg","rules":[{"t":"eq","v":"forever","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1770,"y":1500,"wires":[["ff1489b9.2a33e8"],["19e5d46b.660abc"]]},{"id":"19e5d46b.660abc","type":"function","z":"ced394cd.07a138","name":"Throw time error","func":"throw(\"Time can only be blank if measure_time is set to forever. Please define a value for total_time or change measure_time to forever and try again.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1980,"y":1560,"wires":[]},{"id":"641b2be0.2e6764","type":"function","z":"ced394cd.07a138","name":"Set random time","func":"var rand = Math.floor(Math.random() * 255) + 1;\n\nmsg.total_time = {};\nmsg.total_time = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1720,"y":1380,"wires":[["ff1489b9.2a33e8"]]},{"id":"98f8c9ca.731868","type":"function","z":"ced394cd.07a138","name":"Calculate for Random","func":"var rand = parseInt(msg.total_time)\n\nmsg.time = {};\nmsg.time = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2380,"y":1480,"wires":[["c66288ba.effca8"]]},{"id":"e5ff5c32.53818","type":"function","z":"ced394cd.07a138","name":"Set random effect","func":"var rand = Math.floor(Math.random() * 5) + 1;\n\nmsg.effect = {};\nmsg.effect = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2060,"wires":[["4a754925.93f358"]]},{"id":"387f188b.b8e878","type":"change","z":"ced394cd.07a138","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":440,"y":400,"wires":[["48c115b1.a1cdcc"]]},{"id":"3cfa6e8f.ecce52","type":"switch","z":"ced394cd.07a138","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":1090,"y":400,"wires":[["4b16dd5f.e88624"],["d763fdc8.f1ebf"],["ac4e743d.fcec78"]]},{"id":"ac4e743d.fcec78","type":"function","z":"ced394cd.07a138","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":1370,"y":480,"wires":[]},{"id":"48c115b1.a1cdcc","type":"function","z":"ced394cd.07a138","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":740,"y":400,"wires":[["3cfa6e8f.ecce52"]]},{"id":"4b16dd5f.e88624","type":"change","z":"ced394cd.07a138","name":"Set device ID","rules":[{"t":"set","p":"node","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"node","pt":"msg","to":"device_id","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":1350,"y":320,"wires":[["b55ed425.618328"]]},{"id":"78119ef8.149e2","type":"change","z":"ced394cd.07a138","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":1930,"y":400,"wires":[["3993c503.2a334a","ce2b44ff.566188"]]},{"id":"d763fdc8.f1ebf","type":"ha-get-entities","z":"ced394cd.07a138","name":"Get all Inovelli switches","server":"497693ef.d5e6bc","version":0,"rules":[{"property":"entity_id","logic":"in_group","value":"group.inovelli_switches","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":1390,"y":400,"wires":[["548017f8.8fc668"]]},{"id":"548017f8.8fc668","type":"split","z":"ced394cd.07a138","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1590,"y":400,"wires":[["36b39b6b.69adc4"]]},{"id":"36b39b6b.69adc4","type":"delay","z":"ced394cd.07a138","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"0.01","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1750,"y":400,"wires":[["78119ef8.149e2"]]},{"id":"cc4fff5d.2c35a","type":"function","z":"ced394cd.07a138","name":"Throw permanence error","func":"throw(\"Invalid selection for is_permanent. Valid entries are yes (permanent change) or no (this is a notification). You provided: \" + msg.ispermanent)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1170,"y":780,"wires":[]},{"id":"e83f8a25.9ee728","type":"switch","z":"ced394cd.07a138","name":"Is this change permanent?","property":"ispermanent","propertyType":"msg","rules":[{"t":"eq","v":"no","vt":"str"},{"t":"eq","v":"yes","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":900,"y":740,"wires":[["ca30863e.3b3f18"],["6b7bedfd.f99d94"],["cc4fff5d.2c35a"]]},{"id":"dccff49c.686cf8","type":"join","z":"ced394cd.07a138","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":3170,"y":2220,"wires":[[]]},{"id":"280109e1.7dd616","type":"switch","z":"ced394cd.07a138","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":3140,"y":2140,"wires":[[],["dccff49c.686cf8"]]},{"id":"208ad7a9.681698","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":2090,"y":1100,"wires":[["f7f6c719.08b8a8"],["a5241186.7274d"],["652d0e43.7d5dd"],["5397edc9.817994"],["7e3465a4.fee7dc"]]},{"id":"f7f6c719.08b8a8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 13 (dimmer)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"13","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2410,"y":1000,"wires":[["f55f6e2a.9a6e"]]},{"id":"7e3465a4.fee7dc","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2370,"y":1200,"wires":[]},{"id":"4ed0e38e.d53aac","type":"change","z":"ced394cd.07a138","name":"Set Switch Type","rules":[{"t":"set","p":"switch","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"switch","pt":"msg","to":"switch_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":1100,"wires":[["aec81b3c.aa42c8"]]},{"id":"aec81b3c.aa42c8","type":"function","z":"ced394cd.07a138","name":"Correct value for switch if needed","func":"msg.switch = msg.switch.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":1100,"wires":[["4bfc94ec.ec9a5c"]]},{"id":"f55f6e2a.9a6e","type":"change","z":"ced394cd.07a138","name":"Set msg.calculation","rules":[{"t":"set","p":"calculation","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"calculation","pt":"msg","to":"color","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2650,"y":1080,"wires":[["190b03a.0f6b4fc"]]},{"id":"28fb6ee7.af7092","type":"change","z":"ced394cd.07a138","name":"Set msg.offbright","rules":[{"t":"set","p":"offbright","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"offbright","pt":"msg","to":"off_brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":2840,"wires":[["eed01666.fa20c8"]]},{"id":"eed01666.fa20c8","type":"function","z":"ced394cd.07a138","name":"Correct value for offbright if needed","func":"msg.offbright = msg.offbright.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":2840,"wires":[["c0ea2e78.2a6c8"]]},{"id":"8c493c95.38053","type":"change","z":"ced394cd.07a138","name":"Set msg.onbright","rules":[{"t":"set","p":"onbright","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"onbright","pt":"msg","to":"on_brightness","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":2600,"wires":[["7756c42c.28689c"]]},{"id":"7756c42c.28689c","type":"function","z":"ced394cd.07a138","name":"Correct value for onbright if needed","func":"msg.onbright = msg.onbright.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":2600,"wires":[["bd5bac16.10df9"]]},{"id":"c0ea2e78.2a6c8","type":"switch","z":"ced394cd.07a138","name":"Is off_brightness between 1 and 10?","property":"offbright","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1590,"y":2840,"wires":[["35b081c6.950bee"],[],["13288cce.42ac03"]]},{"id":"bd5bac16.10df9","type":"switch","z":"ced394cd.07a138","name":"Is on_brightness between 1 and 10?","property":"onbright","propertyType":"msg","rules":[{"t":"btwn","v":"1","vt":"num","v2":"10","v2t":"num"},{"t":"empty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1590,"y":2600,"wires":[["824dbf13.5af8e"],[],["68f11a70.274fb4"]]},{"id":"cbff6a4d.ab1e98","type":"join","z":"ced394cd.07a138","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":3190,"y":2700,"wires":[[]]},{"id":"7b15da79.7a5874","type":"switch","z":"ced394cd.07a138","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":3160,"y":2800,"wires":[[],["d56c5d09.c3c6e"]]},{"id":"c688ddb9.ac587","type":"switch","z":"ced394cd.07a138","name":"Single node or group?","property":"singleorgroup","propertyType":"msg","rules":[{"t":"eq","v":"single","vt":"str"},{"t":"eq","v":"group","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":3160,"y":2620,"wires":[[],["cbff6a4d.ab1e98"]]},{"id":"385c0b27.521f24","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1990,"y":2920,"wires":[]},{"id":"a2f806fd.9da5a8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 19 (combo_light)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"19","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2360,"y":2600,"wires":[["fa33dfb6.6358c"]]},{"id":"fbab1076.c7166","type":"function","z":"ced394cd.07a138","name":"Throw switch error","func":"throw(\"Invalid Switch Defined. Switch must either be a dimmer, switch, combo_light, or combo_fan. You supplied: \" + msg.switch)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1970,"y":2680,"wires":[]},{"id":"652d0e43.7d5dd","type":"function","z":"ced394cd.07a138","name":"Set Parameter 18 to Calculation (combo_light)","func":"var hue = parseInt(msg.color);\n\nmsg.parameter = {};\nmsg.parameter = 18;\n\nmsg.calculation = {};\nmsg.calculation = parseInt(hue / 255 * 350);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2460,"y":1120,"wires":[["190b03a.0f6b4fc"]]},{"id":"3993c503.2a334a","type":"change","z":"ced394cd.07a138","name":"Set Switch Type","rules":[{"t":"set","p":"switch","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"switch","pt":"msg","to":"switch_type","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":2720,"wires":[["4c119950.cea458"]]},{"id":"4c119950.cea458","type":"function","z":"ced394cd.07a138","name":"Correct value for switch if needed","func":"msg.switch = msg.switch.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":700,"y":2720,"wires":[["28fb6ee7.af7092","8c493c95.38053"]]},{"id":"13288cce.42ac03","type":"function","z":"ced394cd.07a138","name":"Throw offbright error","func":"throw(\"Invalid Off Brightness Defined. Value must be between 1 and 10, or blank. You supplied: \" + msg.offbright)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1640,"y":2900,"wires":[]},{"id":"68f11a70.274fb4","type":"function","z":"ced394cd.07a138","name":"Throw onbright error","func":"throw(\"Invalid On Brightness Defined. Value must be between 1 and 10, or blank. You supplied: \" + msg.onbright)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1640,"y":2660,"wires":[]},{"id":"d56c5d09.c3c6e","type":"join","z":"ced394cd.07a138","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":"false","timeout":"","count":"","reduceRight":false,"x":3190,"y":2880,"wires":[[]]},{"id":"d4bdbb6f.224108","type":"function","z":"ced394cd.07a138","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":1950,"y":320,"wires":[]},{"id":"61de5933.0f9dd8","type":"comment","z":"ced394cd.07a138","name":"On/Off Brightness Set","info":"","x":1540,"y":2500,"wires":[]},{"id":"a597a01b.bdfe3","type":"comment","z":"ced394cd.07a138","name":"Set Permanent Color","info":"","x":2340,"y":880,"wires":[]},{"id":"190b03a.0f6b4fc","type":"api-call-service","z":"ced394cd.07a138","name":"Set ZWaveJS Notification","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\": msg.parameter,    \t    \"value\": msg.calculation\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2870,"y":2140,"wires":[["280109e1.7dd616"]]},{"id":"2d152983.12d8b6","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"eq","v":"switch","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1430,"y":2120,"wires":[["7040998f.d28a98"],["7040998f.d28a98"],["7040998f.d28a98"],["fa221846.cfe7c8"]]},{"id":"a3ffebf5.ed6b58","type":"function","z":"ced394cd.07a138","name":"Throw chase effect error","func":"throw(\"Switches cannot use the Chase effect. Please define another effect and try again.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2190,"y":2400,"wires":[]},{"id":"fa221846.cfe7c8","type":"switch","z":"ced394cd.07a138","name":"Which effect was defined?","property":"effect","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"solid","vt":"str"},{"t":"eq","v":"fast_blink","vt":"str"},{"t":"eq","v":"slow_blink","vt":"str"},{"t":"eq","v":"blink","vt":"str"},{"t":"eq","v":"pulse","vt":"str"},{"t":"eq","v":"breath","vt":"str"},{"t":"eq","v":"random","vt":"str"},{"t":"eq","v":"chase","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":10,"x":1710,"y":2280,"wires":[["82695a04.b00148"],["7a523732.1cf438"],["36311aa4.228166"],["fe852e0d.7df8d"],["fe852e0d.7df8d"],["8d12b5e4.70ec88"],["8d12b5e4.70ec88"],["69273ae6.26f3f4"],["a3ffebf5.ed6b58"],[]]},{"id":"7a523732.1cf438","type":"change","z":"ced394cd.07a138","name":"Set effect to 1","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2200,"wires":[["4a754925.93f358"]]},{"id":"82695a04.b00148","type":"change","z":"ced394cd.07a138","name":"Set effect to 0","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"0","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2160,"wires":[["4a754925.93f358"]]},{"id":"fe852e0d.7df8d","type":"change","z":"ced394cd.07a138","name":"Set effect to 3","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2280,"wires":[["4a754925.93f358"]]},{"id":"8d12b5e4.70ec88","type":"change","z":"ced394cd.07a138","name":"Set effect to 4","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"4","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2320,"wires":[["4a754925.93f358"]]},{"id":"69273ae6.26f3f4","type":"function","z":"ced394cd.07a138","name":"Set random effect","func":"var rand = Math.floor(Math.random() * 5) + 1;\n\nmsg.effect = {};\nmsg.effect = parseInt(rand);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2170,"y":2360,"wires":[["4a754925.93f358"]]},{"id":"bd14b20a.9cd69","type":"comment","z":"ced394cd.07a138","name":"Define Effect On/Off Switch","info":"","x":1710,"y":2140,"wires":[]},{"id":"56a85fe6.70732","type":"comment","z":"ced394cd.07a138","name":"Define Effect All Other Switches","info":"","x":1710,"y":1820,"wires":[]},{"id":"36311aa4.228166","type":"change","z":"ced394cd.07a138","name":"Set effect to 2","rules":[{"t":"set","p":"effect","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"effect","pt":"msg","to":"2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2160,"y":2240,"wires":[["4a754925.93f358"]]},{"id":"fb0be354.bad6c","type":"comment","z":"ced394cd.07a138","name":"Define Time","info":"","x":1270,"y":1300,"wires":[]},{"id":"870f1804.cbbb58","type":"comment","z":"ced394cd.07a138","name":"Define Brightness","info":"","x":1490,"y":640,"wires":[]},{"id":"7c075f15.51bfc","type":"comment","z":"ced394cd.07a138","name":"Define Color","info":"","x":1390,"y":1000,"wires":[]},{"id":"cd542bce.675398","type":"comment","z":"ced394cd.07a138","name":"Define Notification Parameter","info":"","x":580,"y":1900,"wires":[]},{"id":"abe01825.67c988","type":"api-call-service","z":"ced394cd.07a138","name":"Set ZWaveJS Notification","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    \"command_class\": 112,\t    \"endpoint\": 0,\t    \"property\": msg.parameter,    \t    \"value\": msg.offbright\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2870,"y":2820,"wires":[["7b15da79.7a5874"]]},{"id":"fa33dfb6.6358c","type":"api-call-service","z":"ced394cd.07a138","name":"Set ZWaveJS Notification","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\": msg.parameter,    \t    \"value\": msg.onbright\t}","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2870,"y":2600,"wires":[["c688ddb9.ac587"]]},{"id":"fda28d12.be4d3","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 22 (combo_light)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"22","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2360,"y":2840,"wires":[["abe01825.67c988"]]},{"id":"5816bfbc.f4a31","type":"comment","z":"ced394cd.07a138","name":"Main Calculation","info":"","x":2560,"y":2040,"wires":[]},{"id":"b55ed425.618328","type":"switch","z":"ced394cd.07a138","name":"Make sure there's a device defined","property":"node","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1600,"y":320,"wires":[["3993c503.2a334a","ce2b44ff.566188"],["d4bdbb6f.224108"]]},{"id":"343233db.d0313c","type":"function","z":"ced394cd.07a138","name":"Throw color error","func":"throw(\"Invalid Color Selected. Color cannot be blank.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":510,"y":1040,"wires":[]},{"id":"f9b0a5d0.3d69c8","type":"function","z":"ced394cd.07a138","name":"Correct value for ispermanent if needed","func":"msg.ispermanent = msg.ispermanent.trim().replace(/\\ /g, \"_\").toLowerCase();\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":580,"y":740,"wires":[["e83f8a25.9ee728"]]},{"id":"ce2b44ff.566188","type":"change","z":"ced394cd.07a138","name":"Set msg.ispermanent","rules":[{"t":"set","p":"ispermanent","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"ispermanent","pt":"msg","to":"is_permanent","tot":"env"}],"action":"","property":"","from":"","to":"","reg":false,"x":280,"y":740,"wires":[["f9b0a5d0.3d69c8"]]},{"id":"e1c997bd.a509e8","type":"comment","z":"ced394cd.07a138","name":"Check if permanent or not","info":"","x":730,"y":640,"wires":[]},{"id":"4bfc94ec.ec9a5c","type":"switch","z":"ced394cd.07a138","name":"Is this change permanent?","property":"ispermanent","propertyType":"msg","rules":[{"t":"eq","v":"yes","vt":"str"},{"t":"eq","v":"no","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1500,"y":1100,"wires":[["208ad7a9.681698"],["93d0dd4e.55bfe"],["a27f8ab5.11ef28"]]},{"id":"a27f8ab5.11ef28","type":"function","z":"ced394cd.07a138","name":"Throw permanence error","func":"throw(\"Invalid selection for is_permanent. Valid entries are yes (permanent change) or no (this is a notification). You provided: \" + msg.ispermanent)\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1750,"y":1160,"wires":[]},{"id":"a5241186.7274d","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 5 (switch)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"5","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2400,"y":1040,"wires":[["f55f6e2a.9a6e"]]},{"id":"35b081c6.950bee","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":1950,"y":2840,"wires":[["92d23623.63edf8"],["f1d1beb0.cfe7a"],["fda28d12.be4d3"],["109b9bf9.7b6e14"],["385c0b27.521f24"]]},{"id":"824dbf13.5af8e","type":"switch","z":"ced394cd.07a138","name":"What switch type was defined?","property":"switch","propertyType":"msg","rules":[{"t":"eq","v":"dimmer","vt":"str"},{"t":"eq","v":"switch","vt":"str"},{"t":"eq","v":"combo_light","vt":"str"},{"t":"eq","v":"combo_fan","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":5,"x":1930,"y":2600,"wires":[["b0108f40.b9254"],["f679017f.03cdc"],["a2f806fd.9da5a8"],["dba05209.17825"],["fbab1076.c7166"]]},{"id":"5397edc9.817994","type":"function","z":"ced394cd.07a138","name":"Set Parameter 20 to Calculation (combo_fan)","func":"var hue = parseInt(msg.color);\n\nmsg.parameter = {};\nmsg.parameter = 20;\n\nmsg.calculation = {};\nmsg.calculation = parseInt(hue / 255 * 350);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2450,"y":1160,"wires":[["190b03a.0f6b4fc"]]},{"id":"109b9bf9.7b6e14","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 23 (combo_fan)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"23","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2360,"y":2880,"wires":[["abe01825.67c988"]]},{"id":"dba05209.17825","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 21 (combo_fan)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"21","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2360,"y":2640,"wires":[["fa33dfb6.6358c"]]},{"id":"92d23623.63edf8","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 15 (dimmer)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"15","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2350,"y":2760,"wires":[["abe01825.67c988"]]},{"id":"f1d1beb0.cfe7a","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 7 (switch)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"7","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2340,"y":2800,"wires":[["abe01825.67c988"]]},{"id":"b0108f40.b9254","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 14 (dimmer)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"14","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2350,"y":2520,"wires":[["fa33dfb6.6358c"]]},{"id":"f679017f.03cdc","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 6 (switch)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"6","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":2340,"y":2560,"wires":[["fa33dfb6.6358c"]]},{"id":"fc9836f9.fe0f28","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 24 (combo_light)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"24","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":2160,"wires":[["ff608c9a.bbf18"]]},{"id":"a1bb956f.4b7528","type":"change","z":"ced394cd.07a138","name":"Set Parameter to 25 (combo_fan)","rules":[{"t":"set","p":"parameter","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"parameter","pt":"msg","to":"25","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":2200,"wires":[["ff608c9a.bbf18"]]},{"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":"3c9a87491c4e0116","type":"subflow:ced394cd.07a138","z":"8d583c8fd0c52241","name":"","x":860,"y":520,"wires":[[]]},{"id":"ad17e53b7e96b815","type":"inject","z":"8d583c8fd0c52241","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":600,"y":520,"wires":[["3c9a87491c4e0116"]]}]
1 Like