Help with OmniPro automation scripting Time commands

2MuchTech

Member
I'm looking for some help with some of the time based Automation script commands available for the OmniPro II in PC Access.  Specifically, I'd like to have the controller do something when a specific zone triggers and it's somewhere between 30 minutes prior to sunset and 30 minutes after sunrise (i.e. it might still be dark enough to require lights, but the Dark condition isn't necessarily true yet/still).
 
So on the surface it would seem that you could code the sunset portion as:
 
WHEN Entry Door NOT READY
   AND IF DARK
   OR
   AND IF TIME IS LESS THAN 30 MINUTES BEFORE SUNSET 
      THEN Hallway Light ON FOR 2 MINUTES
      THEN Garage Lights ON FOR 2 MINUTES
 
 
But I didn't get the results I was expecting (and it's a pain to test because it's based on a constantly changing clock condition).  Since the above code is apparently wrong, I assume that the correct interpretation of the "IF TIME" condition is not the intuitive sounding "if it's less than 30 minutes until sunset occurs", but rather it's actually "if the number of minutes that have passed this day is less than the number of minutes that have passed this day when sunset occurs minus 30".  
 
In other words, the IF TIME condition is a test of the absolute number of minutes that have passed compared to the absolute number of minutes that an event like SUNSET occurs at.  So in effect, when you're setting up an IF TIME condition that's related to BEFORE a certain time, you need to use the GREATER THAN condition instead of the LESS THAN condition?  Seems to be an instance where the "English-like" scripting language is misleading if you read it as English :)
 
Is this correct, and if so, am I missing anything?
 
Back
Top