Jump to content
C4 Forums | Control4

Holiday exception list for US and Canada


vmax5000

Recommended Posts

I have programmed a schedule to turn on the bedroom pot lights when it's time to get up for work, but the schedule only allows for daily, weekly etc. It would be nice to have a list of all the holidays and then say weekly except for this/these holidays.

Link to comment
Share on other sites


Create boolean variable, and have the action take place if the variable is true. On the days you don't want it to turn on the next morning, use a keypad to toggle the variable farse.

Everyday at 10AM, automatically program the system to set the variable back to true so it will execute the next day.

I don't see them compiling and maintaining a list of state (there are 50 of them after all) and national holidays.

Link to comment
Share on other sites

I am not a C4 programmer but if C4 support text files, hex, and parsing this should be easy to do. I created a "Holiday" solution for Crestron using the following. Again C4 must be able to read and parse a text file.

1) I hard coded all the Holidays that are always on the same date since they never change. Example New Years, Christmas, Independence Day, etc.

2) For the Holidays that have variable dates, such as Thanksgiving, Easter, Labor Day, etc. I created program that parses the data in the .ics file and saves it to a text file so it's readable by the Crestron processor. Below is the actual text from a "Holiday" .ics file from iCal.

BEGIN:VCALENDAR

METHOD:PUBLISH

VERSION:2.0

X-WR-CALNAME:US Holidays

PRODID:-//Apple Inc.//iCal 4.0.2//EN

X-APPLE-CALENDAR-COLOR:#492BA1

X-WR-TIMEZONE:America/Los_Angeles

CALSCALE:GREGORIAN

BEGIN:VEVENT

CREATED:20090721T010305Z

UID:224FF2DF-00F8-4132-95FF-D780C0686A5F

DTEND;VALUE=DATE:20091225

RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=12

TRANSP:OPAQUE

SUMMARY:Christmas

DTSTART;VALUE=DATE:20091225

DTSTAMP:20090803T233541Z

SEQUENCE:5

END:VEVENT

BEGIN:VEVENT

CREATED:20090803T234608Z

UID:4162B846-C557-48FD-B635-E70EED88243B

DTEND;VALUE=DATE:20100705

TRANSP:TRANSPARENT

SUMMARY:Independence Day (observed)

DTSTART;VALUE=DATE:20100704

DTSTAMP:20090803T234625Z

SEQUENCE:3

END:VEVENT

BEGIN:VEVENT

CREATED:20090721T010305Z

UID:B082D697-41C2-4B14-B167-00B0497FF2D9

DTEND;VALUE=DATE:20090214

RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=2

TRANSP:OPAQUE

SUMMARY:Valentine's Day

DTSTART;VALUE=DATE:20090214

DTSTAMP:20090721T160548Z

SEQUENCE:1

END:VEVENT

BEGIN:VEVENT

CREATED:20090721T010305Z

UID:7B16E9B7-22B1-43C3-ABE2-88F29ED00000

DTEND;VALUE=DATE:20091126

RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYDAY=4TH

TRANSP:OPAQUE

SUMMARY:Thanksgiving

DTSTART;VALUE=DATE:20091126

DTSTAMP:20090803T233519Z

SEQUENCE:7

END:VEVENT

Basically I tell Crestron to do the following. (NOTE this is not Crestron programming. I am simplifying it so the basics are understood by all. If I explained it as a Crestron programmer 1, no one would understand it and 2, most importantly, no one would care)

Start at the First Instance of "BEGIN:VEvent"

Get first STRING after "DTEND;VALUE=DATE" and hold

Get the first STRING after SUMMARY: and hold

Get the first STRING after "DTSTART;VALUE=DATE:" and hold

At FIRST Instance if "END:VEVENT" parse and write data. At this point I tell Crestron to add dashes and commas.

Lets look at Thanksgiving. Parsing Thanksgiving I would end up with the following in a text file.

2009-11-26,Thanksgiving,2009-11-26

I now have a clean text file that I can parse even further if need be, have a Crestron Serial I/O read it, run it through other Serial logic, etc.

Using hex I can even break down, rearrange or extract from the line "2009-11-26,Thanksgiving,2009-11-26" in the text file using something like 012Ch - 23. What does this give me? The word "Thanksgiving". Breaking down 012Ch - 12 I am stating the following; Start at the First Instance(01) of a Comma(2C) using HEX(h) and take up to the 23rd character.

To write the whole program took me about 15-20min, and it takes the processor < a second to process the file and send the data to a text file that my Simpl program looks for. As far state holidays, personal vacations, non U.S. holidays, etc, I wrote the program so a client can enter dates and holidays manually from the touch panel.

Again if C4 supports the parsing of text files and hex then an automated Holiday calendar can be created. If you have a deep understanding of parsing and hex it should take you no more than 20min. If you don't then it can take days.

Link to comment
Share on other sites

I am not a C4 programmer but if C4 support text files, hex, and parsing this should be easy to do. I created a "Holiday" solution for Crestron using the following. Again C4 must be able to read and parse a text file.

1) I hard coded all the Holidays that are always on the same date since they never change. Example New Years, Christmas, Independence Day, etc.

2) For the Holidays that have variable dates, such as Thanksgiving, Easter, Labor Day, etc. I created program that parses the data in the .ics file and saves it to a text file so it's readable by the Crestron processor. Below is the actual text from a "Holiday" .ics file from iCal.

BEGIN:VCALENDAR

METHOD:PUBLISH

VERSION:2.0

X-WR-CALNAME:US Holidays

PRODID:-//Apple Inc.//iCal 4.0.2//EN

X-APPLE-CALENDAR-COLOR:#492BA1

X-WR-TIMEZONE:America/Los_Angeles

CALSCALE:GREGORIAN

BEGIN:VEVENT

CREATED:20090721T010305Z

UID:224FF2DF-00F8-4132-95FF-D780C0686A5F

DTEND;VALUE=DATE:20091225

RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=12

TRANSP:OPAQUE

SUMMARY:Christmas

DTSTART;VALUE=DATE:20091225

DTSTAMP:20090803T233541Z

SEQUENCE:5

END:VEVENT

BEGIN:VEVENT

CREATED:20090803T234608Z

UID:4162B846-C557-48FD-B635-E70EED88243B

DTEND;VALUE=DATE:20100705

TRANSP:TRANSPARENT

SUMMARY:Independence Day (observed)

DTSTART;VALUE=DATE:20100704

DTSTAMP:20090803T234625Z

SEQUENCE:3

END:VEVENT

BEGIN:VEVENT

CREATED:20090721T010305Z

UID:B082D697-41C2-4B14-B167-00B0497FF2D9

DTEND;VALUE=DATE:20090214

RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=2

TRANSP:OPAQUE

SUMMARY:Valentine's Day

DTSTART;VALUE=DATE:20090214

DTSTAMP:20090721T160548Z

SEQUENCE:1

END:VEVENT

BEGIN:VEVENT

CREATED:20090721T010305Z

UID:7B16E9B7-22B1-43C3-ABE2-88F29ED00000

DTEND;VALUE=DATE:20091126

RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=11;BYDAY=4TH

TRANSP:OPAQUE

SUMMARY:Thanksgiving

DTSTART;VALUE=DATE:20091126

DTSTAMP:20090803T233519Z

SEQUENCE:7

END:VEVENT

Basically I tell Crestron to do the following. (NOTE this is not Crestron programming. I am simplifying it so the basics are understood by all. If I explained it as a Crestron programmer 1, no one would understand it and 2, most importantly, no one would care)

Start at the First Instance of "BEGIN:VEvent"

Get first STRING after "DTEND;VALUE=DATE" and hold

Get the first STRING after SUMMARY: and hold

Get the first STRING after "DTSTART;VALUE=DATE:" and hold

At FIRST Instance if "END:VEVENT" parse and write data. At this point I tell Crestron to add dashes and commas.

Lets look at Thanksgiving. Parsing Thanksgiving I would end up with the following in a text file.

2009-11-26,Thanksgiving,2009-11-26

I now have a clean text file that I can parse even further if need be, have a Crestron Serial I/O read it, run it through other Serial logic, etc.

Using hex I can even break down, rearrange or extract from the line "2009-11-26,Thanksgiving,2009-11-26" in the text file using something like 012Ch - 23. What does this give me? The word "Thanksgiving". Breaking down 012Ch - 12 I am stating the following; Start at the First Instance(01) of a Comma(2C) using HEX(h) and take up to the 23rd character.

To write the whole program took me about 15-20min, and it takes the processor < a second to process the file and send the data to a text file that my Simpl program looks for. As far state holidays, personal vacations, non U.S. holidays, etc, I wrote the program so a client can enter dates and holidays manually from the touch panel.

Again if C4 supports the parsing of text files and hex then an automated Holiday calendar can be created. If you deep understanding of parsing and hex it should take you no more than 20min. If you don't then it can take days.

I like my method better :)

You don't have to be a programmer to do it, and you can easily set it for days that aren't Holidays, but that you may not want the lights to turn on. Oh yeah, and mine takes about 45 seconds if you're good, and about 10 minutes if you have to figure it out and have never done it before.

Thanks for the rundown though...

Link to comment
Share on other sites

I like my method better :)

You don't have to be a programmer to do it, and you can easily set it for days that aren't Holidays, but that you may not want the lights to turn on. Oh yeah, and mine takes about 45 seconds if you're good, and about 10 minutes if you have to figure it out and have never done it before.

Thanks for the rundown though...

I think your missing the point of automation. A person should not have to remember to "press a button" the system should do what the client wants it to do automatically.

My solution requires no end user intervention at all. Once it's incorporated into the program it is set and will update itself automatically. If I'm a client and I am spending upwards of $15K on a home automation system and I ask for a Holiday schedule I better get one. I would hate to have a dealer tell me "well if you want to go into Holiday mode, you will have to remember when the holidays are and make sure you press this button the night before every time." A client should never have to do that. The automation system needs takes care of it without any client intervention.

Link to comment
Share on other sites

I am a client, and I have invested more than $15k in home automation.

We all have our own wants and needs, I was just telling the guy how to easily create a wake up that he can turn on and off with ease.

I personally wouldn't want a certain thing to not take place every holiday, but that's just me I guess.

Oh well...rock on.

Link to comment
Share on other sites

I kind of have to agree with GoGo Delicious about having it automated, if you think about it they are able to get the constantly changing time of dusk from the internet, so shouldn't they be able to get the holiday list from the internet as well? I'm not a programmer, but I didn't think it would be that hard to get the information from the net and then just add a tab to the current scheduler.

Oh well, maybe it's harder that that...

Randy

Link to comment
Share on other sites

Astronomical time is *not* pulled from the internet.

Once you have latitude and longitude, it is calculated.

That said, someone could *certainly* write a DriverWorks driver that could set a variable if it was a holiday and clear it if it was not. It would just take a reliable source for the holiday data, and some programming.

I'm not volunteering.

:)

RyanE

Link to comment
Share on other sites

First, I agree that the system should know holidays.

That said, someone could *certainly* write a DriverWorks driver that could set a variable if it was a holiday and clear it if it was not. It would just take a reliable source for the holiday data, and some programming.

Second, this sounds like the kind of fun stuff I'd like to do when I "give up my day job" this December. However, I'm not a dealer, won't be living in a city large enough to support dealer sales requirements, wouldn't want a full-time job or even much of a part-time job anyway, so what are my options for that -- convince my dealer to "hire" me as a non-paid employee so I can have access to the tools I would need?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.