Not getting the workaround for no AND statment

Titleist

Active Member
View Badges
Joined
Jan 12, 2019
Messages
146
Reaction score
43
Location
Wisconsin
Rating - 0%
0   0   0
Looking to alarm my fuge light and trying to come up with statment that does:

If (Time 21:01 to 11:01 AND Fuge_Light Watts < 10) Then ON

So that if the light's supposed to be on but there's no wattage I get the alarm. Not finding anything that makes sense on Apex forums.
 
OP
OP
Titleist

Titleist

Active Member
View Badges
Joined
Jan 12, 2019
Messages
146
Reaction score
43
Location
Wisconsin
Rating - 0%
0   0   0
how are you nesting them? Just 01 if/then, 02 if then? Doesn't that evaluate each statement separately?
 

LobsterOfJustice

Valuable Member
View Badges
Joined
Dec 3, 2013
Messages
1,312
Reaction score
1,358
Location
Cary, NC
Rating - 0%
0   0   0
Set off
If Fuge_Light Watts < 10 then on
If time 11:01 to 21:01 then off

If you have other statements in your email alarm outlet, you should put these statement in a virtual outlet, and then trigger the email alarm outlet when the VO is on.

Looking to alarm my fuge light and trying to come up with statment that does:

If (Time 21:01 to 11:01 AND Fuge_Light Watts < 10) Then ON

So that if the light's supposed to be on but there's no wattage I get the alarm. Not finding anything that makes sense on Apex forums.
 

Sleepydoc

Valuable Member
View Badges
Joined
Apr 10, 2017
Messages
1,423
Reaction score
1,266
Location
Minneapolis, MN
Rating - 0%
0   0   0
The lack of boolean operators can be a pain when programming the Apex. The above technique works for what you want to do.

One other general idea when programming your Alarms - I have my alarms separated. The less important alarms (like the ATO being low) are listed first followed by a “if time 2200 to 0600 then off” statement. After that I have the more critical alarms, like the leak detector.

You can also use virtual outlets.
 
OP
OP
Titleist

Titleist

Active Member
View Badges
Joined
Jan 12, 2019
Messages
146
Reaction score
43
Location
Wisconsin
Rating - 0%
0   0   0
I have all mine in virtual outlets for each device and function as well, just more logical to trace and watch. Actually since I have the app on the phone I don't even create emails anymore or texts because the app puts them on my home screen anyway. So in essence, what it seems is happening here is the loop executes at a rate fast enough that by the time the watt code is supposed to send an alarm the next line checks the time and stops it before the line before it can execute? If that's the case that's a poor compiler. Or if it's ANDING each line with the next that's also pretty poor execution.

They're halfway there, why not just allow full basic programming of this all? Unless there's licensing issues then I can understand but it seems like most of the programming questions here come from the fact that Apex makes it illogical to write code when a complete basic compiler would make it simpler for people to learn.
 

Sleepydoc

Valuable Member
View Badges
Joined
Apr 10, 2017
Messages
1,423
Reaction score
1,266
Location
Minneapolis, MN
Rating - 0%
0   0   0
I think part of the reason it's difficult is because they are constrained by their hardware. The apex classic came out > 10 years ago at a time when embedded processors were not nearly as powerful and memory was in short supply. I don't know for sure, but it seems to essentially be a command line interpreter.

There are a couple of options to do what you're trying to do:
  • Go to the inputs screen and select the Amps or Watts input for the outlet you're interested in and set the parameters.
  • Within the programming for the Alarm (or any other outlet) you can use a statement like "If Output [Outlet Name] < 100 Then ON" These both do essentially the same thing and will only activate if the outlet is actually on. The 2nd option is a bit clearer, IMO. Otherwise you get an alarm, but the alarm outlet itself is off, so you're trying to figure out where it came from.
  • If those don't work, then you can use a virtual outlet with the time statement like Lobster suggested.
The other thing I have done is put a defer statement in my alarm code. Frequently the power will take a few seconds to stabilize when things come on. I haven't figured out if it's the device itself, or if it's artifact from the EB832 reading. Regardless I was getting alarms that would come on and then immediately turn off. By deferring the alarm outlet for 30 seconds I eliminated those.
 

Keeping it clean: Have you used a filter roller?

  • I currently use a filter roller.

    Votes: 34 30.4%
  • I don’t currently use a filter roller, but I have in the past.

    Votes: 3 2.7%
  • I have never used a filter roller, but I plan to in the future.

    Votes: 30 26.8%
  • I have never used a filter roller and have no plans to in the future.

    Votes: 40 35.7%
  • Other.

    Votes: 5 4.5%
Back
Top