Found out email alarm wasn't working!!!

Hawkdl2

Mad Scientist
For months I thought my system was running perfectly only to find out email alarms weren't being sent. I fixed the email set up and added an "if Time...then on" statement to turn on the email outlet each morning for 5 minutes that should send out a system check email each day. The problem is it doesn't work. I don't see the email outlet turn on in my XML Outlet log and I don't get an email. I know the alarm system otherwise works now because I've had a power failure or two and I get an email. Something must be wrong with the code. Any ideas? Is the 30 minute defer statement being applied to all statements in the list?

Set OFF
If TempDT > 83.0 Then ON
If TempDT < 76.0 Then ON
If pHmain > 08.40 Then ON
If pHmain < 07.90 Then ON
Defer 030:00 Then ON
If Outlet WaterBug = ON Then ON
If Power Apex Off 001 Then ON
If Time 09:00 to 09:05 Then ON
 
I just did a couple of tests, and your hunch is correct.

Test 1
Set OFF
If Temp > 82.0 Then ON
If Temp < 78.0 Then ON
Defer 002:00 Then ON
If Power Apex Off 001 Then ON
If Time 23:40 to 23:41 Then ON


This resulted in the outlet NOT getting turned on at 23:40.

Test 2
Set OFF
If Temp > 82.0 Then ON
If Temp < 78.0 Then ON
Defer 002:00 Then ON
If Power Apex Off 001 Then ON
If Time 23:45 to 23:48 Then ON


The outlet turned on exactly at 23:47.

...proving that the 2-minute Defer statement applies to the If Time statement below it.


Try this... change
If Time 09:00 to 09:05 Then ON
to
If Time 08:30 to 09:05 Then ON

I think you'll get the daily email at 9am sharp.

I'm running 4.04BC10 too.
 
Last edited:
The Defer statement applies to the outlet regardless of where in the program it appears. The Defer and the Min Time statements are the two statements that kind of break the 'statements are evaluated in order' rule.
 
Somehow, I had the impression that Defer only applies to statements which precede the Defer, but that obviously isn't the case.

In Larry's posted programming, the If Time 09:00 to 09:05 Then ON doesn't work as he intended due to the Defer period being 24 minutes longer than the specified time range. So how are the If Outlet WaterBug = ON Then ON and
If Power Apex Off 001 Then ON affected? Will he have 30 minutes of wet floor before the alarm is activated? Will he only be notified if the power outage is >30 minutes?
 
Will he have 30 minutes of wet floor before the alarm is activated? Will he only be notified if the power outage is >30 minutes?

I believe so. The only time the position of the Defer is important is if there are two in an outlet program and both could be true. In that case, the last Defer will take precedence. In Larry's case, that single Defer applies to the entire program, statements before it and statements after it. So yes, I think he would have a wet floor for at least 30 minutes before finding out about it.

I need to clean up that text in the User Guide to make it more clear.
 
Ok... it seems to me that the best thing to do would be to use Defer in virtual outlets only (rather than in the EmailAlarm outlet directly), and have the EmailAlarm outlet contain statements to monitor the VO. The EmailAlarm outlet would then only contain programming for immediate action.
 
Well, lengthening the forced alarm-ON period did solve the problem, but The problem with the other conditionals did occur to me this morning. Virtual outlets seem like the only solution, but will make reviewing all alarm conditions a bit of a pain.

Now I need to go through all my programing to see if I have the same Defer probem elsewhere.

On the email side, what does everyone else do to ensure their email alarm system is working?
 
I have just set mine up yesterday , but I used this statement to get three updates through the day.

If Time 09:15 to 09:20 Then ON
If Time 13:55 to 14:00 Then ON
If Time 15:55 to 16:00 Then ON

I also have temp, orp and PH levels set to email if they are over or under the desired amount.

( Although if you have an app on your phone for the Apex , which I do I will probably not need to see this anyways. )
 
Back
Top