please send how to connect and how control motors based on flow switch
Looks like a job for lua scripting.