Here’s a subflow that I use. It could stand to be refactored and the node.log statements removed.
[{"id":"6013efbe.3a657","type":"function","z":"b805b5cc.a88948","name":"z-wave scene","func":"if (msg.payload.event_type != \"zwave.scene_activated\")\n return null;\n\nvar scene_id = msg.payload.event.scene_id;\nvar scene_data = msg.payload.event.scene_data;\nvar scene_state = scene_id == 1 ? \"on\" : \"off\";\nvar scene_action = \"\"; var scene_tap; var scene_hold = false; var scene_release = false;\nswitch(scene_data) {\n case 0:\n case 7680:\n scene_action = \"Single tap\";\n scene_tap = 1;\n break;\n case 1:\n case 7740:\n scene_action = \"Release\";\n scene_release = true;\n break;\n case 2:\n case 7800:\n scene_action = \"Tap and hold\";\n scene_hold = true;\n break;\n case 3:\n case 7860:\n scene_action = \"Double tap\";\n scene_tap = 2;\n break;\n case 4: \n case 7920:\n scene_action = \"Triple tap\";\n scene_tap = 3;\n break;\n case 7980:\n scene_action = \"Four tap\";\n scene_tap = 4;\n break;\n case 8040:\n scene_action = \"five tap\";\n scene_tap = 5;\n break;\n}\n\nvar entity_id = msg.payload.event.entity_id;\n\nmsg.payload = {\n old: msg.payload,\n node_id: msg.payload.event.node_id,\n entity_id : entity_id,\n scene_state: scene_state,\n scene_tap: scene_tap,\n scene_hold: scene_hold,\n scene_release: scene_release,\n scene_action: scene_action + \" \" + scene_state\n};\n\nflow.set('scene', msg.payload);\n\nreturn msg;\n \n// Action\t scene_id\tscene_data\n// Single tap on\t 1\t 0\n// Single tap off\t 2\t 0\n// Double tap on\t 1\t 3\n// Double tap off\t 2\t 3\n// Triple tap on\t 1\t 4\n// Triple tap off\t 2\t 4\n// Tap and hold on\t 1\t 2\n// Tap and hold off\t 2\t 2\n","outputs":1,"noerr":0,"x":220,"y":100,"wires":[["ce5b671c.dcfb98"]]},{"id":"ce5b671c.dcfb98","type":"function","z":"b805b5cc.a88948","name":"Parse Request","func":"var scene = flow.get('scene');\nvar id = scene.node_id;\nnode.log('id: ' + id);\nnode.log('entity_id: ' + scene.entity_id);\nvar nodes = global.get(\"zwave-lights\");\nvar matchingNode = nodes.find(x => x.node_id === id);\n\nnode.log('match: ' + JSON.stringify(matchingNode));\nnode.log('match id: ' + matchingNode.node_id);\nnode.log('match entity_id: ' + matchingNode.entity_id);\n\nvar match = { \n entity_id: matchingNode.entity_id, \n node_id: matchingNode.node_id,\n scene: scene.scene_action\n };\nmsg.payload = match;\nreturn msg; \n\n\n","outputs":1,"noerr":0,"x":400,"y":100,"wires":[[]]},{"id":"fe4de5f1.b531f8","type":"server-events","z":"b805b5cc.a88948","name":"Scene","server":"3b1a3739.f37638","event_type":"zwave.scene_activated","x":70,"y":80,"wires":[["d725b7ff.7f4c28","6013efbe.3a657"]]},{"id":"3b1a3739.f37638","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
And then here’s an automation that uses the scene subflow.
[{"id":"b805b5cc.a88948","type":"subflow","name":"Z-Wave Scene","info":"","in":[],"out":[{"x":520,"y":100,"wires":[{"id":"ce5b671c.dcfb98","port":0}]}]},{"id":"e31cddcc.41ea1","type":"comment","z":"b805b5cc.a88948","name":"Scene","info":"","x":70,"y":20,"wires":[]},{"id":"6013efbe.3a657","type":"function","z":"b805b5cc.a88948","name":"z-wave scene","func":"if (msg.payload.event_type != \"zwave.scene_activated\")\n return null;\n\nvar scene_id = msg.payload.event.scene_id;\nvar scene_data = msg.payload.event.scene_data;\nvar scene_state = scene_id == 1 ? \"on\" : \"off\";\nvar scene_action = \"\"; var scene_tap; var scene_hold = false; var scene_release = false;\nswitch(scene_data) {\n case 0:\n case 7680:\n scene_action = \"Single tap\";\n scene_tap = 1;\n break;\n case 1:\n case 7740:\n scene_action = \"Release\";\n scene_release = true;\n break;\n case 2:\n case 7800:\n scene_action = \"Tap and hold\";\n scene_hold = true;\n break;\n case 3:\n case 7860:\n scene_action = \"Double tap\";\n scene_tap = 2;\n break;\n case 4: \n case 7920:\n scene_action = \"Triple tap\";\n scene_tap = 3;\n break;\n case 7980:\n scene_action = \"Four tap\";\n scene_tap = 4;\n break;\n case 8040:\n scene_action = \"five tap\";\n scene_tap = 5;\n break;\n}\n\nvar entity_id = msg.payload.event.entity_id;\n\nmsg.payload = {\n old: msg.payload,\n node_id: msg.payload.event.node_id,\n entity_id : entity_id,\n scene_state: scene_state,\n scene_tap: scene_tap,\n scene_hold: scene_hold,\n scene_release: scene_release,\n scene_action: scene_action + \" \" + scene_state\n};\n\nflow.set('scene', msg.payload);\n\nreturn msg;\n \n// Action\t scene_id\tscene_data\n// Single tap on\t 1\t 0\n// Single tap off\t 2\t 0\n// Double tap on\t 1\t 3\n// Double tap off\t 2\t 3\n// Triple tap on\t 1\t 4\n// Triple tap off\t 2\t 4\n// Tap and hold on\t 1\t 2\n// Tap and hold off\t 2\t 2\n","outputs":1,"noerr":0,"x":220,"y":100,"wires":[["ce5b671c.dcfb98"]]},{"id":"ce5b671c.dcfb98","type":"function","z":"b805b5cc.a88948","name":"Parse Request","func":"var scene = flow.get('scene');\nvar id = scene.node_id;\nnode.log('id: ' + id);\nnode.log('entity_id: ' + scene.entity_id);\nvar nodes = global.get(\"zwave-lights\");\nvar matchingNode = nodes.find(x => x.node_id === id);\n\nnode.log('match: ' + JSON.stringify(matchingNode));\nnode.log('match id: ' + matchingNode.node_id);\nnode.log('match entity_id: ' + matchingNode.entity_id);\n\nvar match = { \n entity_id: matchingNode.entity_id, \n node_id: matchingNode.node_id,\n scene: scene.scene_action\n };\nmsg.payload = match;\nreturn msg; \n\n\n","outputs":1,"noerr":0,"x":400,"y":100,"wires":[[]]},{"id":"d725b7ff.7f4c28","type":"function","z":"b805b5cc.a88948","name":"Build MQTT topic & payload","func":"if (msg.payload.event_type != \"zwave.scene_activated\")\n return null;\n\nvar scene_id = msg.payload.event.scene_id;\nvar scene_data = msg.payload.event.scene_data;\nvar scene_state = scene_id == 1 ? \"on\" : \"off\";\nvar scene_action = \"\"; var scene_tap; var scene_hold = false; var scene_release = false;\nswitch(scene_data) {\n case 0:\n case 7680:\n scene_action = \"Single tap\";\n scene_tap = 1;\n break;\n case 1:\n case 7740:\n scene_action = \"Release\";\n scene_release = true;\n break;\n case 2:\n case 7800:\n scene_action = \"Tap and hold\";\n scene_hold = true;\n break;\n case 3:\n case 7860:\n scene_action = \"Double tap\";\n scene_tap = 2;\n break;\n case 4: \n case 7920:\n scene_action = \"Triple tap\";\n scene_tap = 3;\n break;\n case 7980:\n scene_action = \"Four tap\";\n scene_tap = 4;\n break;\n case 8040:\n scene_action = \"five tap\";\n scene_tap = 5;\n break;\n}\n\nvar nodes = global.get(\"zwave-lights\");\nvar matchingNode = nodes.find(x => x.node_id === msg.payload.event.node_id);\n\n \nmsg.topic = \"scene/\" + matchingNode.entity_id; \nmsg.payload = { \n entity_id: matchingNode.entity_id, \n node_id: matchingNode.node_id,\n scene: {\n text: scene_action,\n state: scene_state,\n tap: scene_tap,\n hold: scene_hold,\n release: scene_release,\n father: \"Luke\"\n }\n};\n \nreturn msg; \n\n \n// Action\t scene_id\tscene_data\n// Single tap on\t 1\t 0\n// Single tap off\t 2\t 0\n// Double tap on\t 1\t 3\n// Double tap off\t 2\t 3\n// Triple tap on\t 1\t 4\n// Triple tap off\t 2\t 4\n// Tap and hold on\t 1\t 2\n// Tap and hold off\t 2\t 2\n","outputs":1,"noerr":0,"x":260,"y":60,"wires":[["40db4d4a.e94c74"]]},{"id":"40db4d4a.e94c74","type":"mqtt out","z":"b805b5cc.a88948","name":"","topic":"","qos":"0","retain":"false","broker":"68c7942b.be311c","x":450,"y":60,"wires":[]},{"id":"fe4de5f1.b531f8","type":"server-events","z":"b805b5cc.a88948","name":"Scene","server":"3b1a3739.f37638","event_type":"zwave.scene_activated","x":70,"y":80,"wires":[["d725b7ff.7f4c28","6013efbe.3a657"]]},{"id":"68c7942b.be311c","type":"mqtt-broker","z":"","name":"local","broker":"192.168.3.3","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"3b1a3739.f37638","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true},{"id":"fa7d551b.02e1a8","type":"subflow:b805b5cc.a88948","z":"9a37571a.30c2c8","name":"","env":[],"x":100,"y":2440,"wires":[["4ab92096.f197e","1e1b0fa6.6cf49","9c5f5b24.546b98","a7efb27f.cf659"]]},{"id":"4ab92096.f197e","type":"switch","z":"9a37571a.30c2c8","name":"Kitchen Switch?","property":"payload.entity_id","propertyType":"msg","rules":[{"t":"eq","v":"light.kitchen","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":280,"y":2280,"wires":[["b3e2c444.b24788"]]},{"id":"b3e2c444.b24788","type":"switch","z":"9a37571a.30c2c8","name":"Scene","property":"payload.scene","propertyType":"msg","rules":[{"t":"eq","v":"Single tap on","vt":"str"},{"t":"eq","v":"Double tap on","vt":"str"},{"t":"eq","v":"Triple tap on","vt":"str"},{"t":"eq","v":"Single tap off","vt":"str"},{"t":"eq","v":"Double tap off","vt":"str"},{"t":"eq","v":"Triple tap off","vt":"str"}],"checkall":"true","repair":false,"outputs":6,"x":430,"y":2280,"wires":[["1b782182.dacc2e"],["1eeff527.2d12fb"],["ce2a9e11.ce7e6"],["a5609ceb.a5de7"],["6440b30d.b2d4cc"],["48532ae0.b283f4"]]},{"id":"1b782182.dacc2e","type":"api-call-service","z":"9a37571a.30c2c8","name":"All Kitchen lights on","server":"b2fdd11b.5cb2a","service_domain":"light","service":"turn_on","data":"{\"entity_id\":\"light.kitchen, light.island_lights, light.cabinet_lights\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":660,"y":2140,"wires":[[]]},{"id":"1eeff527.2d12fb","type":"api-call-service","z":"9a37571a.30c2c8","name":"Overhead Kitchen lights on","server":"b2fdd11b.5cb2a","service_domain":"light","service":"turn_on","data":"{\"entity_id\":\"light.kitchen\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":680,"y":2200,"wires":[[]]},{"id":"ce2a9e11.ce7e6","type":"api-call-service","z":"9a37571a.30c2c8","name":"Kitchen accent lights on","server":"b2fdd11b.5cb2a","service_domain":"light","service":"turn_on","data":"{\"entity_id\":\"light.island_lights, light.cabinet_lights\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":670,"y":2260,"wires":[[]]},{"id":"a5609ceb.a5de7","type":"api-call-service","z":"9a37571a.30c2c8","name":"All Kitchen lights off","server":"b2fdd11b.5cb2a","service_domain":"light","service":"turn_off","data":"{\"entity_id\":\"light.kitchen, light.island_lights, light.cabinet_lights\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":660,"y":2320,"wires":[[]]},{"id":"6440b30d.b2d4cc","type":"api-call-service","z":"9a37571a.30c2c8","name":"Overhead Kitchen lights off","server":"b2fdd11b.5cb2a","service_domain":"light","service":"turn_off","data":"{\"entity_id\":\"light.kitchen\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":680,"y":2380,"wires":[[]]},{"id":"48532ae0.b283f4","type":"api-call-service","z":"9a37571a.30c2c8","name":"Kitchen accent lights off","server":"b2fdd11b.5cb2a","service_domain":"light","service":"turn_off","data":"{\"entity_id\":\"light.island_lights, light.cabinet_lights\"}","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":670,"y":2440,"wires":[[]]},{"id":"b2fdd11b.5cb2a","type":"server","z":"","name":"Home Assistant (local)","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
Let me know if that helps.