Rules Programming for Major Holidays

In some applications it may be desirable to program the M1 to respond differently or trigger a different set of commands on nationally recognized major holidays.  A homeowner may wish to delay or suppress a wake up sequence of rules.  A business with a door that automatically unlocks at the start of the day would not want the door to unlocked when they are closed for a holiday.  Using rules it is possible to accommodate these scenarios.

 

For example, a business may desire to have the main entry automatically unlocked at 8:00am on Monday through Friday.  However, on New Year's day the business is closed, so the door should not be unlocked.  A phantom output could be used as a flag to indicate when the time/day based rule should work.

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS JANUARY
AND THE DAY OF THE MONTH IS 1
THEN TURN OUTPUT 100 ON FOR 24 HRS

WHENEVER THE TIME IS 8:00AM
AND OUTPUT 100 STATE IS OFF
THEN TURN Main Entry (Out 7) ON

closed-open-neon

So, on January 1st, the phantom output is turned on for a day and this prevents the "automatic unlock" rule from triggering. 

Simply write a rule for each holiday/expected closing that turns on the phantom output on for 24 hours and you have it.  Sure, it sounds easy enough and it is for holidays and expected closings that occur on the same DATE every year.  But what about those holidays that follow a different pattern, such as Thanksgiving?  It falls on the fourth Thursday of November.  So the challenge is to determine which dates in November Thanksgiving could fall on in any given year and write the rule(s) to follow that pattern.  Thanksgiving can fall on dates ranging from November 22 to November 28. Using that information we can write the following rules for Thanksgiving.

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS NOVEMBER
AND THE DAY OF THE MONTH IS LATER THAN 21
AND THE DAY(S) OF THE WEEK IS/ARE ----T--
AND Thanksgiving (Counter 1) IS EQUAL TO 0
THEN TURN OUTPUT 100 ON FOR 24 HRS
THEN SET Thanksgiving (Counter 1) TO 1

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS DECEMBER
AND THE DAY OF THE MONTH IS 1
THEN SET Thanksgiving (Counter 1) TO 0

Admittedly, Thanksgiving is one of the more complicated examples and requires 2 rules where most holidays require only 1.  In years where Thanksgiving occurs on the 22nd, there is another Thursday in November after Thanksgiving.  So in the example above the value of a counter is referenced in an AND statement.  The counter must equal 0 for the rule to be executed and this rule sets the counter to 1 which would prevent the rule from triggering the following Thursday.  The second rule resets the counter on December 1, so it will work properly the following year.

Below are the rules that would be required for the following major US holidays:

New Year's Day

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS JANUARY
AND THE DAY OF THE MONTH IS 1
THEN TURN OUTPUT 100 ON FOR 24 HRS

Memorial Day

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS MAY
AND THE DAY OF THE MONTH IS LATER THAN 24
AND THE DAY(S) OF THE WEEK IS/ARE -M-----
THEN TURN OUTPUT 100 ON FOR 24 HRS

Independence Day

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS JULY
AND THE DAY OF THE MONTH IS 4
THEN TURN OUTPUT 100 ON FOR 24 HRS

Labor Day

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS SEPTEMBER
AND THE DAY OF THE MONTH IS EARLIER THAN 8
AND THE DAY(S) OF THE WEEK IS/ARE -M-----
THEN TURN OUTPUT 100 ON FOR 24 HRS

Thanksgiving Day

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS NOVEMBER
AND THE DAY OF THE MONTH IS LATER THAN 21
AND THE DAY(S) OF THE WEEK IS/ARE ----T--
AND Thanksgiving (Counter 1) IS EQUAL TO 0
THEN TURN OUTPUT 100 ON FOR 24 HRS
THEN SET Thanksgiving (Counter 1) TO 1

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS DECEMBER
AND THE DAY OF THE MONTH IS 1
THEN SET Thanksgiving (Counter 1) TO 0 

Christmas Day

WHENEVER THE TIME IS 12:00AM
AND THE MONTH IS DECEMBER
AND THE DAY OF THE MONTH IS 25
THEN TURN OUTPUT 100 ON FOR 24 HRS

Scroll to Top