Sure thing! I’m a very recent node-RED convert, so i’m sure there’s a better way to do it, but here’s what i did with my ikea two button remotes:
[{"id":"2410b2f9.0edd2e","type":"server-events","z":"6c1fb8dc.4de6d8","name":"Listen to ZHA events","server":"cca54449.404888","event_type":"zha_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":260,"y":1180,"wires":[["741c4704.b10518"]]},{"id":"577fbbca.f34554","type":"switch","z":"6c1fb8dc.4de6d8","name":"","property":"payload.event.command","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"move_with_on_off","vt":"str"},{"t":"eq","v":"move","vt":"str"},{"t":"eq","v":"stop","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":710,"y":1060,"wires":[["c2c372ee.965ac"],["4df8908.7fad87"],["d75fe6d0.055878"],["e634914a.6e99f"],["e41a6083.ddf4c"]],"outputLabels":["","","Level Up","Level Down",""]},{"id":"741c4704.b10518","type":"switch","z":"6c1fb8dc.4de6d8","name":"Which remote?","property":"payload.event.device_ieee","propertyType":"msg","rules":[{"t":"eq","v":"14:b4:57:ff:fe:71:d9:a1","vt":"str"},{"t":"eq","v":"14:b4:57:ff:fe:70:ba:ac","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":500,"y":1180,"wires":[["577fbbca.f34554"],["23f3eb22.ba51c4"]],"outputLabels":["Andy","Inga"]},{"id":"d75fe6d0.055878","type":"looptimer","z":"6c1fb8dc.4de6d8","duration":"0.25","units":"Second","maxloops":"20","maxtimeout":"10","maxtimeoutunits":"Second","name":"DIm up","x":940,"y":1080,"wires":[["da6f3d03.140d9"],[]]},{"id":"da6f3d03.140d9","type":"api-call-service","z":"6c1fb8dc.4de6d8","name":"Increase the level","server":"cca54449.404888","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bulb_lamp_andy_level","data":"{\"brightness_step_pct\":\"5\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1150,"y":1080,"wires":[[]]},{"id":"e634914a.6e99f","type":"looptimer","z":"6c1fb8dc.4de6d8","duration":"0.25","units":"Second","maxloops":"20","maxtimeout":"10","maxtimeoutunits":"Second","name":"DIm down","x":950,"y":1140,"wires":[["554b36d7.cbe698"],[]]},{"id":"554b36d7.cbe698","type":"api-call-service","z":"6c1fb8dc.4de6d8","name":"Decrease the level","server":"cca54449.404888","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bulb_lamp_andy_level","data":"{\"brightness_step_pct\":\"-5\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1150,"y":1140,"wires":[[]]},{"id":"c2c372ee.965ac","type":"api-call-service","z":"6c1fb8dc.4de6d8","name":"Turn on the light","server":"cca54449.404888","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bulb_lamp_andy_level","data":"{\"brightness_pct\":\"40\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":960,"y":960,"wires":[[]]},{"id":"4df8908.7fad87","type":"api-call-service","z":"6c1fb8dc.4de6d8","name":"Turn off the light","server":"cca54449.404888","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.bulb_lamp_andy_level","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":960,"y":1020,"wires":[[]]},{"id":"e41a6083.ddf4c","type":"change","z":"6c1fb8dc.4de6d8","name":"Stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":1140,"wires":[["d75fe6d0.055878","e634914a.6e99f"]]},{"id":"23f3eb22.ba51c4","type":"switch","z":"6c1fb8dc.4de6d8","name":"","property":"payload.event.command","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"move_with_on_off","vt":"str"},{"t":"eq","v":"move","vt":"str"},{"t":"eq","v":"stop","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":710,"y":1320,"wires":[["4a6716a.b1f26e8"],["cd7a6c6e.7d4a6"],["71673640.5a2c78"],["4e84675f.140fc8"],["be61acef.bd48b"]],"outputLabels":["","","Level Up","Level Down",""]},{"id":"71673640.5a2c78","type":"looptimer","z":"6c1fb8dc.4de6d8","duration":"0.25","units":"Second","maxloops":"20","maxtimeout":"10","maxtimeoutunits":"Second","name":"DIm up","x":940,"y":1340,"wires":[["90d26b84.fc6d28"],[]]},{"id":"90d26b84.fc6d28","type":"api-call-service","z":"6c1fb8dc.4de6d8","name":"Increase the level","server":"cca54449.404888","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bulb_lamp_inga_level","data":"{\"brightness_step_pct\":\"5\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1150,"y":1340,"wires":[[]]},{"id":"4e84675f.140fc8","type":"looptimer","z":"6c1fb8dc.4de6d8","duration":"0.25","units":"Second","maxloops":"20","maxtimeout":"10","maxtimeoutunits":"Second","name":"DIm down","x":950,"y":1400,"wires":[["fef90241.5fca4"],[]]},{"id":"fef90241.5fca4","type":"api-call-service","z":"6c1fb8dc.4de6d8","name":"Decrease the level","server":"cca54449.404888","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bulb_lamp_inga_level","data":"{\"brightness_step_pct\":\"-5\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1150,"y":1400,"wires":[[]]},{"id":"4a6716a.b1f26e8","type":"api-call-service","z":"6c1fb8dc.4de6d8","name":"Turn on the light","server":"cca54449.404888","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.bulb_lamp_inga_level","data":"{\"brightness_pct\":\"40\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":960,"y":1220,"wires":[[]]},{"id":"cd7a6c6e.7d4a6","type":"api-call-service","z":"6c1fb8dc.4de6d8","name":"Turn off the light","server":"cca54449.404888","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.bulb_lamp_inga_level","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":960,"y":1280,"wires":[[]]},{"id":"be61acef.bd48b","type":"change","z":"6c1fb8dc.4de6d8","name":"Stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":1400,"wires":[["71673640.5a2c78","4e84675f.140fc8"]]},{"id":"cca54449.404888","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
Basically, I use an event node to listen to all ZHA events. I then use a switch to identify the remote that sent the command (here, both my wife and i have ikea remotes). I used the event viewer in home assistant to find the remote ID and switch off of that.
From there, i use a switch node to identify the button press. Again, using the event viewer in home assistant allowed me to identify the unique event identifier associated with each press (in this case, stored in the msg.payload.event.command field).
For the ikea remote, i have an on and off event that i then mapped to an on and off service call. The fun part comes in when the buttons are held. When the hold up or hold down events come through, i trigger a loop timer node to repeatedly call the dim up or dim down service. In this case, i have configured the node to call the service four times a second, each time dimming the light by 5%.
When the button is released, a stop event is registered and a change node sends a stop command to the loop timer node, telling it to stop calling the dim service. To keep it all from running away in the event the stop command is missed, the loop timer node has a time out built in. I have it set to time out after 10 seconds, or 20 loops.
If you are new to node-RED, everything i just said will sound crazy. Give it a few weeks and it will make much more sense.