Page 1 of 1

Dual ATO based on time

Posted: Fri Oct 23, 2015 11:54 am
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.
}
 

Re: Dual ATO based on time

Posted: Fri Oct 23, 2015 11:56 am
by rimai
Remove the leading zero of 08

Re: Dual ATO based on time

Posted: Fri Oct 23, 2015 12:06 pm
by DmnYnkee
That was it. Thanks, Roberto!

Cheers

Re: Dual ATO based on time

Posted: Sat Oct 31, 2015 6:14 am
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.
}

Re: Dual ATO based on time

Posted: Sat Oct 31, 2015 10:53 am
by rimai
Hour can never be greater than 20 and less than 8.
&& = and
|| = or

Re: Dual ATO based on time

Posted: Sat Oct 31, 2015 11:33 am
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.

Re: Dual ATO based on time

Posted: Sun Nov 01, 2015 6:21 pm
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).

Re: Dual ATO based on time

Posted: Mon Nov 30, 2015 8:35 pm
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

Re: Dual ATO based on time

Posted: Thu Jan 21, 2016 6:53 pm
by slm222
double post

Re: Dual ATO based on time

Posted: Thu Jan 21, 2016 6:54 pm
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      



Re: Dual ATO based on time

Posted: Fri Jan 22, 2016 6:13 am
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.

Re: Dual ATO based on time

Posted: Fri Jan 22, 2016 6:57 am
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.

Re: Dual ATO based on time

Posted: Fri Jan 22, 2016 7:44 am
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.

Re: Dual ATO based on time

Posted: Fri Jan 22, 2016 7:54 am
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) 

Re: Dual ATO based on time

Posted: Fri Jan 22, 2016 7:57 am
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);
}

Re: Dual ATO based on time

Posted: Fri Jan 22, 2016 9:42 am
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.

Re: Dual ATO based on time

Posted: Fri Jan 22, 2016 12:15 pm
by slm222
ok. that makes sense. I will try it tonight at switch over. thank you.

Re: Dual ATO based on time

Posted: Fri Jan 22, 2016 7:22 pm
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?

Re: Dual ATO based on time

Posted: Fri Jan 22, 2016 9:50 pm
by lnevo
true should mean LowATO versus HighATO.

Re: Dual ATO based on time

Posted: Wed Feb 02, 2022 8:03 pm
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); 
}