AC Program

alrha

Premium Member
To help others planning a program for their AC units, here is mine. I placed the legend first then the program. There are 40 commands on 11 devices.

Any feedback is of course always appreciated.

2Ka = 20K MH (150W)
2Kb = 20K MH (150W)
1Ka = 10 K MH (2x250W)
1Kb = 10k MH (2x250W)
Mlt = Moonlight (2xPFO)
Htr = Heater (300W)
Fan = Fans (1xsump 1xcanopy)
Rfg = Refugium/Sump light (96W)
Top = Top-off connected to float switch via KalkReactor
Mix = mixing pump for KalkReactor
Alm = Alarm Module

[Lighting]
If Time > 07:00 Then Mlt On
If Time > 19:00 Then 2Ka On
If Time > 20:00 Then 2Kb On
If TIme > 21:00 Then 1Ka On
If TIme > 22:00 Then 1Kb On
If Time > 04:00 Then 1Ka Off
If Time > 05:00 Then 1Kb Off
If Time > 06:00 Then 2Ka Off
If Time > 07:00 Then 2Kb Off
If Time > 19:00 Then Mlt Off
[Temp control: I would narrow/widen the ranges based on results/seasons]
If Temp < 79.0 Then Htr On
If Temp > 79.5 Then Htr Off
If Temp > 80.5 Then Fan On
If Temp < 80.0 Then Fan Off
If Temp < 80.0 Then Rfg On
If Temp > 80.5 Then Rfg Off
If Temp > 81.0 Then 1Ka Off
If Temp > 81.5 Then 1Kb Off
If Temp > 82.0 Then 2Ka Off
If Temp > 82.5 Then 2Kb Off
[Top Off / KalkReactor mixing]
If Time > 00:00 Then Top Off
If Time > 00:00 Then Mix On
If Time > 00:15 Then Mix Off
If Time > 01:00 Then Top On
If Time > 12:00 Then Top Off
If Time > 12:00 Then Mix On
If TIme > 12:15 Then Mix Off
If Time > 13:00 Then Top On
[pH stability: I would narrow/widen the ranges based on results]
If pH > 8.3 Then Top Off
if pH > 8.4 Then Rfg Off
If pH < 8.2 Then Rfg On
If Temp > 82 Then Rfg Off
[Alarm warnings: I would narrow/widen the ranges based on results]
If Temp > 77 Then Alm Off
If Temp > 83 Then Alm On
If Temp < 83 Then Alm Off
If Temp < 77 Then Alm On
If pH > 8.1 Then Alm Off
If pH > 8.5 Then Alm On
If pH < 8.5 Then Alm Off
If pH < 8.1 Then Alm On

The code is in this particular order as the until goes through the code in order with the later command overuling the prior command on the same device.

Again feedback is appreciated.

Feel free to copy this code for your systems.
 
to keep my MH lights from turning on within 15 minutes of turning off (due to heat) i would add the following code?
Max Change 015 M Then 2Ka Off
Max Change 015 M Then 1Ka Off
Max Change 015 M Then 2Kb Off
Mac Change 015 M Then 1Kb Off
 
ok, updated my program. here is the latest.

Got about 60 lines of code here. controls based on Time, pH, and Temp.

Definitions:
LtL = 10 K MH (400W)

VHO = 2x60" VHO Actinic (280W)
Mlt = 4xMoonlights
Fan = 2xFans (sump & canopy)
LtC = 10 K MH (400W)

Rfg = Refugium/Sump light (96W)
Top = Top-off via KalkReactor
Mix = Mixing pump for KalkReactor
LtR = 10 K MH (400W)

LtF = Fans in light fixture
Htr = Heater (300W)
Alm = Alarm Module

If Time > 09:00 Then Mlt On
If Time > 19:00 Then VHO On
If Time > 22:00 Then LtR On
If TIme > 22:15 Then LtC On
If TIme > 22:30 Then LtL On
If Time > 05:30 Then LtR Off
If Time > 05:45 Then LtC Off
If Time > 06:00 Then LtL Off
If Time > 09:00 Then VHO Off
If Time > 19:00 Then Mlt Off
If Timer VHO = On Then LtF On
If Timer VHO = Off Then LtF Off
If Timer VHO = On Then Mlt Off
If Timer VHO = Off Then Mlt On

If Temp < 76.5 Then Htr On
If Temp < 65.0 Then Htr Off
If Temp > 77.0 Then Htr Off
If Timer Htr = On then LtF Off
If Temp > 77.5 Then Fan On
If Temp < 77.0 Then Fan Off
If Temp < 79.0 Then Rfg On
If Temp > 79.5 Then Rfg Off
If Temp > 80.0 Then LtR Off
If Temp > 80.5 Then LtC Off
If Temp > 81.0 Then LtL Off
If Temp > 81.5 Then VHO Off

Max Change 030 M Then LtR Off
Max Change 030 M Then LtC Off
Max Change 030 M Then LtL Off
Max Change 015 M Then VHO Off
Max Change 015 M Then Rfg Off

If Time > 00:00 Then Top Off
If Time > 00:00 Then Mix On
If Time > 00:15 Then Mix Off
If Time > 01:00 Then Top On
If Time > 06:00 Then Top Off
If Time > 06:00 Then Mix On
If Time > 06:15 Then Mix Off
If Time > 07:00 Then Top On
If Time > 12:00 Then Top Off
If Time > 12:00 Then Mix On
If TIme > 12:15 Then Mix Off
If Time > 13:00 Then Top On
If Time > 18:00 Then Top Off
If Time > 18:00 Then Mix On
If TIme > 18:15 Then Mix Off
If Time > 19:00 Then Top On

If pH > 8.2 Then Top Off
if pH > 8.4 Then Rfg Off
If pH < 8.1 Then Rfg On
If Temp > 82 Then Rfg Off

If Temp > 77 Then Alm Off
If Temp > 83 Then Alm On
If Temp < 83 Then Alm Off
If Temp < 77 Then Alm On
If pH > 8.1 Then Alm Off
If pH > 8.5 Then Alm On
If pH < 8.5 Then Alm Off
If pH < 8.1 Then Alm On

If Feed cycle Then Top Off
If Feed cycle Then Mix Off​
 
Cut down to 40 lines

Cut down to 40 lines

The max the ACjr can accept is 40 lines of code, so i have to cut down my code (by 21 lines).
Here is what i cut out, if anyone else has any better ideas how i can re-program my code in fewer lines, please let me know.
Thanks.

Definitions:
LtL = 10 K MH (400W)

VHO = 2x60" VHO Actinic (280W)
Mlt = 4xMoonlights
Fan = 2xFans (sump & canopy)
LtC = 10 K MH (400W)

Rfg = Refugium/Sump light (96W)
Top = Top-off via KalkReactor
Mix = Mixing pump for KalkReactor
LtR = 10 K MH (400W)

LtF = Fans in light fixture
Htr = Heater (300W)
Alm = Alarm Module

XX) If Time > 09:00 Then Mlt On -> XXXXX
01) If Time > 19:00 Then VHO On
02) If Time > 22:00 Then LtR On
03) If TIme > 22:15 Then LtC On
04) If TIme > 22:30 Then LtL On
05) If Time > 05:30 Then LtR Off
06) If Time > 05:45 Then LtC Off
07) If Time > 06:00 Then LtL Off
08) If Time > 09:00 Then VHO Off
XX) If Time > 19:00 Then Mlt Off -> XXXXX
09) If Timer VHO = On Then LtF On
10) If Timer VHO = Off Then LtF Off
11) If Timer VHO = On Then Mlt Off
12) If Timer VHO = Off Then Mlt On

13) If Temp < 76.5 Then Htr On
XX) If Temp < 65.0 Then Htr Off -> XXXXX
14) If Temp > 77.0 Then Htr Off
XX) If Timer Htr = On then LtF Off -> XXXXX
15) If Temp > 77.5 Then Fan On
16) If Temp < 77.0 Then Fan Off
XX) If Temp < 79.0 Then Rfg On -> XXXXX
XX) If Temp > 79.5 Then Rfg Off -> XXXXX
17) If Temp > 80.0 Then LtR Off
18) If Temp > 80.5 Then LtC Off
19) If Temp > 81.0 Then LtL Off
XX) If Temp > 81.5 Then VHO Off -> XXXXX

20) Max Change 030 M Then LtR Off
21) Max Change 030 M Then LtC Off
22) Max Change 030 M Then LtL Off
XX) Max Change 015 M Then VHO Off -> XXXXX
XX) Max Change 015 M Then Rfg Off -> XXXXX

23) If Time > 00:00 Then Top Off
24) If Time > 00:00 Then Mix On
25) If Time > 00:15 Then Mix Off
26) If Time > 01:00 Then Top On
XX) If Time > 06:00 Then Top Off -> XXXXX
XX) If Time > 06:00 Then Mix On -> XXXXX
XX) If Time > 06:15 Then Mix Off -> XXXXX
XX) If Time > 07:00 Then Top On -> XXXXX
27) If Time > 12:00 Then Top Off
28) If Time > 12:00 Then Mix On
29) If TIme > 12:15 Then Mix Off
30) If Time > 13:00 Then Top On
XX) If Time > 18:00 Then Top Off -> XXXXX
XX) If Time > 18:00 Then Mix On -> XXXXX
XX) If TIme > 18:15 Then Mix Off -> XXXXX
XX) If Time > 19:00 Then Top On -> XXXXX

31) If pH > 8.2 Then Top Off
XX) If pH > 8.4 Then Rfg Off -> XXXXX
XX) If pH < 8.1 Then Rfg On -> XXXXX
XX) If Temp > 82 Then Rfg Off -> XXXXX

32) If Temp > 77 Then Alm Off
33) If Temp > 83 Then Alm On
34) If Temp < 83 Then Alm Off
35) If Temp < 77 Then Alm On
36) If pH > 8.1 Then Alm Off
37) If pH > 8.5 Then Alm On
38) If pH < 8.5 Then Alm Off
39) If pH < 8.1 Then Alm On

40) If Feed cycle Then Top Off [for adding Kalk to reactor]
XX) If Feed cycle Then Mix Off -> XXXXX​
 
You are using a lot of lines just to stir your kalkreactor, I have mine like this

OSC 010/240 ON/OFF Then KLK ON

Just stirs it 10 minutes every 4 hours.....
 
laverda said:
why dont you just have the LTF pluged into the lights. Then you can save those code lines.

good idea. guess i'll have to find some 2-to-1 three-pronged outlet doubler.
 
Acroholic said:
You are using a lot of lines just to stir your kalkreactor, I have mine like this

OSC 010/240 ON/OFF Then KLK ON

Just stirs it 10 minutes every 4 hours.....

ooh, i like that, it sounds good.
i guess that can me matched with:

If Timer MIX (or KLK) = ON Then Top Off
Max Change 030 M Then Top Off

This would now allow me to have it mixed (and keep the float switch from adding recently mixed Kalk) as many times as i want in the day. THANKS!
 
Ok, this should be my final solution then (thanks to all your feedback):

**********

LtL = 10 K MH (400W) A01
VHO = 2x60" VHO Actinic (280W) A02
Mlt = 4xMoonlights A03
Fan = 2xFans (sump & canopy) A04
LtC = 10 K MH (400W) A05
Rfg = Refugium/Sump light (96W) A06
Top = Top-off via KalkReactor A07
Mix = Mixing pump for KalkReactor A08
LtR = 10 K MH (400W) A09
LtF = Fans in light fixture A10
Htr = Heater (300W) A11
Alm = Alarm Module A12
**********
If Time > 19:00 Then VHO On
If Time > 22:00 Then LtR On
If TIme > 22:15 Then LtC On
If TIme > 22:30 Then LtL On
If Time > 23:00 Then Rfg Off
If Time > 05:00 Then Rfg On
If Time > 05:30 Then LtR Off
If Time > 05:45 Then LtC Off
If Time > 06:00 Then LtL Off
If Time > 09:00 Then VHO Off
If Timer VHO = On Then LtF On
If Timer VHO = Off Then LtF Off
If Timer VHO = On Then Mlt Off
If Timer VHO = Off Then Mlt On

If Temp < 76.5 Then Htr On
If Temp > 77.0 Then Htr Off
If Temp > 77.5 Then Fan On
If Temp < 77.0 Then Fan Off
If Temp > 81.0 Then LtR Off
If Temp > 81.5 Then LtC Off
If Temp > 82.0 Then LtL Off
If Temp < 65 Then Htr Off
If Timer Htr = On Then LtF Off

OSC 15/345 On/Off Then Mix On
OSC 60/300 On/Off Then Top Off
If pH > 8.4 Then Top Off

If Temp > 76 Then Alm Off
If Temp > 83 Then Alm On
If Temp < 83 Then Alm Off
If Temp < 76 Then Alm On
If pH > 8.1 Then Alm Off
If pH > 8.5 Then Alm On
If pH < 8.5 Then Alm Off
If pH < 8.1 Then Alm On

Max Change 030 M Then LtR Off
Max Change 030 M Then LtC Off
Max Change 030 M Then LtL Off

If Feed cycle Then Top Off
If Feed cycle Then Mix Off

**********

Feel free to ask questions...
 
Last edited:
It seems to me that you left out the line to initilize the Alm timer to start off: the usual If Time > 00:00 Then Alm OFF. Also the Max change statement should be directly under the line that you want to keep off for 30 mins. I am assuming that you intended those max changes under your temp control for the lights.
 
kbecker said:
It seems to me that you left out the line to initilize the Alm timer to start off: the usual If Time > 00:00 Then Alm OFF. Also the Max change statement should be directly under the line that you want to keep off for 30 mins. I am assuming that you intended those max changes under your temp control for the lights.

Good Idea, I just put the code for the alarm off by temp rather than by time. would have the same effect, but i think that doing it the way you suggest would save me 3 lines of code if I needed.

why should it make a dif where the max change is placed? FWIW i have not had any problems with it this way, but i am just curious what effect its proximity would have? are you just talking about it being more organized? or from an execution point of view?
 
Another reason why I suggested the code for the alarm is that you dont have a way to turn it off / reset it once it is triggered (other then to wait for your tank to meet the specific temp / ph cutoff).

In reguards to the max change statments, my comments were from an execution stand point. Your program may / can have multiple max change statements for the same timer. For example, max change for lights when it reaches a certain temp, power fail, ph, etc. If you group them all together, your lights may not function as you planned.
 
kbecker said:
Another reason why I suggested the code for the alarm is that you dont have a way to turn it off / reset it once it is triggered (other then to wait for your tank to meet the specific temp / ph cutoff).

I changed it, but how would it reset by time if it is still out of range? if pH or Temp is too high, it will ring till it comes down (with either method)

kbecker said:
In reguards to the max change statments, my comments were from an execution stand point. Your program may / can have multiple max change statements for the same timer. For example, max change for lights when it reaches a certain temp, power fail, ph, etc. If you group them all together, your lights may not function as you planned.
dont comprehend here. I just want to give them time to cool before firing up again - if it shuts for any reason.
Either way the unit will run through the entire program.

Are you saying that it would be a problem if there was a "Light ON" command before the Max change? in which case it should be placed before even the timer commands?
 
The alarm timer would be reset on the next polling of the devices, the default is every 5 mins. This is even more important if you use the email function ( you dont want the controller spamming you).

Well currently your program will run fine. But if and when you decide to modify your program with more max changes it will be a problem. Here is a example program:

If Temp > 81.0 Then LT1 Off
Max Change 010 M Then LT1 Off
If Power Fail Then LT1 Off
Max Change 030 M Then LT1 OFF

What happens here after each condition is triggered the relevant max change takes affect.

If you have this program:

If Temp > 81.0 Then LT1 Off
If Power Fail Then LT1 Off
Max Change 010 M Then LT1 Off
Max Change 030 M Then LT1 OFF

Your lights will be off for a total of 40 minutes after the power fail condition triggers (and your controller turns back on). The lights would not stay off for 10 minutes if the temp condition triggers.

The unit may run though the program, but your lights might not behave as you expected with your current Max Change code. I suggest lowering your upper temp cut off for your lights and test to make sure the Max change statements in your current code work the way you want them to.
 
interesting. i didnt know it tied in to the previous line. are you sure about this? it has been working so far...
If what you are saying is correct, i will change my code.

Is there a way to set my top-off to only be on 1 minute in 5? (to dose slowly)
such as:

OSC 15/345 On/Off Then Mix On
OSC 60/300 On/Off Then Top Off
OSC 1/004 On/Off Then Top On

The desire is to let the pump be ON 1 out of 5 min, but only after it has been off for an hour (for mix to settle).
 
The max change statement does not work as kbecker states. Only the last max change statement for each timer name has any effect.

Curt
 
Back
Top