YF-S201 Water Flow Sensor - Help with Require

Change the delay node time to suit your ramp up time. i think it is set to 5 seconds.
If the flow rate is below your compare value it will trigger the alarm.
Once- t faults, in general alarms need to be acknowledged and cleared. For this flow, you just stop the pump and start again.
If you want some kind of auto reset then you will have to loop back to the stop button and use a delay.

The system will work at a user picked time amount. So, I can't have them do it manually. How can I do the loop properly?

What exactly does that 5 seconds mean? Do I need values coming from the sensor be above the compared value for the entire length of that time?

Also, it is not working properly. You should never get a fault message, if it is not started/stopped by the user. Just stand by or stopped in these cases. I need the fault message to appear only when it is started by that switch, and there is no flow.

Edit: So, if there is no flow when it stopped/never started, then this is not a problem, not an alarming situation, because the pump itself is also connected to this same switch.

The flow i sent you will not show the fault unless it faults. If you re-deploy the flow it will send a standby first. Fault will persist unless you restart or loop back.

How can I loop it back?

You want to loop back to clear the alarm fault ?
So how will you know it faulted ?

I want to get rid of seeing fault message, when it is not even running.

I want to make it respond faster. It takes too much time for running to turn into fault message.

I want to see it turn into running again, after seeing the fault message, after blowing into it (forcing it to create pulses).

These are the goals. A few seconds of delay is okay, but when the magnets in the sensor are not turning, but the switch is on, I want to see the fault message. When the magnets are turning, and the switch is on, I want to see running message. When the switch is off, I want to see stopped message (doesn't matter if the magnets are turning, or not. By magnets turning, I mean pulse. This is why I blow into it. I think you got that part already, but I am trying to make it as clear as possible).

I kept trying, but couldn't do it. Can you help me?

This package has been fixed so should work now.

So, I downloaded this and this after uninstalling and installing smithtek-nodered-duty-standy. And my flow looks 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":500,"y":500,"wires":[["e116c5af.573e28","7791562c.bacb98","29119598.39809a","3f4d5d1a.4c6aa2"]]},{"id":"4b8f463e.a29208","type":"inject","z":"4cdd06f6.faf528","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"3","topic":"","payload":"false","payloadType":"bool","x":300,"y":560,"wires":[["3f4d5d1a.4c6aa2"]]},{"id":"3f4d5d1a.4c6aa2","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 = \"ON\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":640,"y":560,"wires":[["40b73f31.4f798"]]},{"id":"40b73f31.4f798","type":"ui_text","z":"4cdd06f6.faf528","group":"843bc78a.c5b078","order":4,"width":3,"height":1,"name":"","label":"Pump","format":"{{msg.payload}}","layout":"row-right","x":950,"y":620,"wires":[]},{"id":"b857ecb3.2c853","type":"rpi-gpio in","z":"4cdd06f6.faf528","name":"","pin":"37","intype":"tri","debounce":"25","read":false,"x":70,"y":680,"wires":[["2b598907.36ebb6"]]},{"id":"2b598907.36ebb6","type":"smithtek_duty_senseflow","z":"4cdd06f6.faf528","name":"","x":260,"y":680,"wires":[["294f5473.d400bc"]]},{"id":"294f5473.d400bc","type":"change","z":"4cdd06f6.faf528","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.flow","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":680,"wires":[["f74eb7e3.ca4c08"]]},{"id":"f74eb7e3.ca4c08","type":"rising-edge","z":"4cdd06f6.faf528","name":"","threshold":"0","x":670,"y":680,"wires":[["50972343.67a73c"]]},{"id":"50972343.67a73c","type":"timed-counter","z":"4cdd06f6.faf528","name":"","timelimit":"1","timeunit":"1000","withhold":true,"fixedtimeout":true,"pertopic":false,"x":860,"y":680,"wires":[["712cefb7.a7116"]]},{"id":"712cefb7.a7116","type":"debug","z":"4cdd06f6.faf528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1170,"y":680,"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}]

My problem is that I can count edges when it is working, but there is no way to detect if it is not working. Somehow, I need to give an error message when it is not working. In this setup, nothing happens when it is not working. To me, I don't see a way to trigger an error message like this. Any recommendations?

Feed the edges into a Trigger node, set to Send Nothing, then after a time Send the error message, and select Extend Timeout. Then if no edges are seen within the time you specify then the error message will be sent. You might want to add an Inject set to fire on startup to prime the trigger in case there are no edges at all following a reboot.

I tried your suggestion. Here is the flow:

[{"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":500,"y":500,"wires":[["e116c5af.573e28","7791562c.bacb98","29119598.39809a","3f4d5d1a.4c6aa2","74474b49.f48c94"]]},{"id":"3f4d5d1a.4c6aa2","type":"function","z":"4cdd06f6.faf528","name":"","func":"var b0 = msg.payload;\n\nif(b0 === false)\n{\n    msg.payload = \"Kapalı\";\n}\nelse if(b0 === true)\n{\n    msg.payload = \"Normal\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":560,"wires":[["40b73f31.4f798"]]},{"id":"4b8f463e.a29208","type":"inject","z":"4cdd06f6.faf528","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"3","topic":"","payload":"false","payloadType":"bool","x":300,"y":560,"wires":[["3f4d5d1a.4c6aa2"]]},{"id":"40b73f31.4f798","type":"ui_text","z":"4cdd06f6.faf528","group":"843bc78a.c5b078","order":4,"width":3,"height":1,"name":"","label":"Pump","format":"{{msg.payload}}","layout":"row-right","x":1090,"y":620,"wires":[]},{"id":"b857ecb3.2c853","type":"rpi-gpio in","z":"4cdd06f6.faf528","name":"","pin":"37","intype":"tri","debounce":"25","read":false,"x":70,"y":680,"wires":[["2b598907.36ebb6"]]},{"id":"2b598907.36ebb6","type":"smithtek_duty_senseflow","z":"4cdd06f6.faf528","name":"","x":260,"y":680,"wires":[["294f5473.d400bc"]]},{"id":"294f5473.d400bc","type":"change","z":"4cdd06f6.faf528","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.flow","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":680,"wires":[["f74eb7e3.ca4c08"]]},{"id":"f74eb7e3.ca4c08","type":"rising-edge","z":"4cdd06f6.faf528","name":"","threshold":"0","x":670,"y":680,"wires":[["50972343.67a73c","74474b49.f48c94"]]},{"id":"50972343.67a73c","type":"timed-counter","z":"4cdd06f6.faf528","name":"","timelimit":"3","timeunit":"1000","withhold":true,"fixedtimeout":true,"pertopic":false,"x":860,"y":680,"wires":[["dd83266f.a18a88"]]},{"id":"dd83266f.a18a88","type":"function","z":"4cdd06f6.faf528","name":"","func":"var c0 = msg.count;\n\nif(c0 > 10)\n{\n    msg.payload = \"Normal\";\n}\nreturn msg.payload;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1060,"y":680,"wires":[["712cefb7.a7116","40b73f31.4f798"]]},{"id":"712cefb7.a7116","type":"debug","z":"4cdd06f6.faf528","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1250,"y":680,"wires":[]},{"id":"74474b49.f48c94","type":"trigger","z":"4cdd06f6.faf528","name":"","op1":"","op2":"Bozuk","op1type":"nul","op2type":"str","duration":"3","extend":true,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":840,"y":760,"wires":[["40b73f31.4f798"]]},{"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}]

It works fine when it is off. No fault messages. Just "Kapalı". It means off. When I start it, it says "Normal", and this is okay. After waiting for 3 seconds, it turns into "Bozuk", which means faulty. This part is also correct, because I wasn't sending pulses from the sensor yet. However, when I do send pulses (and I monitor the counter to be sure), it gets stuck at "Bozuk". It should be "Normal". I couldn't get past this bug. Any recommendations?

Change the trigger node to send the OK message in the first field in the node. Then it will send that every time a good signal is received. To prevent unnecessary display updates add an RBE node after the trigger so it will not send a stream of OK messages to your display.

Now, it says OFF in first deploy. When I turn it on, it works perfectly fine. Warns when there are no pulses, says Normal when there are pulses. However, when I click on the button again, instead of saying "OFF", it first says "Normal", then "Faulty". It should just be "OFF", when I switch it off. How can I solve this? Write a function between the button and this trigger, and make it do nothing when the button is off? By button, I mean switch.

It is very difficult when you keep changing the requirements. Sorry, I haven't got time to look at this further at the moment. I suggest watching the node red essentials videos which should help you get to the stage of working things out for yourself.

I didn't change any requirements. Maybe I wasn't as clear as I thought because of my English. I am just trying to see "OFF" again, when I switch it off, after using it for a while. When I switch if off, It shows "Normal", then "Faulty", where it should just say "OFF" again, just like the beginning.

I don't think that those videos are going to help me, but I'll check them out. Thanks.

I have absolutely no idea how you are expecting to use this package. The no-flow sense format node requires the controller node to work properly. As colin pointed out, your expectations are not clear and change. I have posted you another flow. "Please Please " study the modules, read the help tab bar. look at what's going on, read my comment nodes. These nodes were designed for the application purpose you seem to be seeking.

[{"id":"ff05b403.a04d78","type":"smithtek_dutycontrol","z":"fa3c6f4c.dfa2c","name":"","senseTime":"10","primary":"Pump 1","x":1110,"y":380,"wires":[["72d238cd.814f88","5a5d5bbd.965eb4"],["e97fba40.22f1c8","3093c389.b07e1c"],["f971ca37.10efb8"],["1fe8bad7.b3c1b5"]]},{"id":"fae9b738.df0fc8","type":"smithtek_duty_pumptrip","z":"fa3c6f4c.dfa2c","name":"Pump 1 Trip","pumpNumber":1,"x":830,"y":520,"wires":[["ff05b403.a04d78"]]},{"id":"5f2b5eb6.2f932","type":"smithtek_duty_senseflow","z":"fa3c6f4c.dfa2c","name":"","x":860,"y":380,"wires":[["ff05b403.a04d78"]]},{"id":"48d42dda.e45914","type":"smithtek_duty_start_stop","z":"fa3c6f4c.dfa2c","name":"","x":860,"y":280,"wires":[["ff05b403.a04d78"]]},{"id":"3ddc1455.08fd8c","type":"inject","z":"fa3c6f4c.dfa2c","name":"Pump Start","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":560,"y":160,"wires":[["48d42dda.e45914","6f04140c.266e8c"]]},{"id":"2aac3ac0.1dc736","type":"inject","z":"fa3c6f4c.dfa2c","name":"Pump Stop","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":560,"y":200,"wires":[["48d42dda.e45914","8df09fa5.40df4"]]},{"id":"90a2a110.1466","type":"inject","z":"fa3c6f4c.dfa2c","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"105","payloadType":"num","x":350,"y":660,"wires":[["61d70bb8.51c334"]]},{"id":"61d70bb8.51c334","type":"switch","z":"fa3c6f4c.dfa2c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"99","vt":"num"},{"t":"lt","v":"100","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":380,"wires":[["61b3fc39.88ad44"],["190c4b0c.499635"]]},{"id":"af03fcbd.3d594","type":"debug","z":"fa3c6f4c.dfa2c","name":"Pump 1 running","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1720,"y":180,"wires":[]},{"id":"bbabdeeb.42f16","type":"smithtek_duty_pumptrip","z":"fa3c6f4c.dfa2c","name":"Pump 2 trip","pumpNumber":"2","x":830,"y":560,"wires":[["ff05b403.a04d78"]]},{"id":"72d238cd.814f88","type":"function","z":"fa3c6f4c.dfa2c","name":"Pump 1 Run Status / Signal","func":"var 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,"x":1500,"y":180,"wires":[["af03fcbd.3d594"]]},{"id":"e97fba40.22f1c8","type":"function","z":"fa3c6f4c.dfa2c","name":"Pump 2 Run Status / Signal","func":"let status = msg.payload\n\n\nif (status === true) {\n msg.payload = 'Pump 2 Running'\n} else {\n msg.payload = 'Pump 2 Stopped'\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":1500,"y":220,"wires":[["94b9481e.9455a8"]]},{"id":"94b9481e.9455a8","type":"debug","z":"fa3c6f4c.dfa2c","name":"Pump 2 running","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1720,"y":220,"wires":[]},{"id":"61b3fc39.88ad44","type":"change","z":"fa3c6f4c.dfa2c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":360,"wires":[["5f2b5eb6.2f932"]]},{"id":"fd0ea810.0bbea8","type":"inject","z":"fa3c6f4c.dfa2c","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"50","payloadType":"num","x":350,"y":700,"wires":[["61d70bb8.51c334"]]},{"id":"190c4b0c.499635","type":"change","z":"fa3c6f4c.dfa2c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":400,"wires":[["5f2b5eb6.2f932"]]},{"id":"a27d688d.5d75b8","type":"inject","z":"fa3c6f4c.dfa2c","name":"Reset Pump 1 Fault","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":610,"y":520,"wires":[["fae9b738.df0fc8"]]},{"id":"a6a87e3c.0b57d","type":"inject","z":"fa3c6f4c.dfa2c","name":"Reset Pump 2 Fault","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":610,"y":560,"wires":[["bbabdeeb.42f16"]]},{"id":"cea29f95.20742","type":"debug","z":"fa3c6f4c.dfa2c","name":"Pump 1 flow status","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1790,"y":440,"wires":[]},{"id":"c822eb40.885ac8","type":"debug","z":"fa3c6f4c.dfa2c","name":"Pump 2 Flow status","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1790,"y":480,"wires":[]},{"id":"6ce5f6d5.5e1ce8","type":"comment","z":"fa3c6f4c.dfa2c","name":"Simulates a flow rate","info":"Press the top button to simulate good flow\nPress the botom button to simulate bad flow\n\nFlow must be good within the delay time. \nThe delay time is configurable in the pump controller","x":330,"y":320,"wires":[]},{"id":"6af3b59c.ff012c","type":"comment","z":"fa3c6f4c.dfa2c","name":"Start Stops the pump","info":"","x":580,"y":120,"wires":[]},{"id":"d59c9ba7.401b58","type":"comment","z":"fa3c6f4c.dfa2c","name":"Pump Trip signal","info":"If a false is passed into the pump trip it will clear the pump faults\nIf a true is passed to the pump trip it will trip the pump out","x":680,"y":480,"wires":[]},{"id":"2a9b2d2c.be1df2","type":"comment","z":"fa3c6f4c.dfa2c","name":"Indicates flow rate status","info":"If good flow when the pump is running it will send false.\nIf bad flow when the pump is running it will send true","x":1810,"y":400,"wires":[]},{"id":"aebe6aa3.c488d8","type":"comment","z":"fa3c6f4c.dfa2c","name":"Pump Running Indicator","info":"This will indicate what pump is running.\n\nThe pumps operate on duty cycle ratio 1/2\n\n\nNOTE !! ! ! \n\nThis is the part that is not working correctly. \n\nIf i copnnect debug node to the outputs. they send true and false\nevery time i start/stop the pump. This is correct and seems to work. \nHowever\nIf i connect another node to this output it doesnt send the proper message.\n\nFor example, im using a function node with a If statment.\n\n//\nvar 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;\n//\n\nWhen i use this and after a couple of pump start and stops. it always says pump 2 has stopped.\n\nThis is the issue ?\n","x":1530,"y":120,"wires":[]},{"id":"5a5d5bbd.965eb4","type":"debug","z":"fa3c6f4c.dfa2c","name":"Pump 1 running Direct","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1480,"y":280,"wires":[]},{"id":"3093c389.b07e1c","type":"debug","z":"fa3c6f4c.dfa2c","name":"Pump 2 running Direct","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1480,"y":320,"wires":[]},{"id":"6f04140c.266e8c","type":"function","z":"fa3c6f4c.dfa2c","name":"Simulated flow rate running","func":"msg.payload = 105\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":380,"wires":[["61d70bb8.51c334"]]},{"id":"8df09fa5.40df4","type":"function","z":"fa3c6f4c.dfa2c","name":"Simulated flow rate stopped","func":"msg.payload = 105\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":200,"y":420,"wires":[["61d70bb8.51c334"]]},{"id":"f971ca37.10efb8","type":"function","z":"fa3c6f4c.dfa2c","name":"Pump 1 Run Status / Signal","func":"var status = msg.payload\n\n\nif (status === false) {\n msg.payload = 'Water Flowing Pump 1'\n} else {\n msg.payload = 'Water not Flowing Pump 1'\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":1500,"y":440,"wires":[["cea29f95.20742"]]},{"id":"1fe8bad7.b3c1b5","type":"function","z":"fa3c6f4c.dfa2c","name":"Pump 1 Run Status / Signal","func":"var status = msg.payload\n\n\nif (status === false) {\n msg.payload = 'Water Flowing Pump 2'\n} else {\n msg.payload = 'Water not Flowing Pump 2'\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":1500,"y":480,"wires":[["c822eb40.885ac8"]]}]

Remove the wires from the 2 function nodes i have put a green box around to the switch node.
And use just the inject 105 and the Debug 50.

  1. Press the pump start inject

  2. Press the 105 Inject button within 10 seconds

  3. Press the 50 to observe how it trips.

  4. Use the reset pump fault to reset the trip. there is one for each pump.

This thread has been superseded by this one, which @oncdastan should have mentioned here.