If you use NodeRed:
(using ZHA and default “dimmer mode” - detects single press all 4 buttons and hold buttons 2 and 4)
(you need to change device_ieee to match your device in the filter node)
[{"id":"da84b83785e013cb","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"6fabdb84cb93f923","type":"server-events","z":"da84b83785e013cb","name":"Listen to ZHA events","server":"44f73817.ded598","version":1,"event_type":"zha_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":130,"y":120,"wires":[["177786d53ac616a9"]]},{"id":"177786d53ac616a9","type":"switch","z":"da84b83785e013cb","name":"Filter remote","property":"payload.event.device_ieee","propertyType":"msg","rules":[{"t":"eq","v":"5c:02:72:ff:fe:04:3e:6a","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":330,"y":120,"wires":[["527f52834bf86b2f"]],"outputLabels":["Scene switch"]},{"id":"527f52834bf86b2f","type":"switch","z":"da84b83785e013cb","name":"TS004F","property":"payload.event.command","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"},{"t":"eq","v":"step","vt":"str"},{"t":"eq","v":"move","vt":"str"},{"t":"eq","v":"stop","vt":"str"}],"checkall":"true","repair":false,"outputs":5,"x":520,"y":120,"wires":[[],[],["d5113f4247099e5d"],["3e5729affe3f535e"],[]],"outputLabels":["1","3","2/4","2/4",""],"info":"button 1 (top right): on\nbutton 2 (top left): step args[0,51,10]\nbutton 3 (bottom left): off\nbutton 4 (bottom right): step args[1, 51, 10]"},{"id":"d5113f4247099e5d","type":"switch","z":"da84b83785e013cb","name":"press 2 / 4","property":"payload.event.args[0]","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":750,"y":120,"wires":[[],[]],"outputLabels":["2","4"]},{"id":"3e5729affe3f535e","type":"switch","z":"da84b83785e013cb","name":"hold 2 / 4","property":"payload.event.args[0]","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":740,"y":160,"wires":[[],[]],"outputLabels":["2","4"]}]