YF-S201 Water Flow Sensor - Help with Require

Use this node for water flow totalizer. It works OK.


Also if you need the value to persist during blackouts or restarts then use global context store. or use this node : https://flows.nodered.org/node/node-red-contrib-persist.

Together the nodes make a decent flow meter.

I am trying to count the pulses, and update a text on UI according to that. If timed counter counts no pulses, it will say "Bozuk" (it means faulty), when there are more than x amount of pulses, it will say "Normal", before the button press, and after 2nd press, it must show "-", since the button will also start the pump. How can I do this? I tried something like this:

[{"id":"14dab897.d647d7","type":"ui_switch","z":"4cdd06f6.faf528","name":"","label":"Başlat/Durdur","tooltip":"","group":"843bc78a.c5b078","order":7,"width":5,"height":1,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"mi-power_settings_new ","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"mi-power_settings_new ","offcolor":"black","x":560,"y":520,"wires":[["e116c5af.573e28","7791562c.bacb98","29119598.39809a","6e4f0412.b1ff3c","5880552a.38fb4c"]]},{"id":"6e4f0412.b1ff3c","type":"function","z":"4cdd06f6.faf528","name":"","func":"var b0 = msg.payload;\n\nif(b0 === false)\n{\n    msg.payload = \"-\";\n}\nelse if(b0 === true)\n{\n    msg.payload = null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":760,"y":560,"wires":[["e1cb428a.02369"]]},{"id":"e1cb428a.02369","type":"ui_text","z":"4cdd06f6.faf528","group":"843bc78a.c5b078","order":12,"width":3,"height":1,"name":"","label":"Motor:","format":"{{msg.payload}}","layout":"row-center","x":850,"y":680,"wires":[]},{"id":"1f23bddb.087d42","type":"debug","z":"4cdd06f6.faf528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":760,"wires":[]},{"id":"8dd3e3e9.58d9a","type":"function","z":"4cdd06f6.faf528","name":"","func":"var m0 = msg.count;\n\nif(m0 > 1)\n{\n    msg.payload = \"Normal\"\n}\nelse if(m0 <= 1)\n{\n    msg.payload = \"Bozuk\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":620,"y":680,"wires":[["e1cb428a.02369","1f23bddb.087d42"]]},{"id":"d5ebaf98.67cc4","type":"debug","z":"4cdd06f6.faf528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":500,"y":760,"wires":[]},{"id":"5880552a.38fb4c","type":"timed-counter","z":"4cdd06f6.faf528","name":"","timelimit":"10","timeunit":"1000","withhold":true,"fixedtimeout":false,"pertopic":false,"x":300,"y":680,"wires":[["8dd3e3e9.58d9a","d5ebaf98.67cc4"]]},{"id":"d057eca6.64926","type":"rpi-gpio in","z":"4cdd06f6.faf528","name":"","pin":"37","intype":"tri","debounce":"25","read":false,"x":70,"y":680,"wires":[["5880552a.38fb4c"]]},{"id":"843bc78a.c5b078","type":"ui_group","z":"","name":"logo","tab":"43cae785.290cd8","order":3,"disp":false,"width":8,"collapse":false},{"id":"43cae785.290cd8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

So let me get this right. On standby the text UI on the dashboard will say normal.
You press the button, let the motor start up. after a few second you expect the flow rate to be high enough to tell you the pump is running. If there is no flow rate, you want it to stop the pump and throw the "Bozuk" Alarm ?

We have actually made a contrib package that kind of handles what you need.

https://flows.nodered.org/node/smithtek-nodered-duty-standby
image

Example flow below. Use your flow rate instead of the inject node. and the trip formatter to trigger a function node so it will pass a string to the UI.

[{"id":"a52baa7a.5157d8","type":"smithtek_dutycontrol","z":"b234d583.3b2188","name":"","senseTime":"5","primary":"Pump 1","x":670,"y":340,"wires":[["7daadecc.58a13"],["d5855490.89a4f"],["bd31b8c5.266d8"],["8db0d59a.58d9e"]]},{"id":"bd31b8c5.266d8","type":"smithtek_duty_pumptrip","z":"b234d583.3b2188","name":"Pump 1 Trip","pumpNumber":1,"x":930,"y":340,"wires":[["9cd13c50.e93aa8"]]},{"id":"c2fb5046.82d638","type":"smithtek_duty_senseflow","z":"b234d583.3b2188","name":"","x":400,"y":380,"wires":[["a52baa7a.5157d8"]]},{"id":"29d2b6e8.69bd0a","type":"smithtek_duty_start_stop","z":"b234d583.3b2188","name":"","x":400,"y":280,"wires":[["a52baa7a.5157d8"]]},{"id":"455ef8d2.1cddd8","type":"inject","z":"b234d583.3b2188","name":"Pump Start","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":220,"wires":[["29d2b6e8.69bd0a"]]},{"id":"9158665.6fb2a98","type":"inject","z":"b234d583.3b2188","name":"Pump Stop","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":280,"wires":[["29d2b6e8.69bd0a"]]},{"id":"6e13d529.bae85c","type":"inject","z":"b234d583.3b2188","name":"","topic":"","payload":"100","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":460,"wires":[["78c99f01.acd27"]]},{"id":"78c99f01.acd27","type":"switch","z":"b234d583.3b2188","name":"Compare flow rate","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":390,"y":460,"wires":[["c2fb5046.82d638"]]},{"id":"d5855490.89a4f","type":"debug","z":"b234d583.3b2188","name":"Pump 2 running","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":910,"y":260,"wires":[]},{"id":"7daadecc.58a13","type":"debug","z":"b234d583.3b2188","name":"Pump 1 running","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":910,"y":220,"wires":[]},{"id":"8db0d59a.58d9e","type":"smithtek_duty_pumptrip","z":"b234d583.3b2188","name":"Pump 2  trip","pumpNumber":1,"x":930,"y":380,"wires":[["274f6323.8dfb1c"]]},{"id":"274f6323.8dfb1c","type":"debug","z":"b234d583.3b2188","name":"Pump 2 Trip","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1110,"y":380,"wires":[]},{"id":"9cd13c50.e93aa8","type":"debug","z":"b234d583.3b2188","name":"Pump 1 Trip","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1110,"y":340,"wires":[]}]

When the switch is in off state, it will show "-", when it is on, it will show what it should show according to the pulses. Rest of what you understood from my post is correct.

I'll try to use your node now.

I don't have a node/package for the sensor to get the flow rate. I just count the pulses. How can I implement your example flow to my system?

Assuming you are reading a pulse value from an input of some sorts. Be it a GPIO pin, mqtt, modbus, I2c, im not sure. but were ever that value comes from you just connect that to the switch node. The switch node will compare a value, = > or <. if it is correct it sends a true to the Sense flow node. this then passes a true or false to the pump formatter. there is also a timeout function in the pump controller, this is to allow the flow rate to build up. Best to try it out. :slight_smile:

When I use a switch, it stays at one condition. Imagine you have 3 conditions, and one of them is activated after a while, it never changes to the other 2 even when the values are correct for them.

I tried something like this, but couldn't get it working:

[{"id":"d057eca6.64926","type":"rpi-gpio in","z":"4cdd06f6.faf528","name":"","pin":"37","intype":"tri","debounce":"25","read":false,"x":70,"y":680,"wires":[["5880552a.38fb4c"]]},{"id":"5880552a.38fb4c","type":"timed-counter","z":"4cdd06f6.faf528","name":"","timelimit":"10","timeunit":"1000","withhold":true,"fixedtimeout":false,"pertopic":false,"x":300,"y":680,"wires":[["8dd3e3e9.58d9a","d5ebaf98.67cc4","61888000.0f7ba"]]},{"id":"14dab897.d647d7","type":"ui_switch","z":"4cdd06f6.faf528","name":"","label":"Başlat/Durdur","tooltip":"","group":"843bc78a.c5b078","order":7,"width":5,"height":1,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"mi-power_settings_new ","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"mi-power_settings_new ","offcolor":"black","x":560,"y":520,"wires":[["e116c5af.573e28","7791562c.bacb98","29119598.39809a","6e4f0412.b1ff3c","5880552a.38fb4c","a2e6f0f7.6605"]]},{"id":"6e4f0412.b1ff3c","type":"function","z":"4cdd06f6.faf528","name":"","func":"var b0 = msg.payload;\n\nif(b0 === false)\n{\n    msg.payload = \"-\";\n}\nelse if(b0 === true)\n{\n    msg.payload = null;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":760,"y":560,"wires":[["e1cb428a.02369"]]},{"id":"e1cb428a.02369","type":"ui_text","z":"4cdd06f6.faf528","group":"843bc78a.c5b078","order":12,"width":3,"height":1,"name":"","label":"Motor:","format":"{{msg.payload}}","layout":"row-center","x":850,"y":680,"wires":[]},{"id":"d5ebaf98.67cc4","type":"debug","z":"4cdd06f6.faf528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":500,"y":760,"wires":[]},{"id":"1f23bddb.087d42","type":"debug","z":"4cdd06f6.faf528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":910,"y":760,"wires":[]},{"id":"a2e6f0f7.6605","type":"smithtek_duty_start_stop","z":"4cdd06f6.faf528","name":"","x":340,"y":900,"wires":[["39ddab06.212474"]]},{"id":"61888000.0f7ba","type":"smithtek_duty_senseflow","z":"4cdd06f6.faf528","name":"","x":340,"y":1000,"wires":[["39ddab06.212474"]]},{"id":"39ddab06.212474","type":"smithtek_dutycontrol","z":"4cdd06f6.faf528","name":"","senseTime":"5","primary":"Pump 1","x":610,"y":960,"wires":[["fb758d62.6af92"],[],[],[]]},{"id":"fb758d62.6af92","type":"smithtek_duty_pumptrip","z":"4cdd06f6.faf528","name":"","pumpNumber":1,"x":920,"y":920,"wires":[["8dd3e3e9.58d9a","1f23bddb.087d42"]]},{"id":"8dd3e3e9.58d9a","type":"function","z":"4cdd06f6.faf528","name":"","func":"var m0 = msg.trip;\n\nif(m0 === true)\n{\n    msg.payload = \"Normal\"\n}\nelse if(m0 === false)\n{\n    msg.payload = \"Bozuk\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":680,"wires":[["e1cb428a.02369"]]},{"id":"843bc78a.c5b078","type":"ui_group","z":"","name":"logo","tab":"43cae785.290cd8","order":3,"disp":false,"width":8,"collapse":false},{"id":"43cae785.290cd8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

I added trip node back, and managed to get this:

{"cmd":"pumpTrip","value":{"pump":1,"trip":false}}

I tried to assign msg.trip to a variable and check the true false conditions on that, but I couldn't do it. What I copied above is what appears on the text. How can I solve this?

Hi oncdastan.
There is actually an issue with this node package on V1 and above. I would advise not to use them until it is fixed.
If you downlod this node node-red-contrib-simple-gate

And try this flow

[{"id":"f599fd12.ae0e9","type":"switch","z":"92afdd5b.07b9a","name":"Flow rate below safety setpoint","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":710,"y":440,"wires":[["ba2a9f18.dfbfb","d2f083f3.2a63b"]]},{"id":"37e05f0f.a730f","type":"function","z":"92afdd5b.07b9a","name":"Pump Running","func":"let status = msg.payload\n\n\nif (status === \"start\") {\n    msg.payload = 'Pump 1 Running'\n} else {\n    msg.payload = 'Pump 1 Stopped'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":780,"y":100,"wires":[["4bee2e17.7e459"]]},{"id":"832592b1.595f6","type":"function","z":"92afdd5b.07b9a","name":"Pump Status / Fault","func":"let status = msg.payload\n\n\nif (status === \"bazuka\") {\n    msg.payload = 'Pump Fault \"Bazuka'\n} else {\n    msg.payload = 'Pump Standby'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":760,"y":140,"wires":[["4bee2e17.7e459"]]},{"id":"b4d074.fddd3f9","type":"ui_button","z":"92afdd5b.07b9a","name":"","group":"5787eb0a.f37ad4","order":0,"width":0,"height":0,"passthru":true,"label":"Pump start","tooltip":"","color":"","bgcolor":"","icon":"","payload":"start","payloadType":"str","topic":"control","x":290,"y":100,"wires":[["49272361.4902cc","37e05f0f.a730f","753b561e.c01728"]]},{"id":"af52eb6.9b10c18","type":"ui_button","z":"92afdd5b.07b9a","name":"","group":"5787eb0a.f37ad4","order":0,"width":0,"height":0,"passthru":true,"label":"Pump Stop","tooltip":"","color":"","bgcolor":"","icon":"","payload":"stop","payloadType":"str","topic":"control","x":290,"y":140,"wires":[["49272361.4902cc","37e05f0f.a730f","a8653168.b33d6"]]},{"id":"ebbb8a5d.0b8028","type":"delay","z":"92afdd5b.07b9a","name":"Flow Ramp up Delay","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":420,"y":440,"wires":[["f599fd12.ae0e9"]]},{"id":"ba2a9f18.dfbfb","type":"function","z":"92afdd5b.07b9a","name":"Turn pump off","func":"msg.payload = \"stop\"\nmsg.topic = \"control\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":400,"wires":[["49272361.4902cc"]]},{"id":"49272361.4902cc","type":"gate","z":"92afdd5b.07b9a","name":"","controlTopic":"control","defaultState":"closed","openCmd":"start","closeCmd":"stop","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":550,"y":320,"wires":[["832592b1.595f6"]]},{"id":"4bee2e17.7e459","type":"ui_text","z":"92afdd5b.07b9a","group":"5787eb0a.f37ad4","order":2,"width":0,"height":0,"name":"","label":"Pump Status","format":"{{msg.payload}}","layout":"row-spread","x":1010,"y":120,"wires":[]},{"id":"753b561e.c01728","type":"function","z":"92afdd5b.07b9a","name":"simulated flow value","func":"msg.payload = 99\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":180,"y":460,"wires":[["ebbb8a5d.0b8028"]]},{"id":"d2f083f3.2a63b","type":"function","z":"92afdd5b.07b9a","name":"Turn pump off","func":"msg.payload = \"bazuka\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":440,"wires":[["49272361.4902cc","832592b1.595f6"]]},{"id":"a8653168.b33d6","type":"change","z":"92afdd5b.07b9a","name":"Reset Flow delay","rules":[{"t":"set","p":"reset","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":420,"wires":[["ebbb8a5d.0b8028"]]},{"id":"5787eb0a.f37ad4","type":"ui_group","z":"","name":"Pump Control","tab":"1c0f609f.8564ef","order":1,"disp":true,"width":"6","collapse":false},{"id":"1c0f609f.8564ef","type":"ui_tab","z":"","name":"Pumps","icon":"dashboard","disabled":false,"hidden":false}]

It should do what you i think you need.

With added initialize so it doesn't say it is in fault at start up.

[{"id":"f599fd12.ae0e9","type":"switch","z":"92afdd5b.07b9a","name":"Flow rate below safety setpoint","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":710,"y":480,"wires":[["ba2a9f18.dfbfb","d2f083f3.2a63b"]]},{"id":"37e05f0f.a730f","type":"function","z":"92afdd5b.07b9a","name":"Pump Running","func":"let status = msg.payload\n\n\nif (status === \"start\") {\n    msg.payload = 'Pump 1 Running'\n} else {\n    msg.payload = 'Pump 1 Stopped'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":780,"y":140,"wires":[["4bee2e17.7e459"]]},{"id":"832592b1.595f6","type":"function","z":"92afdd5b.07b9a","name":"Pump Status / Fault","func":"let status = msg.payload\n\n\nif (status === \"bazuka\") {\n    msg.payload = 'Pump Fault \"Bazuka'\n} else {\n    msg.payload = 'Pump Standby'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":720,"y":200,"wires":[["4bee2e17.7e459"]]},{"id":"b4d074.fddd3f9","type":"ui_button","z":"92afdd5b.07b9a","name":"","group":"5787eb0a.f37ad4","order":0,"width":0,"height":0,"passthru":true,"label":"Pump start","tooltip":"","color":"","bgcolor":"","icon":"","payload":"start","payloadType":"str","topic":"control","x":250,"y":140,"wires":[["49272361.4902cc","37e05f0f.a730f","753b561e.c01728"]]},{"id":"af52eb6.9b10c18","type":"ui_button","z":"92afdd5b.07b9a","name":"","group":"5787eb0a.f37ad4","order":0,"width":0,"height":0,"passthru":true,"label":"Pump Stop","tooltip":"","color":"","bgcolor":"","icon":"","payload":"stop","payloadType":"str","topic":"control","x":250,"y":180,"wires":[["49272361.4902cc","37e05f0f.a730f","a8653168.b33d6"]]},{"id":"ebbb8a5d.0b8028","type":"delay","z":"92afdd5b.07b9a","name":"Flow Ramp up Delay","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":420,"y":480,"wires":[["f599fd12.ae0e9"]]},{"id":"ba2a9f18.dfbfb","type":"function","z":"92afdd5b.07b9a","name":"Turn pump off","func":"msg.payload = \"stop\"\nmsg.topic = \"control\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":440,"wires":[["49272361.4902cc"]]},{"id":"49272361.4902cc","type":"gate","z":"92afdd5b.07b9a","name":"","controlTopic":"control","defaultState":"closed","openCmd":"start","closeCmd":"stop","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":550,"y":360,"wires":[["832592b1.595f6"]]},{"id":"4bee2e17.7e459","type":"ui_text","z":"92afdd5b.07b9a","group":"5787eb0a.f37ad4","order":2,"width":0,"height":0,"name":"","label":"Pump Status","format":"{{msg.payload}}","layout":"row-spread","x":1010,"y":180,"wires":[]},{"id":"753b561e.c01728","type":"function","z":"92afdd5b.07b9a","name":"simulated flow value","func":"msg.payload = 99\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":180,"y":500,"wires":[["ebbb8a5d.0b8028"]]},{"id":"d2f083f3.2a63b","type":"function","z":"92afdd5b.07b9a","name":"Turn pump off","func":"msg.payload = \"bazuka\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":480,"wires":[["49272361.4902cc","832592b1.595f6"]]},{"id":"a8653168.b33d6","type":"change","z":"92afdd5b.07b9a","name":"Reset Flow delay","rules":[{"t":"set","p":"reset","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":190,"y":460,"wires":[["ebbb8a5d.0b8028"]]},{"id":"ba9cd1f8.9a54a","type":"inject","z":"92afdd5b.07b9a","name":"Delay Initialize","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":260,"y":80,"wires":[["af52eb6.9b10c18"]]},{"id":"5787eb0a.f37ad4","type":"ui_group","z":"","name":"Pump Control","tab":"1c0f609f.8564ef","order":1,"disp":true,"width":"6","collapse":false},{"id":"1c0f609f.8564ef","type":"ui_tab","z":"","name":"Pumps","icon":"dashboard","disabled":false,"hidden":false}]

I didn't understand where I am supposed to put my sensor pin, or sensor pin with timed counter. Also, Can I reduce the separated on/off buttons to a single switch?

Replace the function node with your GPIO inputs.

[{"id":"f599fd12.ae0e9","type":"switch","z":"92afdd5b.07b9a","name":"Flow rate below safety setpoint","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":890,"y":480,"wires":[["ba2a9f18.dfbfb","d2f083f3.2a63b"]]},{"id":"37e05f0f.a730f","type":"function","z":"92afdd5b.07b9a","name":"Pump Running","func":"let status = msg.payload\n\n\nif (status === \"start\") {\n    msg.payload = 'Pump 1 Running'\n} else {\n    msg.payload = 'Pump 1 Stopped'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1660,"y":420,"wires":[["4bee2e17.7e459"]]},{"id":"832592b1.595f6","type":"function","z":"92afdd5b.07b9a","name":"Pump Status / Fault","func":"let status = msg.payload\n\n\nif (status === \"bazuka\") {\n    msg.payload = 'Pump Fault \"Bazuka'\n} else {\n    msg.payload = 'Pump Standby'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1700,"y":460,"wires":[["4bee2e17.7e459"]]},{"id":"ebbb8a5d.0b8028","type":"delay","z":"92afdd5b.07b9a","name":"Flow Ramp up Delay","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":600,"y":480,"wires":[["f599fd12.ae0e9"]]},{"id":"ba2a9f18.dfbfb","type":"function","z":"92afdd5b.07b9a","name":"Turn pump off","func":"msg.payload = \"stop\"\nmsg.topic = \"control\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":440,"wires":[["49272361.4902cc"]]},{"id":"49272361.4902cc","type":"gate","z":"92afdd5b.07b9a","name":"","controlTopic":"control","defaultState":"closed","openCmd":"start","closeCmd":"stop","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":1450,"y":460,"wires":[["832592b1.595f6"]]},{"id":"4bee2e17.7e459","type":"ui_text","z":"92afdd5b.07b9a","group":"5787eb0a.f37ad4","order":2,"width":0,"height":0,"name":"","label":"Pump Status","format":"{{msg.payload}}","layout":"row-spread","x":1930,"y":420,"wires":[]},{"id":"753b561e.c01728","type":"function","z":"92afdd5b.07b9a","name":"simulated flow value","func":"msg.payload = 99\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":360,"y":780,"wires":[["ebbb8a5d.0b8028"]]},{"id":"d2f083f3.2a63b","type":"function","z":"92afdd5b.07b9a","name":"Turn pump off","func":"msg.payload = \"bazuka\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":480,"wires":[["49272361.4902cc","832592b1.595f6"]]},{"id":"a8653168.b33d6","type":"change","z":"92afdd5b.07b9a","name":"Reset Flow delay","rules":[{"t":"set","p":"reset","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":480,"wires":[["ebbb8a5d.0b8028"]]},{"id":"ba9cd1f8.9a54a","type":"inject","z":"92afdd5b.07b9a","name":"Delay Initialize","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":1460,"y":340,"wires":[["832592b1.595f6"]]},{"id":"fa7c67bb.6cb508","type":"ui_switch","z":"92afdd5b.07b9a","name":"","label":"switch","tooltip":"","group":"5787eb0a.f37ad4","order":3,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"control","style":"","onvalue":"start","onvalueType":"str","onicon":"","oncolor":"","offvalue":"stop","offvalueType":"str","officon":"","offcolor":"","x":830,"y":240,"wires":[["49272361.4902cc","37e05f0f.a730f","669981d7.7a7f7"]]},{"id":"669981d7.7a7f7","type":"switch","z":"92afdd5b.07b9a","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"stop","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":130,"y":480,"wires":[["a8653168.b33d6"]]},{"id":"b168acbd.8cc7d","type":"comment","z":"92afdd5b.07b9a","name":"You replace this node with your pulse input node ","info":"","x":340,"y":720,"wires":[]},{"id":"5787eb0a.f37ad4","type":"ui_group","z":"","name":"Pump Control","tab":"1c0f609f.8564ef","order":1,"disp":true,"width":"6","collapse":false},{"id":"1c0f609f.8564ef","type":"ui_tab","z":"","name":"Pumps","icon":"dashboard","disabled":false,"hidden":false}]

There is nothing built yet, so I just blow into the sensor and this is how I get the pulses. This doesn't work properly for me. Says running when the switch is on, stopped when the switch is off. This part is okay, but it keeps displaying running even when I don't touch it for minutes. It should say it is faulty in this case. I also changed start/stop to true/false. This is how the other things that are connected to the same switch work in my system.

My flow:

[{"id":"d057eca6.64926","type":"rpi-gpio in","z":"4cdd06f6.faf528","name":"","pin":"37","intype":"tri","debounce":"25","read":false,"x":70,"y":680,"wires":[["6b833b7a.e98934"]]},{"id":"5824b0e.1cb2f5","type":"switch","z":"4cdd06f6.faf528","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"false","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":70,"y":900,"wires":[["cd5d5f4f.6eec"]]},{"id":"cd5d5f4f.6eec","type":"change","z":"4cdd06f6.faf528","name":"Reset Flow delay","rules":[{"t":"set","p":"reset","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":900,"wires":[["6b833b7a.e98934"]]},{"id":"6b833b7a.e98934","type":"delay","z":"4cdd06f6.faf528","name":"Flow Ramp up Delay","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":480,"y":900,"wires":[["af85b114.fcc5f"]]},{"id":"14dab897.d647d7","type":"ui_switch","z":"4cdd06f6.faf528","name":"","label":"Başlat/Durdur","tooltip":"","group":"843bc78a.c5b078","order":7,"width":5,"height":1,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"mi-power_settings_new ","oncolor":"yellow","offvalue":"false","offvalueType":"bool","officon":"mi-power_settings_new ","offcolor":"black","x":560,"y":520,"wires":[["e116c5af.573e28","7791562c.bacb98","29119598.39809a","5824b0e.1cb2f5","2fc4a158.b2b5be","cc43cee5.a8417"]]},{"id":"af85b114.fcc5f","type":"switch","z":"4cdd06f6.faf528","name":"Flow rate below safety setpoint","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":690,"y":1080,"wires":[["efb6e53d.d04548","6d04f023.07a6e"]]},{"id":"6d04f023.07a6e","type":"function","z":"4cdd06f6.faf528","name":"Turn pump off","func":"msg.payload = \"bazuka\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":1340,"wires":[["2fc4a158.b2b5be","1aea18f3.3dc387"]]},{"id":"efb6e53d.d04548","type":"function","z":"4cdd06f6.faf528","name":"Turn pump off","func":"msg.payload = \"false\"\nmsg.topic = \"control\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":900,"y":1280,"wires":[["2fc4a158.b2b5be"]]},{"id":"2fc4a158.b2b5be","type":"gate","z":"4cdd06f6.faf528","name":"","controlTopic":"control","defaultState":"closed","openCmd":"start","closeCmd":"stop","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":1150,"y":940,"wires":[["1aea18f3.3dc387"]]},{"id":"1fe17980.512a97","type":"inject","z":"4cdd06f6.faf528","name":"Delay Initialize","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":1160,"y":820,"wires":[["1aea18f3.3dc387"]]},{"id":"cc43cee5.a8417","type":"function","z":"4cdd06f6.faf528","name":"Pump Running","func":"let status = msg.payload\n\n\nif (status === true) {\n    msg.payload = 'Pump 1 Running'\n} else {\n    msg.payload = 'Pump 1 Stopped'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1380,"y":880,"wires":[["7bf92577.9a092c"]]},{"id":"1aea18f3.3dc387","type":"function","z":"4cdd06f6.faf528","name":"Pump Status / Fault","func":"let status = msg.payload\n\n\nif (status === \"bazuka\") {\n    msg.payload = 'Pump Fault \"Bazuka'\n} else {\n    msg.payload = 'Pump Standby'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1400,"y":940,"wires":[["7bf92577.9a092c"]]},{"id":"7bf92577.9a092c","type":"ui_text","z":"4cdd06f6.faf528","group":"843bc78a.c5b078","order":2,"width":"3","height":"1","name":"","label":"Pump Status","format":"{{msg.payload}}","layout":"row-right","x":1630,"y":900,"wires":[]},{"id":"843bc78a.c5b078","type":"ui_group","z":"","name":"logo","tab":"43cae785.290cd8","order":3,"disp":false,"width":8,"collapse":false},{"id":"43cae785.290cd8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":2,"disabled":false,"hidden":false}]```

I connected it to my other switch, so changed the rest according to true/false.

That flow is not correct, you have made changes that wont work.
Use the last flow i posted and connect your input flow to the delay node.

Why is it not correct? It works in the same way, when I disable mine, and use yours.

After waiting for 5 minutes or more, fault message appeared when it was running. Now, I'm testing if it will appear when it stopped, or not.

Because the gate node requires a topic to be called control to operate it.
It then needs unique payload "start" and "stop" to open close it so it can let payload through.
You changed the switch payload from start - stop. If you want to use "True" & "False" then you need to change this in the gate node.

I changed those too. Except a topic called "control". Should I put it in the switch?

Edit: Ignore this one. I checked it and yes, it was on switch's topic. I did that too now.

You are also mixing Bool and string true and false. some nodes you are using bool others you are using string. Keep it the same.'

This is your version fixed

[{"id":"d60caecc.73909","type":"switch","z":"6b10094.71840f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"false","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":190,"y":420,"wires":[["5e07513.6417cb"]]},{"id":"5e07513.6417cb","type":"change","z":"6b10094.71840f8","name":"Reset Flow delay","rules":[{"t":"set","p":"reset","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":370,"y":420,"wires":[["f4e1c44e.260af8"]]},{"id":"f4e1c44e.260af8","type":"delay","z":"6b10094.71840f8","name":"Flow Ramp up Delay","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":660,"y":420,"wires":[["a92eda1c.5a6e48"]]},{"id":"53ce8346.4ac6bc","type":"ui_switch","z":"6b10094.71840f8","name":"","label":"Başlat/Durdur","tooltip":"","group":"605dd683.ecd808","order":7,"width":5,"height":1,"passthru":true,"decouple":"false","topic":"control","style":"","onvalue":"true","onvalueType":"str","onicon":"mi-power_settings_new ","oncolor":"yellow","offvalue":"false","offvalueType":"str","officon":"mi-power_settings_new ","offcolor":"black","x":240,"y":180,"wires":[["d60caecc.73909","d45ad3df.20bf","3c77fd60.03fcb2","ed9a4ee0.66329"]]},{"id":"a92eda1c.5a6e48","type":"switch","z":"6b10094.71840f8","name":"Flow rate below safety setpoint","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"100","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":950,"y":420,"wires":[["1127925.1c8ff6e","3a323b82.6a0cc4"]]},{"id":"3a323b82.6a0cc4","type":"function","z":"6b10094.71840f8","name":"Turn pump off","func":"msg.payload = \"bazuka\"\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1180,"y":520,"wires":[["d45ad3df.20bf","f159e715.559b48"]]},{"id":"1127925.1c8ff6e","type":"function","z":"6b10094.71840f8","name":"Turn pump off","func":"msg.payload = \"false\"\nmsg.topic = \"control\"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":240,"wires":[["d45ad3df.20bf"]]},{"id":"d45ad3df.20bf","type":"gate","z":"6b10094.71840f8","name":"","controlTopic":"control","defaultState":"closed","openCmd":"true","closeCmd":"false","toggleCmd":"toggle","defaultCmd":"default","persist":false,"x":870,"y":60,"wires":[["f159e715.559b48"]]},{"id":"478d5d26.43ad34","type":"inject","z":"6b10094.71840f8","name":"Delay Initialize","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"date","x":1240,"y":180,"wires":[["f159e715.559b48"]]},{"id":"3c77fd60.03fcb2","type":"function","z":"6b10094.71840f8","name":"Pump Running","func":"let status = msg.payload\n\n\nif (status === \"true\") {\n    msg.payload = 'Pump 1 Running'\n} else {\n    msg.payload = 'Pump 1 Stopped'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1260,"y":240,"wires":[["80ec789c.031c78"]]},{"id":"f159e715.559b48","type":"function","z":"6b10094.71840f8","name":"Pump Status / Fault","func":"let status = msg.payload\n\n\nif (status === \"bazuka\") {\n    msg.payload = 'Pump Fault \"Bazuka'\n} else {\n    msg.payload = 'Pump Standby'\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1280,"y":280,"wires":[["80ec789c.031c78"]]},{"id":"80ec789c.031c78","type":"ui_text","z":"6b10094.71840f8","group":"605dd683.ecd808","order":2,"width":"3","height":"1","name":"","label":"Pump Status","format":"{{msg.payload}}","layout":"row-right","x":1530,"y":240,"wires":[]},{"id":"3c107fcf.30691","type":"function","z":"6b10094.71840f8","name":"simulated flow value","func":"msg.payload = 99\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":640,"y":820,"wires":[["f4e1c44e.260af8"]]},{"id":"ed9a4ee0.66329","type":"switch","z":"6b10094.71840f8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"true","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":820,"wires":[["3c107fcf.30691"]]},{"id":"2f37c072.193ab","type":"comment","z":"6b10094.71840f8","name":"Remember to replace these with your GPIO flow ! ! !","info":"","x":550,"y":760,"wires":[]},{"id":"605dd683.ecd808","type":"ui_group","z":"","name":"logo","tab":"eaf059ca.3af5a8","order":3,"disp":false,"width":8,"collapse":false},{"id":"eaf059ca.3af5a8","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":2,"disabled":false,"hidden":false}]

Remember to replace the function node and switch start node with your GPIO input node.

You put switch -> switch (not the UI one) -> then the thing that I need to replace. GPIO has only a single output. I can't connect it by 2 sides. Also, do you want me to connect just the GPIO node, or GPID + timed-counter?