Apex coding with FMM- need help for water change

dudemeister

New member
I got the FMM and it works as expected which is to say great. Here's my challenge - I want to trigger on a drain pump that will then cut off when the sensor gets triggered. I have the sensor mounted down in the sump to where it takes out enough water to keep the pumps submerged. I would like to do this on a schedule and on demand when using FeedD. Using FeedD for on demand change would be nice but not necessary. More importantly I'd like to trigger the drain cycle at a certain time of day so I can schedule other things like mixing the salt water prior to changing.

I currently have the outlet tied to the drain pump with this code:

Fallback OFF
Set OFF
If Output WaterCHG = ON Then ON *trigger*
If OhShit CLOSED Then OFF
If LeakDn CLOSED Then OFF
If LeakUp CLOSED Then OFF
If Output PUMPS = OFF Then OFF
If SumpL OPEN Then OFF *This is one sensor*
If SumpR OPEN Then OFF *This is the backup sensor*

and I have a virtual switch I set up called WaterCHG set up like this:

Fallback OFF
Set OFF
If FeedD 000 Then ON *FeedD is set to 1*
If Time 02:00 to 02:02 Then ON *3 minute cycle to make sure it drains*
If Time 13:00 to 13:02 Then ON
When On > 002:45 Then OFF

It seems to trigger fine but the 2 things happen- if the pump drains the water in less that 3 minutes, and hits the sensors it loops on and off until the When On statement kicks in but the problem with that is that it literally sets the WaterCGH switch to the OFF position which means it won't operate again until I reset it to AUTO.

Clearly there is a better way to accomplish this. Any help would be greatly appreciated.
 
Update- I took out the When On statement because it does set the state as Off. Now I just have a looping on/off of the pump if it drains before the 3 minutes (which it does). Not a big deal unless it hurts the pump but as I said there has got to be a more elegant way to do this. Any thoughts?

tyvm
 
Back
Top