New to Elk - Date Question

Mark S.

Active Member
I am trying to transition all my old Stargate events to ELK M1G.  I am finding some things I can't yet seem to duplicate in Elk.  For Christmas lights, I use the following in Starglish:
If after December 23 or before January 6
and time is dusk
then turn on....
 
I cannot find a date conditional in ELK, nor does there seem to be any provision for "or" logic.  Am I missing something?   Anyone have a solution or workaround?
 
Thanks.
 
It's a whenever TIME (then you add an AND conditional for the date) but keep in mind, the system doesn't know the conditional of "before" January as a relative to your rule, it only knows the present date/year, so more conditional items may need to be considered.
 
There is no OR boolean.
 
Also, when writing a rule, remember, once a section becomes false in the rule, the system no longer evaluates the rule itself, even though other operands may be true within the rule. The system will also prioritize based on the rule "location" so a numerically lower rule will fire before a numerically higher rule, even though there may be contradictions.
 
Here's something to start with.   'or's are typically handled by multiple rules with the same 'then'.  The way to get to the date is 'whenever / time ocurrence' followed by 'and / date is'. 
 


whenever the time is 1 hour after sunset

  and the month is december

  and the day of the month is later than 23

  then turn on output 10



whenever the time is 1 hour after sunset

  and the month is january

  and the day of the month is earlier than 6

  then turn on output 10



whenever the time is 10:00pm

  then turn off output 10
 
For sunrise/sunset to work correctly, you need to set your lat/long.
 
I'll be darned. I must have looked a dozen times and never saw that day of the month conditional.
Thanks.
 
Back
Top