Neptune Apex Programming Tutorials, Part 6: Alarms

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,212
Location
Oregon
Rating - 0%
0   0   0
Seawitch submitted a new Article:

Neptune Apex Programming Tutorials, Part 6: Alarms

This article is Part 6 of a series. Feel free to go back and read Part 1, Part 2, Part 3, Part 4, or Part 5.

This article and several future ones by the same author were originally part of several presentations made to a local aquarium club on programming your Neptune Apex Controller. The article is reprinted with permission from the author.

Because this topic will be of great interest to some readers but no interest to others who have not automated their systems, R2R will run these programming articles every Friday until we come to the end of the series.

Photos, images, and diagrams included in this article below are all courtesy of the author, @SuncrestReef ©2019, All Rights Reserved.

~~~~~~~~~~~~~~~~~~~

For inspiration, here's a spectacular Cyphastrea macro photo from the author's reef tank.
Cyphastrea (1).jpg


Alarms

The Apex provides a useful--though limited--way to notify you when something is wrong with your system. A variety of built-in alarms as well as a programmable alarm output can be configured to selectively draw your attention to problems. There are several sources of alarms:
  • Inputs — Probes, switches, and power meters can all be configured to alarm based on state or measured value.
  • EmailAlm output — Custom programming can be used to alarm based on typical output commands
  • When command — The When countdown timer generates an error condition alarm and sets the output slider to the OFF position.
  • Module errors — Certain Apex modules have built in safeguards that generate alarms when a problem is encountered.
Note: If you have an older Apex with the Display module, it provides audible alarms through a small speaker. These alarm outputs named SndAlm_I6 and SndWrn_I7 serve no purpose if you don’t have the display module, even though they are still listed as outputs on every Apex unit, including current models.

When the Apex has an active alarm condition, it can send a notification via email, SMS text message, or directly to the Fusion App on a smartphone or tablet. In addition, all alarms are added to the Apex Alarm Log that can be reviewed later:

image7-1.png


Setting up alarm notifications:

1. In Fusion, click the down arrow next to your username at the upper right, then click Settings.

image7-2.png

2. Click Notifications on the left.

image7-3.png

3. To add a recipient, click the plus sign icon at the upper right.

4. Select the method of notification. If you want SMS text messages, choose your wireless carrier from the list.

image7-4.png

5. Enter the email address or phone number.

6. After adding a new entry, you will receive a verification code at that address or phone number.

image7-5.png

Note: If you are adding someone else and don't have access to their email or phone, you can click Cancel on this screen. Later when they can tell you the verification code, you can go back to the list of recipients and enter the verification code. Just click the gear icon next to their address and click
Verify:

image7-6.png

You can have multiple destinations for alarms. I send them to both email and my iPhone for redundancy. I also add my tank sitter to the list before I’m going out of town, and then remove her from the list when I return.

Configuring alarms

There are a few different ways to configure alarms. The simplest method for probes or certain Inputs is to use the built-in alarm feature on its configuration page. This is available for:
  • Temperature probes
  • Conductivity (salinity) probes
  • pH probes
  • ORP probes
  • Flow sensors
  • EB832 ammeter and watt meter inputs
  • PAR sensor
  • Trident measurements
You can either us the Basic alarm settings, where it will trigger an alarm if above or below your specified values:

image7-7.png


or use Advanced alarm settings which gives you more flexibility:

image7-8.png

Any Inputs with alarms configured will display a checkmark under the Alarm column in the list of Inputs:

image7-9.png


Alarm Programming

For items that don’t have built in alarm settings on the configuration page, you must add lines of program code to the EmailAlm output. The command used for this is typically a simple If command. Any line of code that evaluates as True will trigger the alarm. Here are some examples:

Float switch:

If FW_HI CLOSED Then ON

Virtual output:

If Output Alert_2Part = ON Then ON

When command error:

If Error ATK_PMUP Then ON

Module error:

If Error Trident_16_3 Then ON

The EmailAlm output itself behaves exactly like any other outlet and follows the same logic that I’ve covered in earlier tutorial topics. The commands are processed from top to bottom, and the last line that evaluates to True sets the state of the output. If anything sets it to On, then the alarm will be triggered and notifications will be sent. Once that condition is no longer True, and if no other command turns the outlet On, then the output is turned Off and the alarm is cleared. A notification is also sent when the alarm turns Off.

With this in mind, you should always start your program with an initial Set OFF command, and then follow it with lines that could potentially turn it On.

One of the major limitations with alarm programming is that only the last line that turns the output On is the line of text you’ll receive in the notification. In other words, if there are 3 different lines of code that all evaluate True and turn the output On, only the last one will be displayed in your notification email or text message. For this reason it’s recommended to sequence your alarm programming so the least important things are at the top, and the most critical things are at the end. For example, if your EmailAlm output program is checking for high temperature and also checking if the skimmer-cup, float switch is on:

Set OFF
If Temp > 99 Then ON
If SkimmerFull = CLOSED Then ON


and if both of these conditions are true, the only notification you will get is about the skimmer. If you got that message while you’re at a movie theater, you probably wouldn’t rush right home and instead you'd stay to see the movie credits and any blooper scenes. But you wouldn’t realize that the water temperature is killing everything in your tank.

It would be better to change the sequence to:

Set OFF
If SkimmerFull = CLOSED Then ON
If Temp > 99 Then ON


Now when you receive the alarm about the Temp > 99, you’ll run out of the theater and head right home. After dumping frozen water bottles into your tank, you’ll also eventually notice that your skimmer is full even though you didn't get a notification about it.

Just think through your priorities when sequencing your alarm programming.

Once you have your EmailAlm output programmed, but sure to leave its tile on the dashboard in the AUTO position. If you ever slide it to OFF, you will not receive any alarms you programmed, If you slide it to ON, it will just send you a notification right away regardless of your programming. It’s best to just always leave it set to AUTO.

Nuisance Notifications

Once an alarm is triggered, the email and text notifications will be sent to you every hour until the alarm condition is cleared. For trivial things, such as the skimmer cup full example above, this can be very annoying. The best way to avoid excess notifications is to use a virtual output with its own programming including a timer, and then use that virtual output’s state in your alarm programming. This was discussed in my previous tutorial on virtual outputs, but I’ll present it again here.

When my 2-part dosing containers are low, the optical sensors inside will report OPEN. I use a virtual output to monitor this condition to turn the virtual output On, then use a When timer of 10 minutes to turn the virtual output to manual OFF. It also ignores the optical sensor at night when I’m sleeping with an If Time command:

Set OFF
If ALK_LO OPEN Then ON
If CAL_LO OPEN Then ON
If Time 23:00 To 07:00 Then OFF
Defer 001:00 Then ON
When On > 010:00 Then OFF


Then in my alarm programming, I just check the status of the virtual output:

If Output Alert_2Part = ON Then ON

Now I don’t need to worry about low 2-part waking me up at 3 a.m., and during the day if it’s low it will only send me one notification instead of nagging every hour.

I use several virtual outputs exclusively for alarm programming. Here’s my current EmailAlm output programming:

Set OFF
If Output Alert_2Part = ON Then ON
If Output Alert_FW_HI = ON Then ON
If Output Alert_FW_LO = ON Then ON
If Output Alert_SkmFul = ON Then ON
If Output Alert_FUG_Hi = ON Then ON
If Error Trident_16_3 Then ON
If Error ATK_PMUP Then ON
If Output vATO_Off = ON Then ON
If Output Alert_SmpFlo = ON Then ON
If Output vSmp_Hi = ON Then ON
If Output vSMP_Lo = ON Then ON
If Output Alert_Power = ON Then ON
If Output Alert_Leak = ON Then ON


Again, I want to emphasize the importance of placing the least important alarm conditions at the top of the list, and the most critical towards the bottom.

Be sure to configure your alarms. It’s one of the most important reasons for using a controller. The sooner you know there’s a problem, the sooner you can work on fixing it.

Stay tuned for our next tutorial on Feed Cycles.

~~~~~~~~~~

We encourage all our readers to join the Reef2Reef forum. It’s easy to register, free, and reefkeeping is much easier and more fun in a community of fellow aquarists. We pride ourselves on a warm and family-friendly forum where everyone is welcome. You will also find lots of contests and giveaways with our sponsors.

~~~~~~~~~~~

Author Profile: @SuncrestReef

John Halsey is a reefing hobbyist who keeps a Red Sea Reefer XL 425 in his living room. He is new to reefing with just over one year of experience, but has been successful in keeping a healthy mixed reef by following best practices learned here on R2R as well as actively participating in his local aquarist club--PNWMAS--in Portland, Oregon. John retired from his 30-year career in IT support, and put that technical expertise to good use by automating much of his aquarium equipment with an extensive Neptune Apex system.

~~~~~~~~~~~
 

TX_Punisher

Valuable Member
View Badges
Joined
Jun 8, 2017
Messages
1,420
Reaction score
790
Rating - 0%
0   0   0
Good stuff. Quite timely. Trying to figure out how to get Apex fusion to email me everyday at the same time just to verify it has power and internet connectivity.
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,212
Location
Oregon
Rating - 0%
0   0   0
Good stuff. Quite timely. Trying to figure out how to get Apex fusion to email me everyday at the same time just to verify it has power and internet connectivity.

If you really want a daily email, you could set up a virtual output with If Time command to turn it on at a particular time each day, then reference that output in your alarm coding. It would end up sending an ON and a follow OFF notification and there’s no way around the OFF notification.
 

ca1ore

10K Club member
View Badges
Joined
Oct 28, 2014
Messages
13,803
Reaction score
19,657
Location
Stamford, CT
Rating - 0%
0   0   0
I have a clarification as I am about to use the When command for the first time. It is my understanding that when executed, the When command simply puts the outlet into an off condition; it does not move the slider to OFF from AUTO. So, as example, a line of code in my ATO outlet that says 'When ON > 001:00 Then OFF' means that the pump will operate for a maximum of one minute before turning off, but the outlet will stay in AUTO mode so that the next time any other If conditions are met (like a float switch) the outlet will still trigger?
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,212
Location
Oregon
Rating - 0%
0   0   0
I have a clarification as I am about to use the When command for the first time. It is my understanding that when executed, the When command simply puts the outlet into an off condition; it does not move the slider to OFF from AUTO. So, as example, a line of code in my ATO outlet that says 'When ON > 001:00 Then OFF' means that the pump will operate for a maximum of one minute before turning off, but the outlet will stay in AUTO mode so that the next time any other If conditions are met (like a float switch) the outlet will still trigger?

The When command actually moves the slider from AUTO to the OFF position, and after that your program code will no longer run until you manually move the slider back to AUTO. This is the only command that can manipulate the slider position. Neptune added the When command to act as a safeguard, and it forces you to investigate what is causing the output to run longer than expected. It's typically used for ATO pumps so you don't accidentally overfill your tank with fresh water, killing your livestock and flooding your house.
 

ca1ore

10K Club member
View Badges
Joined
Oct 28, 2014
Messages
13,803
Reaction score
19,657
Location
Stamford, CT
Rating - 0%
0   0   0
Ah, interesting. I misinterpreted what it does then. Thanks.
 

Marlon C

Well-Known Member
View Badges
Joined
May 28, 2019
Messages
657
Reaction score
327
Rating - 0%
0   0   0
I have a question. Is there any way to program the apex to reset of fusion is lost? If there isnt will thos switch work

To cut off the power via wifi and then turn it back on? If I plug the base to this and this to the eb832 or will the ports on apex fry it?
 

SwiftStorm

Active Member
View Badges
Joined
Jul 6, 2018
Messages
248
Reaction score
60
Location
Indiana
Rating - 100%
1   0   0
Trying to setup email alarm, but I do not have a NOTIFICATION in step 2. Does anyone know why I only have OPTIONS, DISPLAY, PASSWORD, and TOURS?

Never mind, I was not on fusion.
 
Last edited:

Stubro

New Member
View Badges
Joined
Jun 25, 2014
Messages
19
Reaction score
47
Location
Tampa,fl
Rating - 0%
0   0   0
@SuncrestReef would you mind posting what your Alert_Leak virtual outlet looks like? Would love to see how you configured it and in searching in Apex and here I dont see it. Thanks!
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,212
Location
Oregon
Rating - 0%
0   0   0
@SuncrestReef would you mind posting what your Alert_Leak virtual outlet looks like? Would love to see how you configured it and in searching in Apex and here I dont see it. Thanks!

It's very basic. I have two leak sensors and simply turn on the Alert_Leak output if either sensor is reporting wet for longer than 5 seconds:

[Alert_Leak]
Set OFF
If LkSump CLOSED Then ON
If LkCrpt CLOSED Then ON
Defer 000:05 Then ON
 

SwiftStorm

Active Member
View Badges
Joined
Jul 6, 2018
Messages
248
Reaction score
60
Location
Indiana
Rating - 100%
1   0   0
I was able to setup probe alarms. Trying to figure out an alarm for cor 15 powered through link port on eb832. There aren't any tasks setup for this. Please help.
Thanks
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,212
Location
Oregon
Rating - 0%
0   0   0
I was able to setup probe alarms. Trying to figure out an alarm for cor 15 powered through link port on eb832. There aren't any tasks setup for this. Please help.
Thanks

What specifically are you wanting alarms for on your COR 15? Please describe your scenario.
 

SwiftStorm

Active Member
View Badges
Joined
Jul 6, 2018
Messages
248
Reaction score
60
Location
Indiana
Rating - 100%
1   0   0
I would like an alarm or two telling me if there temp or rpm changes. Rpm is currently at 1804 and temp is 48%.
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,212
Location
Oregon
Rating - 0%
0   0   0
I would like an alarm or two telling me if there temp or rpm changes. Rpm is currently at 1804 and temp is 48%.

Unfortunately the COR temperature and RPM values are not available in the Apex programming language, so there’s no way to program against them. It’s only viewable on the dashboard tile.

However, you can configure the COR to report specific errors in the COR Configuration screen:

3EB21CE9-1BE4-4153-994F-1ECFB0A6BAD4.png

Then add this line to your EmailAlm program:

If Error COR_name Then ON
 

leaheva04

New Member
View Badges
Joined
Oct 22, 2020
Messages
12
Reaction score
0
Location
solvay
Rating - 0%
0   0   0
@SuncrestReef I just set up my leak sensor and it’s sending me a alarm that’s saying if leak is < 27.5 then close . But I don’t understand because I only have the option to open or close I would greatly appreciate your help
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,212
Location
Oregon
Rating - 0%
0   0   0
@SuncrestReef I just set up my leak sensor and it’s sending me a alarm that’s saying if leak is < 27.5 then close . But I don’t understand because I only have the option to open or close I would greatly appreciate your help
Please post your programming from the EmailAlm output.

Also, go into your list of Inputs and look for the name Leak. Click it and post a screenshot of its settings.
 

A worm with high fashion and practical utility: Have you ever kept feather dusters in your reef aquarium?

  • I currently have feather dusters in my tank.

    Votes: 73 37.8%
  • Not currently, but I have had feather dusters in my tank in the past.

    Votes: 66 34.2%
  • I have not had feather dusters, but I hope to in the future.

    Votes: 25 13.0%
  • I have no plans to have feather dusters in my tank.

    Votes: 28 14.5%
  • Other.

    Votes: 1 0.5%
Back
Top