With the assistance of one of my good friends, I’ve finally finished putting together a couple different node red subflows for use with the new LZW45 light strip. The first one will pull all of your light strips from a group titled “group.inovelli_led_strips”. It will take every lightstrip within this group and set it to the brightness and pixel effect of your choice (defined on the subflow itself). Simply double click the subflow, enter in a value between 1-99 for brightness and 1-46 for pixel effect, then attach the subflow to your automation. It will calculate the correct number for the effect you’re attempting to set.
Set Pixel effect of a Group:
[{"id":"ca7050b9.e2978","type":"subflow","name":"Set Pixel Effect of a Group","info":"","category":"","in":[{"x":120,"y":240,"wires":[{"id":"be42716.a8b289"}]}],"out":[{"x":1420,"y":340,"wires":[{"id":"f1dd549a.8bdb08","port":0}]}],"env":[{"name":"brightness","type":"num","value":""},{"name":"pixel_effect","type":"num","value":""}],"color":"#DDAA99","status":{"x":280,"y":160,"wires":[{"id":"32a7fb8e.cdc894","port":0}]}},{"id":"3fd7e9a4.af9616","type":"function","z":"ca7050b9.e2978","name":"Throw Value Error","func":"throw(\"Invalid Brightness Intensity. Value must be a number between 1 and 99.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":490,"y":420,"wires":[]},{"id":"32a7fb8e.cdc894","type":"status","z":"ca7050b9.e2978","name":"","scope":null,"x":160,"y":160,"wires":[[]]},{"id":"97ca420d.05be5","type":"function","z":"ca7050b9.e2978","name":"Throw Color Error","func":"throw(\"Invalid Pixel Effect. Value must be a number between 1 and 46.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":910,"y":420,"wires":[]},{"id":"f1dd549a.8bdb08","type":"join","z":"ca7050b9.e2978","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1310,"y":340,"wires":[[]]},{"id":"be42716.a8b289","type":"ha-get-entities","z":"ca7050b9.e2978","server":"497693ef.d5e6bc","name":"Get all LED Strips","rules":[{"property":"entity_id","logic":"in_group","value":"group.inovelli_led_strips","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":270,"y":240,"wires":[["8b27cdb4.77cff"]]},{"id":"42e84d13.84f1b4","type":"switch","z":"ca7050b9.e2978","name":"Check if Pixel Effect choice is valid","property":"pixel_effect","propertyType":"env","rules":[{"t":"btwn","v":"1","vt":"num","v2":"46","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":620,"y":360,"wires":[["513c6cf2.0e3934"],["97ca420d.05be5"]]},{"id":"8f4f377d.4b7e98","type":"switch","z":"ca7050b9.e2978","name":"Check if Pixel Effect choice is valid","property":"brightness","propertyType":"env","rules":[{"t":"btwn","v":"1","vt":"num","v2":"99","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":240,"y":360,"wires":[["42e84d13.84f1b4"],["3fd7e9a4.af9616"]]},{"id":"513c6cf2.0e3934","type":"function","z":"ca7050b9.e2978","name":"Calculate pixel effect","func":"var pixelEffect = parseInt(env.get(\"pixel_effect\"));\nvar brightness = parseInt(env.get(\"brightness\"));\n\nmsg.value = {};\nmsg.value = ((brightness * 256) + pixelEffect);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":920,"y":340,"wires":[["7ce415a1.df09bc"]]},{"id":"8b27cdb4.77cff","type":"split","z":"ca7050b9.e2978","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":450,"y":240,"wires":[["dd80f5f8.7a4868"]]},{"id":"dd80f5f8.7a4868","type":"delay","z":"ca7050b9.e2978","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"0.25","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":610,"y":240,"wires":[["35c319cc.d8de56"]]},{"id":"35c319cc.d8de56","type":"change","z":"ca7050b9.e2978","name":"Set Node Id in Payload","rules":[{"t":"set","p":"payload.node_id","pt":"msg","to":"payload.attributes.node_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":820,"y":240,"wires":[["8f4f377d.4b7e98"]]},{"id":"7ce415a1.df09bc","type":"api-call-service","z":"ca7050b9.e2978","name":"Set Pixel Effect","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service_domain":"ozw","service":"set_config_parameter","entityId":"","data":"{\t \"node_id\":msg.payload.node_id,\t \"parameter\":31,\t \"value\":msg.value\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1140,"y":340,"wires":[["f1dd549a.8bdb08"]]},{"id":"341ba468.47fb4c","type":"comment","z":"ca7050b9.e2978","name":"Pull Pixel Effect, Brightness Values and Node Information","info":"","x":830,"y":60,"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":"5343703a.ffe37","type":"subflow:ca7050b9.e2978","z":"f1e1b905.e9a56","name":"","env":[{"name":"brightness","value":"99","type":"str"},{"name":"pixel_effect","value":"45","type":"str"}],"x":800,"y":320,"wires":[[]]}]
And some screenshots of the subflow itself:
The second subflow will work by manually adding in the node ID of your light strip. This would work better if you’re attempting to avoid groups and/or just have one light strip.
Set Pixel Effect of a Single Node:
[{"id":"9f38d792.8a5038","type":"subflow","name":"Set Pixel Effect of a Single Node","info":"","category":"","in":[{"x":120,"y":240,"wires":[{"id":"9d164d05.2a9a8"}]}],"out":[{"x":780,"y":440,"wires":[{"id":"5d6cad29.be2ad4","port":0}]}],"env":[{"name":"brightness","type":"num","value":""},{"name":"pixel_effect","type":"num","value":""},{"name":"node_id","type":"num","value":""}],"color":"#DDAA99","status":{"x":280,"y":160,"wires":[{"id":"c92a48fc.742ef8","port":0}]}},{"id":"280c685d.6858b8","type":"function","z":"9f38d792.8a5038","name":"Throw Value Error","func":"throw(\"Invalid Brightness Intensity. Value must be a number between 1 and 99.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":570,"y":300,"wires":[]},{"id":"c92a48fc.742ef8","type":"status","z":"9f38d792.8a5038","name":"","scope":null,"x":160,"y":160,"wires":[[]]},{"id":"4ffd875e.67b128","type":"function","z":"9f38d792.8a5038","name":"Throw Color Error","func":"throw(\"Invalid Pixel Effect. Value must be a number between 1 and 46.\")\nreturn msg;","outputs":0,"noerr":0,"initialize":"","finalize":"","x":930,"y":300,"wires":[]},{"id":"2237c494.10057c","type":"switch","z":"9f38d792.8a5038","name":"Check if Pixel Effect choice is valid","property":"pixel_effect","propertyType":"env","rules":[{"t":"btwn","v":"1","vt":"num","v2":"46","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":680,"y":240,"wires":[["13445159.b7ca9f"],["4ffd875e.67b128"]]},{"id":"9d164d05.2a9a8","type":"switch","z":"9f38d792.8a5038","name":"Check if Pixel Effect choice is valid","property":"brightness","propertyType":"env","rules":[{"t":"btwn","v":"1","vt":"num","v2":"99","v2t":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":320,"y":240,"wires":[["2237c494.10057c"],["280c685d.6858b8"]]},{"id":"13445159.b7ca9f","type":"function","z":"9f38d792.8a5038","name":"Calculate pixel effect","func":"var pixelEffect = parseInt(env.get(\"pixel_effect\"));\nvar brightness = parseInt(env.get(\"brightness\"));\nvar nodeid = parseInt(env.get(\"node_id\"));\n\nmsg.value = {};\nmsg.value = ((brightness * 256) + pixelEffect);\n\nmsg.node = {};\nmsg.node = (nodeid);\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":420,"y":440,"wires":[["5d6cad29.be2ad4"]]},{"id":"5d6cad29.be2ad4","type":"api-call-service","z":"9f38d792.8a5038","name":"Set Pixel Effect","server":"497693ef.d5e6bc","version":1,"debugenabled":false,"service_domain":"ozw","service":"set_config_parameter","entityId":"","data":"{\t \"node_id\":msg.node,\t \"parameter\":31,\t \"value\":msg.value\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":640,"y":440,"wires":[[]]},{"id":"4b770613.d72eb8","type":"comment","z":"9f38d792.8a5038","name":"Pull Pixel Effect, Brightness Values and Node Information","info":"","x":610,"y":120,"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":"ab1a2c4b.d8fbb","type":"subflow:9f38d792.8a5038","z":"f1e1b905.e9a56","name":"","env":[{"name":"brightness","value":"99","type":"num"},{"name":"pixel_effect","value":"46","type":"num"},{"name":"node_id","value":"29","type":"num"}],"x":810,"y":260,"wires":[[]]}]
And some more screenshots:
I’m not the best at all with Javascript and as such the function may not be the prettiest or most optimized, but it works. For those of you interested, feel free to build upon this or optimize it however you’d like. It’s come in handy for me a few times setting different effects for different automations I have at home, so wanted to share it with others.
If you have any questions let me know.