Apex Code to defer after outage

jhatfield

Active Member
View Badges
Joined
Jan 28, 2016
Messages
227
Reaction score
123
Location
Santa Barbara, CA
Rating - 0%
0   0   0
In apex I currently have skimmers, ato, etc. to defer 10 or 20min after the return pump is switched back on. Is there some sort of code that can defer after an outage? Like a "defer" after losing contact? Example... My ato currently has this config:
Fallback OFF
Set ON
If Output RetPump_2_3 = OFF Then OFF
Defer 020:00 Then ON
It would be great if it waited 20min after power is restored just like a maintenance cycle when I switch of the return pump.
 

Brett S

Valuable Member
View Badges
Joined
Nov 28, 2016
Messages
1,062
Reaction score
1,373
Location
Orlando
Rating - 0%
0   0   0
There absolutely is. Just add this to the bottom of your code:

If Power Apex Off 020 Then OFF

That will cause the outlet to stay off for 20 minutes after a power outage. Change the number if you want more or less than 20 minutes.
 

Hallowhead

2500 Club Member
View Badges
Joined
Mar 27, 2019
Messages
2,935
Reaction score
1,422
Location
New Jersey
Rating - 0%
0   0   0
There absolutely is. Just add this to the bottom of your code:

If Power Apex Off 020 Then OFF

That will cause the outlet to stay off for 20 minutes after a power outage. Change the number if you want more or less than 20 minutes.
This is awesome I'll be adding this to several as well
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,214
Location
Oregon
Rating - 0%
0   0   0
Let me add a little clarification on the correct use of "If Power". It can be used in a couple of different scenarios:

Scenario 1: Apex connected without any backup battery
In this scenario, when the power fails the Apex and all connected devices lose power and shut down. Once the power is restored, the "If Power" command can be used to delay the startup of connected devices by specifying the number of minutes to wait:

If Power Apex Off 020 Then OFF

In order for this scenario to work properly, you must ensure the "Power Monitor" setting under the Misc Setup screen is set to Disabled.

You can also monitor the power status of an individual EnergyBar in case there's a circuit breaker problem, for example to send you an alert if one of your EnergyBars is off but the Apex is still powered by another EnergyBar or module:

If Power EB832 Off 000 Then ON

Scenario 2: Apex connected to a backup battery
In this scenario, one or more EnergyBars are connected to a UPS backup battery to supply electriciy during a power failure. In order for the Apex to know the power is out, you must have the optional 12v Auxiliary power adapter plugged into the Apex, and Enable the "Power Monitor" setting under the Misc Setup screen. The 12v adapter must be plugged into an unprotected outlet. With this configuration, the Apex monitors the 12v power adapter, and when it senses no power, the Apex knows it's running on battery power. You can then program selected outputs to shut down during the power failure to preserve the battery life, with or without an additional delay after the power is restored:

If Power Apex Off 000 Then OFF

Typically items like return pumps, skimmers, heaters, lights, dosing pumps, reactor pumps, etc., should be turned off so you can keep powerheads running as long as possible for water movement.

See my tutorial on Apex Power Monitoring for more details:
 

Clear reef vision: How do you clean the inside of the glass on your aquarium?

  • Razor blade

    Votes: 137 60.4%
  • Plastic scraper

    Votes: 64 28.2%
  • Clean-up crew

    Votes: 81 35.7%
  • Magic eraser

    Votes: 39 17.2%
  • Other

    Votes: 63 27.8%
Back
Top