Dual ATO based on time

Do you have a question on how to do something.
Ask in here.
Post Reply
DmnYnkee
Posts: 83
Joined: Mon Aug 11, 2014 6:45 am
Location: Clermont, Florida

Dual ATO based on time

Post by DmnYnkee »

Need another set of eyes please. I am planning on adding a second ATO pump so I can top off with RoDi during the daytime, and RoDi with Kalk at night.

I get the following error when trying to compile my code.

FL4.cpp:268:13: error: invalid digit "8" in octal constant

Here is the code modification I am trying:

Code: Select all

if (hour()>=08 && hour()<20)
{
 ReefAngel.SingleATO(false,Port8,180,1);   //  Sump switch.  If ATO/RoDi runs for 180 seconds, then shut off and send alert. Max times on is 1 per hour for bounce purposes.
}
 else   
{
 ReefAngel.SingleATO(false,Port5,180,1);   //  Sump switch.  If ATO/Kalk runs for 180 seconds, then shut off and send alert. Max times on is 1 per hour for bounce purposes.
}
 
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Dual ATO based on time

Post by rimai »

Remove the leading zero of 08
Roberto.
DmnYnkee
Posts: 83
Joined: Mon Aug 11, 2014 6:45 am
Location: Clermont, Florida

Re: Dual ATO based on time

Post by DmnYnkee »

That was it. Thanks, Roberto!

Cheers
Last edited by DmnYnkee on Sat Oct 31, 2015 6:16 am, edited 1 time in total.
Image
DmnYnkee
Posts: 83
Joined: Mon Aug 11, 2014 6:45 am
Location: Clermont, Florida

Re: Dual ATO based on time

Post by DmnYnkee »

So I tweaked my code to add a failsafe to my night ATO/Kalk so it would not run if pH was above 8.3, but last night it did not run at all. I can confirm that pH was lower than 8.3 from 8pm-8am.

Can someone look at my code and tell me why it's not working as I was hoping? I will add that port8 ato fired off at 10:49pm, and then no ato fired off until port8 again at 8:01am.

Code: Select all

if ((hour()>=20 && hour()<=8) && (ReefAngel.Params.PH < 830))
{
 ReefAngel.SingleATO(false,Port5,180,0);   //  Sump switch. Kalk schedule 8pm - 8am if pH < 8.3  If ATO/Kalk runs for 180 seconds, then shut off and send alert.
}
 else   
{
 ReefAngel.SingleATO(false,Port8,180,0);   //  Sump switch.  If ATO/RoDi runs for 180 seconds, then shut off and send alert.
}
Image
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Dual ATO based on time

Post by rimai »

Hour can never be greater than 20 and less than 8.
&& = and
|| = or
Roberto.
DmnYnkee
Posts: 83
Joined: Mon Aug 11, 2014 6:45 am
Location: Clermont, Florida

Re: Dual ATO based on time

Post by DmnYnkee »

Gotcha! I messed myself up when I switched the qualifier to apply to the Kalk ATO. I was thinking in clock terms instead of code terms, lol.

Thanks, yet again, Roberto!

Side note:
I figured out I had a siphon issue after the 10:49 ATO, which drained about a gallon into my sump. Thus the reason no ATO ran again until 8:01.
Image
DmnYnkee
Posts: 83
Joined: Mon Aug 11, 2014 6:45 am
Location: Clermont, Florida

Re: Dual ATO based on time

Post by DmnYnkee »

Sorry to keep bugging with this issue. But need help once again.

I updated my ATO code (again) from this: (was working correctly)

Code: Select all

if ((hour()>=20 || hour()<=8) && (ReefAngel.Params.PH < 830))
{
 ReefAngel.SingleATO(false,Port5,180,0);   //  Sump switch. Kalk schedule 8pm - 8am if pH < 8.3  If ATO/Kalk runs for 180 seconds, shut off and send alert.
}
else   
{
 ReefAngel.SingleATO(false,Port8,180,0);   //  Sump switch.  If ATO/RoDi runs for 180 seconds, shut off and send alert.
}
To this:

Code: Select all

if ((hour()>=20 || hour()<=8) && (ReefAngel.Params.PH < 830))
{
 ReefAngel.SingleATO(false,Port5,180,0);   //  Sump switch. Kalk schedule 8pm - 8am if pH < 8.3  If ATO/Kalk runs for 180 seconds, shut off and send alert.
}
else if (ReefAngel.Params.PH < 810)
{
 ReefAngel.SingleATO(false,Port5,180,0);   //  Sump switch. Use ATO/Kalk if pH < 8.1.  If ATO/Kalk runs for 180 seconds, shut off and send alert.
}
else   
{
 ReefAngel.SingleATO(false,Port8,180,0);   //  Sump switch.  If ATO/RoDi runs for 180 seconds, shut off and send alert.
}
After doing upload, Port5 turned on, and would not shut off, even though Sump float indicated full. Had to switch it from AUTO to OFF. Time was 1730, pH was 8.13, and sump float was in the green (fully topped up).
Image
slm222
Posts: 105
Joined: Wed Nov 18, 2015 9:16 pm

Re: Dual ATO based on time

Post by slm222 »

Is this code still working for you? I was thinking of something similar and glad to run across the ccode. Im thinking of having two ato pumps pull from the same RODi reserve but one go straight to the sump and the other run through a kalk reactor
slm222
Posts: 105
Joined: Wed Nov 18, 2015 9:16 pm

Re: Dual ATO based on time

Post by slm222 »

double post
Last edited by slm222 on Thu Jan 21, 2016 7:56 pm, edited 1 time in total.
slm222
Posts: 105
Joined: Wed Nov 18, 2015 9:16 pm

Re: Dual ATO based on time

Post by slm222 »

I could use some help. I copied this code and only change the amount of time its allowed to run, but now neither pump turns on when ATO Low is active


Code: Select all

 ////// ATO RO and Kalk Settings    
if ((hour()>=20 || hour()<=8) && (ReefAngel.Params.PH < 820))
{
    ReefAngel.SingleATO( false,Port7,480,0 );   //  Sump switch. Kalk schedule 8pm - 8am if pH < 8.2  If ATO/Kalk runs for 480 seconds, then shut off and send alert.
    ReefAngel.Relay.Off(Port7);
}
 else   
{
    ReefAngel.SingleATO( false,Port8,480,0 );   //  Sump switch.  If ATO/RoDi runs for 480 seconds, then shut off and send alert.
    ReefAngel.Relay.Off(Port8);
}
    ////// End ATO RO and Kalk Settings      


User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Dual ATO based on time

Post by lnevo »

Look at the ports in each statement. You should be turning off the opposite port when one is being used for ATO. Right now you declare port 7 as the ato then you turn it off for example.
slm222
Posts: 105
Joined: Wed Nov 18, 2015 9:16 pm

Re: Dual ATO based on time

Post by slm222 »

Ok, yes I will try that. Thank you for your quick response.

The reason I did it was on DMNYnkees code he said he needed to put that in order for the pumps to stay off during the switch over.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Dual ATO based on time

Post by lnevo »

Right but he's turning off Port 8 when he's ATO is on Port 5 and vice-versa. You were turning off Port 7 when your ATO was on Port 7... which is a conflict.
slm222
Posts: 105
Joined: Wed Nov 18, 2015 9:16 pm

Re: Dual ATO based on time

Post by slm222 »

oh I see now.

I just tried the code below and after 8 am the kalk pump still turned on instead of the regular pump

Code: Select all

if ((hour()>=20 || hour()<=8) && (ReefAngel.Params.PH < 825))
{
    ReefAngel.SingleATO( true,Port7,300,0 );   //  Sump switch. Kalk schedule 8pm - 8am if pH < 8.3  If ATO/Kalk runs for 210 seconds, then shut off and send alert.

}
 else 
{
    ReefAngel.SingleATO( true,Port8,480,0 );   //  Sump switch.  If ATO/RoDi runs for 210 seconds, then shut off and send alert.

}
I tried adding this to the regular pumps code, but didn't work

Code: Select all

else if (hour()>=8 || hour()<=20) 
slm222
Posts: 105
Joined: Wed Nov 18, 2015 9:16 pm

Re: Dual ATO based on time

Post by slm222 »

I will try this, with the relay off ports corrected, when I go home for lunch.

Code: Select all

if ((hour()>=20 || hour()<=8) && (ReefAngel.Params.PH < 825))
{
    ReefAngel.SingleATO( true,Port7,300,0 );   //  Sump switch. Kalk schedule 8pm - 8am if pH < 8.3  If ATO/Kalk runs for 210 seconds, then shut off and send alert.
    ReefAngel.Relay.Off(Port8);
}
 else 
{
    ReefAngel.SingleATO( true,Port8,480,0 );   //  Sump switch.  If ATO/RoDi runs for 210 seconds, then shut off and send alert.
    ReefAngel.Relay.Off(Port7);
}
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Dual ATO based on time

Post by lnevo »

If you want it to go to 8am you need to change <=8 to <8 otherwise it will go to 8:59am.

Also the Off's are needed for sure to make sure the port you want off stays off.
slm222
Posts: 105
Joined: Wed Nov 18, 2015 9:16 pm

Re: Dual ATO based on time

Post by slm222 »

ok. that makes sense. I will try it tonight at switch over. thank you.
slm222
Posts: 105
Joined: Wed Nov 18, 2015 9:16 pm

Re: Dual ATO based on time

Post by slm222 »

thank you very much for correcting my oversight! I am curious as to whether or not it should have true or false in the statement and not sure what that represents?
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Dual ATO based on time

Post by lnevo »

true should mean LowATO versus HighATO.
Reefology
Posts: 209
Joined: Fri Dec 26, 2014 6:38 pm

Re: Dual ATO based on time

Post by Reefology »

anyone see any issues with this?

Code: Select all

//kalk reactor
if ((hour()>=23 || hour()<=14) && (ReefAngel.Params.PH < 830))
{
 ReefAngel.DosingPumpRepeat2( Port7 );   //  Kalk schedule 11pm - 2pm if pH < 8.3  kalk dosed as per portal settings
}
else   
{
 ReefAngel.Relay.Off( Port7); 
}
Image
Post Reply