Raw basics can be something like this
[{"id":"1eb7a2e9.c876ed","type":"function","z":"b02a69cb.a920e8","name":"dimmer controller","func":"var iv = flow.get(\"incrementvalue\") || 0;\nif(iv === 0){\n return null\n}\nvar dimmer = flow.get(\"dimmervalue\") || 0;\ndimmer += iv;\nif(dimmer > 100){\n dimmer = 100;\n}\nif(dimmer < 0){\n dimmer = 0;\n}\n\nflow.set(\"dimmervalue\",dimmer)\n\nmsg.payload = dimmer;\nreturn msg","outputs":1,"noerr":0,"x":380,"y":580,"wires":[["79319717.d374c8"]]},{"id":"79319717.d374c8","type":"debug","z":"b02a69cb.a920e8","name":"dimmer debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":580,"wires":[]},{"id":"1f917d40.b23d53","type":"inject","z":"b02a69cb.a920e8","name":"","topic":"up","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":700,"wires":[["366cb4dc.1b577c"]]},{"id":"e49df5d8.895788","type":"inject","z":"b02a69cb.a920e8","name":"","topic":"up","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":660,"wires":[["366cb4dc.1b577c"]]},{"id":"366cb4dc.1b577c","type":"function","z":"b02a69cb.a920e8","name":"button input to state","func":"var step = flow.get(\"dimmerstep\") || 1\nif(msg.topic === \"up\"){\n if(msg.payload === 1){\n flow.set(\"incrementvalue\",step)\n }\n else{\n flow.set(\"incrementvalue\",0)\n }\n}\nelse{\n if(msg.payload === 1){\n flow.set(\"incrementvalue\",step * -1)\n }\n else{\n flow.set(\"incrementvalue\",0)\n }\n}\nreturn msg\n","outputs":1,"noerr":0,"x":390,"y":720,"wires":[["cf6ef6f8.1554b8"]]},{"id":"b1fdeb3.f08f318","type":"inject","z":"b02a69cb.a920e8","name":"","topic":"down","payload":"1","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":740,"wires":[["366cb4dc.1b577c"]]},{"id":"293cc6cf.6d262a","type":"inject","z":"b02a69cb.a920e8","name":"","topic":"down","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":780,"wires":[["366cb4dc.1b577c"]]},{"id":"cf6ef6f8.1554b8","type":"debug","z":"b02a69cb.a920e8","name":"state debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":720,"wires":[]},{"id":"ad75d17c.d2703","type":"inject","z":"b02a69cb.a920e8","name":"","topic":"","payload":"","payloadType":"date","repeat":".25","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":580,"wires":[["1eb7a2e9.c876ed"]]},{"id":"5133c8dd.5700f8","type":"change","z":"b02a69cb.a920e8","name":"","rules":[{"t":"set","p":"dimmerstep","pt":"flow","to":"5","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":500,"wires":[[]]},{"id":"82f008c7.8d25b8","type":"inject","z":"b02a69cb.a920e8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":500,"wires":[["5133c8dd.5700f8"]]}]