The looptimer has a max number of times it will run, which is configurable. I think I have it set to run up to 10 times if it never receives a STOP event. I don’t recall having major issues with the loop getting hung up but I guess that could happen depending on when the hub receives the release signal. It’s a little delayed but works well enough for my purposes, most of my control is through automation so the actual switch doesn’t get a ton of use.
Actually, the 2 switches I use for this are actually Zooz switches but they should fire the same events as Inovelli, I think. I could try my Inovelli switches with the same setup if you have any issues.
The “Release detected - stop loop” node just sends the STOP event to the looptimer.
“Set dim percentage” is just a simple script that looks at the scene_id event (up or down button on zwave switch) to determine whether to dim up or down. In my case, I set it to increase/decrease by 15% every 0.5 seconds.
var updown = msg.payload.event.scene_id;
if(updown == 2){
msg.dim = 15;
} else { msg.dim = -15;}
return msg;
Here is the section of my node red flow that you can copy into your flow:
[{"id":"b842f142.b478b","type":"switch","z":"9118dec7.3d9168","name":"Side","property":"payload.event.scene_id","propertyType":"msg","rules":[{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"3","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":90,"y":300,"wires":[["9dc35dff.4087f"],["b4c99307.5e719"],[]]},{"id":"b4c99307.5e719","type":"switch","z":"9118dec7.3d9168","name":"Down: 1x, 2x, 3x, 4x, 5x, Hold, Release","property":"payload.event.scene_data","propertyType":"msg","rules":[{"t":"eq","v":"7680","vt":"str"},{"t":"eq","v":"7860","vt":"num"},{"t":"eq","v":"7920","vt":"num"},{"t":"eq","v":"7980","vt":"str"},{"t":"eq","v":"8040","vt":"str"},{"t":"eq","v":"7800","vt":"str"},{"t":"eq","v":"7740","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":540,"y":360,"wires":[["6e2f00a9.5277b"],[],[],[],[],["686a3ce0.8addfc"],["c8444d31.8fc09"]]},{"id":"9dc35dff.4087f","type":"switch","z":"9118dec7.3d9168","name":"Up: 1x, 2x, 3x, 4x, 5x, Hold, Release","property":"payload.event.scene_data","propertyType":"msg","rules":[{"t":"eq","v":"7680","vt":"str"},{"t":"eq","v":"7860","vt":"num"},{"t":"eq","v":"7920","vt":"num"},{"t":"eq","v":"7980","vt":"str"},{"t":"eq","v":"8040","vt":"str"},{"t":"eq","v":"7800","vt":"str"},{"t":"eq","v":"7740","vt":"str"}],"checkall":"true","repair":false,"outputs":7,"x":540,"y":240,"wires":[["91d26336.38b638"],[],[],[],[],["686a3ce0.8addfc"],["c8444d31.8fc09"]]},{"id":"686a3ce0.8addfc","type":"looptimer","z":"9118dec7.3d9168","duration":"0.5","units":"Second","maxloops":"10","maxtimeout":"5","maxtimeoutunits":"Second","name":"","x":1090,"y":340,"wires":[["cea05663.16e6e"],[]]},{"id":"c8444d31.8fc09","type":"change","z":"9118dec7.3d9168","name":"Release detected - stop loop","rules":[{"t":"set","p":"payload","pt":"msg","to":"STOP","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":930,"y":420,"wires":[["686a3ce0.8addfc"]]},{"id":"cea05663.16e6e","type":"function","z":"9118dec7.3d9168","name":"Set Dim Percentage","func":"var updown = msg.payload.event.scene_id;\nif(updown == 2){\n msg.dim = 15;\n} else { msg.dim = -15;}\nreturn msg;","outputs":1,"noerr":0,"x":1320,"y":340,"wires":[["675af41c.9677fc","398c5d00.a014f4"]]},{"id":"91d26336.38b638","type":"api-call-service","z":"9118dec7.3d9168","name":"Turn on Living Room Lamp","server":"aa6a5a1a.ff80a8","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.living_room","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":180,"wires":[[]]},{"id":"6e2f00a9.5277b","type":"api-call-service","z":"9118dec7.3d9168","name":"Turn off Living Room Lamp","server":"aa6a5a1a.ff80a8","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.living_room","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":260,"wires":[[]]},{"id":"398c5d00.a014f4","type":"debug","z":"9118dec7.3d9168","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1530,"y":460,"wires":[]},{"id":"675af41c.9677fc","type":"api-call-service","z":"9118dec7.3d9168","name":"Living Room Dim Light Up/Down","server":"aa6a5a1a.ff80a8","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.living_room","data":"{\"brightness_step_pct\":\"{{dim}}\",\"transition\":0.5}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1620,"y":340,"wires":[[]]},{"id":"aa6a5a1a.ff80a8","type":"server","z":"","name":"Home Assistant","addon":true}]
Let me know how it works out for you or if you find any improvements.