Hi,
here is my "Doorbell" flow:
[{"id":"2854b769.c86be8","type":"tab","label":"Doorbell","disabled":false,"info":""},{"id":"e36775d5.afacc8","type":"exec","z":"2854b769.c86be8","command":"/home/dbunic/project/www/sound.sh","addpay":"payload","append":"","useSpawn":"false","timer":"","oldrc":false,"name":"ding dong","x":700,"y":160,"wires":[[],[],[]],"icon":"font-awesome/fa-bell"},{"id":"4c677590.616d0c","type":"rpi-gpio in","z":"2854b769.c86be8","name":"GPIO14","pin":"8","intype":"tri","debounce":"25","read":false,"x":80,"y":260,"wires":[["e42c75ec.c44de8","12f32abd.2b3105"]]},{"id":"8b6b60.15edb4a","type":"link out","z":"2854b769.c86be8","name":"paliti vanjsko svjetlo","links":["80e3aca4.881e3"],"x":1135,"y":380,"wires":[]},{"id":"12f32abd.2b3105","type":"trigger","z":"2854b769.c86be8","name":"","op1":"","op2":"1","op1type":"nul","op2type":"num","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":280,"y":380,"wires":[["3fe280d1.6799b"]]},{"id":"e42c75ec.c44de8","type":"function","z":"2854b769.c86be8","name":"inside 3s","func":"// set initial values to context variables\ncontext.doorBellPressed = context.doorBellPressed || 0;\ncontext.doorBellReleased = context.doorBellReleased || 0;\n\n// set current time and util object reference from global context\nlet currentTime = Date.now(),\n util = global.get(\"util\");\n\n// remember time when doorBell is pressed\nif (msg.payload == 1) {\n context.doorBellPressed = currentTime;\n}\n// doorBell is released\nelse {\n // calculate time between current and previous door bell button release\n let previous = (currentTime - context.doorBellReleased) / 1000;\n // filter quick pressing on door bell (if time between two button releasing is to short)\n if (previous < 2) {\n return null;\n }\n // calculate time between pressing and releasing door bell button\n let elapsedTime = (currentTime - context.doorBellPressed) / 1000;\n // if button press was short (e.g. within 3sec) then this is valid doorbell event\n if (elapsedTime < 3) {\n // remember current time when doorBell was released\n context.doorBellReleased = currentTime;\n // send message (proceed to other nodes)\n return {payload: 1};\n }\n}\n// don't send any message\nreturn null;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":140,"wires":[["99c49270.69b6","7a2fe4a3.cb40cc"]]},{"id":"3fe280d1.6799b","type":"exec","z":"2854b769.c86be8","command":"/home/dbunic/project/gpio/gpio","addpay":"","append":"-r g25","useSpawn":"false","timer":"","oldrc":false,"name":"read GPIO25","x":470,"y":380,"wires":[["6c60aca3.8641f4"],[],[]]},{"id":"6c60aca3.8641f4","type":"change","z":"2854b769.c86be8","name":"toggle value","rules":[{"t":"change","p":"payload","pt":"msg","from":"1","fromt":"str","to":"0","tot":"num"},{"t":"change","p":"payload","pt":"msg","from":"0","fromt":"str","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":380,"wires":[["d1ed49a8.813fc8","f4ae6b82.86b968"]]},{"id":"dd70b715.01adc8","type":"trigger","z":"2854b769.c86be8","name":"after 3s","op1":"","op2":"1","op1type":"nul","op2type":"num","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":280,"y":380,"wires":[[]]},{"id":"d1ed49a8.813fc8","type":"trigger","z":"2854b769.c86be8","name":"auto turn-off","op1":"","op2":"0","op1type":"nul","op2type":"num","duration":"5","extend":false,"overrideDelay":false,"units":"min","reset":"0","bytopic":"all","topic":"topic","outputs":1,"x":810,"y":500,"wires":[["f4ae6b82.86b968"]],"info":"Auto turn-off outside light"},{"id":"f4ae6b82.86b968","type":"noraf-light","z":"2854b769.c86be8","devicename":"vanjsko garaĹľa","lightcolor":false,"brightnesscontrol":false,"commandonlycolor":false,"turnonwhenbrightnesschanges":false,"passthru":true,"statepayload":true,"brightnessoverride":"","roomhint":"vanjsko","name":"","colortype":"hsv","nora":"df99e4f1.cb9728","topic":"","onvalue":"1","onvalueType":"num","offvalue":"0","offvalueType":"num","temperaturemin":"2700","temperaturemax":"5500","x":960,"y":380,"wires":[["d1ed49a8.813fc8","8b6b60.15edb4a"]]},{"id":"452d9cdc.d70274","type":"noraf-notify","z":"2854b769.c86be8","tag":"","title":"Zvono zvoni","body":"--","icon":"https://image.flaticon.com/icons/png/128/1554/1554201.png","name":"send notification","nora":"df99e4f1.cb9728","topic":"","actions":[],"x":720,"y":80,"wires":[[]]},{"id":"d2d06651.6e36a8","type":"link out","z":"2854b769.c86be8","name":"write to log","links":["41ad38e2.b29aa8"],"x":655,"y":240,"wires":[]},{"id":"4b9a7708.323e68","type":"comment","z":"2854b769.c86be8","name":"write to log","info":"","x":740,"y":240,"wires":[]},{"id":"99c49270.69b6","type":"function","z":"2854b769.c86be8","name":"1 msg in 20s","func":"// set initial values to context variables\ncontext.lastTime = context.lastTime || 0;\n\n// set current time\nlet currentTime = Date.now(),\n elapsedTime = (currentTime - context.lastTime) / 1000;\n\n// filter messages for 20sec\nif (elapsedTime < 20) {\n return null;\n}\n\n// local variables if message needs to be processed\nlet util = global.get(\"util\"),\n time = util.getTime(\"hh:mm\"),\n body;\n \n// prepare message depending on doorbell switch (enabled/disabled)\nif (util.ringing === \"true\") {\n body = \"Netko zvoni u \" + time;\n}\nelse {\n body = \"Netko tiho zvoni u \" + time;\n}\n \n// save time to lastTime\ncontext.lastTime = currentTime;\n\n// send message with body in payload to display in notification\nreturn {payload: {body: body}};\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":80,"wires":[["452d9cdc.d70274"]]},{"id":"7a2fe4a3.cb40cc","type":"function","z":"2854b769.c86be8","name":"test if enabled","func":"// set reference to util\nlet util = global.get(\"util\");\n\n// if doorbell ringing is disabled then be quiet\n// but write to log\nif (util.ringing === \"false\") {\n return [\n null, \n {payload: 1, params: {sensor: \"db\", text: \"Ringing (quiet)\"}}\n ];\n}\n\n// otherwise ring with sound defined in util.doorbell\n// and write to log\nreturn [\n {payload: util.doorbell},\n {payload: 1, params: {sensor: \"db\", text: \"Ringing\"}}\n];","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":500,"y":200,"wires":[["e36775d5.afacc8"],["d2d06651.6e36a8"]]},{"id":"bc00192a.9ad5b8","type":"comment","z":"2854b769.c86be8","name":"vanjsko","info":"","x":930,"y":340,"wires":[]},{"id":"f79f625d.2355f","type":"comment","z":"2854b769.c86be8","name":"vanjsko upaljeno?","info":"","x":490,"y":340,"wires":[]},{"id":"df99e4f1.cb9728","type":"noraf-config","name":"nora config","group":"","twofactor":"off","twofactorpin":"","localexecution":true,"structure":""}]