Please login or register.

Login with username, password and session length

Author Topic: How to use "Holiday" Conditional  (Read 12252 times)

Walt2

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 28
  • Posts: 787
How to use "Holiday" Conditional
« on: May 22, 2007, 05:31:44 PM »

I am pretty sure that this has been mentioned, briefly in passing, in other threads.  However, there never seems to be an answer.

Is there some way to use the list of Holidays set in Preferences, such that a conditional is True (or False) if today is any of the dates in the list (or not any of dates in the list)?

Basically, I would really like to get a macro which, more or less, IF holiday THEN don't wake me.

Seems to be a pretty straight forward use of the Holiday list.
Logged
* Sears Home Control System, Radio Shack Plug 'n Power, NuTone, Stanley LightMaker, BSR, HomeLink.
* Tecmar Device Master, CP290 (LightHouse), CM11A (AH), CM14A (AH2), CM15A (AHPro).

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: How to use "Holiday" Conditional
« Reply #1 on: May 22, 2007, 06:03:22 PM »

Just went to try that... Argh... There really isn't a way to do an "OR" holiday test to include them all.
It would be a pain but I suppose you could build a holiday macro that executed at say 12:01 am everyday. It would have to have an else for every holiday you wanted to include. That macro could then set a flag if it was a holiday that you could test for in a wake up macro.
You have to keep in mind that AHP defines its day as the 24 hour period from midnight to 12:59:59 pm when incorporating religious holidays beginning at sunset. You also need to make sure your holiday list is up to date. e.g. Many holidays such as Easter, Mother's Day and many Jewish holidays vary their dates from year to year.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Walt2

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 28
  • Posts: 787
Re: How to use "Holiday" Conditional
« Reply #2 on: May 23, 2007, 08:32:55 AM »

Yea, I think that is what I kind-of need to do.

I set up a simple macro that sets a flag.  Then, I set up timers that run this macro at 2am (I guess I could have gone 12:01am instead).  I have another macro that resets that same flag, and that runs at 11:30pm (again, I guess I could have done 11:59pm instead).

The problem is that there has to be one timer for each holiday.  Add a holiday to AHP's table, or remove a holiday, and it does not appear that AHP will automatically add/delete a timer.   ???

Also, I have a feeling that if a user updates the holiday table each year, with the correct dates for some of the "moving" holidays, that all those timers will not automatically adjust.  For example, the timer tagged as being "memorial day" should change to the new date for memorial day, but I bet doesn't.

This all kind-of defeats, IMHO, the whole reason for a holiday table in AHP, no?

Years ago, I pushed X10 to go from 7-day timers to 8-day timers (8 is a nice binary value too), where the 8-th day is any predetermined holiday.    Basically, when setting up a timer, there would be the Sunday to Saturday check boxes, plus an 8th check box called "holiday".  Seemed simple enough, but what was implemented in AHP doesn't seem to quite get there.  :(

« Last Edit: May 23, 2007, 08:40:11 AM by Walt2 »
Logged
* Sears Home Control System, Radio Shack Plug 'n Power, NuTone, Stanley LightMaker, BSR, HomeLink.
* Tecmar Device Master, CP290 (LightHouse), CM11A (AH), CM14A (AH2), CM15A (AHPro).

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: How to use "Holiday" Conditional
« Reply #3 on: May 23, 2007, 10:48:19 AM »

...I have another macro that resets that same flag...
...I set up timers that run this macro at 2am (I guess I could have gone 12:01am instead)...
Forgot about needing one that reset the flag. It could be incorporated into the set macro but would be easier as separate macro.
I'd change the 2am time. I'm cautious about macros that execute between 1 and 3 am for fear that they might get missed or duplicated during a time change.

...The problem is that there has to be one timer for each holiday....
...I have a feeling that if a user updates the holiday table each year...
As I see it, you'll need just one timer on one macro that has an else for each holiday. Possibly more if there is a maximum else limit. That macro would set the holiday flag.
It probably would be a good idea to download to the CM15A after updating the holiday list. After that, I don't think there would be a problem.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Walt2

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 28
  • Posts: 787
Re: How to use "Holiday" Conditional
« Reply #4 on: May 23, 2007, 11:19:51 AM »

I'd change the 2am time. I'm cautious about macros that execute between 1 and 3 am for fear that they might get missed or duplicated during a time change.

Good point.  I forgot about DST changing, at least officially, at 2am.  Then this opens up the question does the CM15a change its internal time at 2am, or a midnight?

Anyway, I will change the time to 3:30am, since even on days DST goes back one hour, 3:30am happens only once.

As I see it, you'll need just one timer on one macro that has an else for each holiday. Possibly more if there is a maximum else limit. That macro would set the holiday flag.

Instead of a string of else-s for each holiday, one timer will handle all the holidays.  I mean, when setting up a single timer, you can keep clicking on "NEW", and add a trigger event for each holiday date (one trigger event per one holiday).  I just have that one timer trigger the "set" macro.   Plus, of course, a similar timer triggering the "reset" macro.

I don't know if this actually produces cleaner code, but at least AHP shows it as a single timer with multiple trigger events.
Logged
* Sears Home Control System, Radio Shack Plug 'n Power, NuTone, Stanley LightMaker, BSR, HomeLink.
* Tecmar Device Master, CP290 (LightHouse), CM11A (AH), CM14A (AH2), CM15A (AHPro).

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: How to use "Holiday" Conditional
« Reply #5 on: May 23, 2007, 03:48:01 PM »

...Instead of a string of else-s for each holiday, one timer will handle all the holidays....
Ok. I understand your approach.

This could be a "7 of one and half a dozen of another" situation. Where one approach is only slightly better than the other. Your multiple timer approach is clearly easier to follow. What's going to push the decision is if either approach has problems with the floating holidays. One case may execute faster than the other not that it should matter for this application. My guess is that in both cases actual dates are downloaded to the CM15A and that changes to the holiday list need to be followed with a download to the CM15A.

I guess the "reset" macro is the easiest one of all since no conditions are needed for it at all.

I also have no idea which approach uses the most memory in the CM15A, if that matters.

Hmm... I wonder if you could create a virtual day window ending at say sunset or beginning at sunrise by adjusting the time you ran your Holiday set and clear macros.

Please keep us informed as to how it works.

« Last Edit: May 23, 2007, 03:58:20 PM by steven r »
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: How to use "Holiday" Conditional
« Reply #6 on: May 27, 2007, 11:04:53 AM »

I tried this experiment with the holidays.

  • Set June 1st for the holiday Father's Day.
  • Programed a timer using Father's Day.
  • This created a timed event for June 1 as expected.
  • I then corrected the date of Father's Day to the 17th.
  • As I feared, it did not changed the date for the timed event.
  • I had to edit the timer to change the holiday date.

This means that for the timer approach anyway, you will need to tweak any floating holidays. I haven't tried the else approach but I expect it will also need tweaking for the floating holidays. There is a chance that you may only need to re-save them but I fear that could be more trouble than the tweaking the timers approach.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: How to use "Holiday" Conditional
« Reply #7 on: May 27, 2007, 11:53:13 AM »

Ok. I tried the else approach. Argh... Stick with your timers. The else approach has at least as much tweaking involved and as you pointed out the timer approach is clearly easier to program.

Two things I discovered in this exercise:

  • Floating holidays require tweaking if you use them. I recommend making a note of any macros or modules using them. Maybe even a dedicated folder.
  • Modifying the Holiday list does not prompt you to save the file. While the holiday list is not saved in the CM15A, it does need to be saved in your ahx file.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Walt2

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 28
  • Posts: 787
Re: How to use "Holiday" Conditional
« Reply #8 on: May 28, 2007, 11:49:57 AM »

  • Modifying the Holiday list does not prompt you to save the file. While the holiday list is not saved in the CM15A, it does need to be saved in your ahx file.

I think that hits upon the real issue here.  The holiday list is not saved in the CM15A.   Therefore, the holiday list isn't very useful feature, except for possibly just being a nice short hand when creating timer event or using a macro holiday conditional.

The right way to have implemented this, is to have the holiday list downloaded to the CM15A, and whenever a timer event or macro conditional referenced a "holiday", the CM15A would check the current date against the list of dates in the holiday list.    Yea, it would still require a download once a year, to update the holiday list.  However, it would not require one to remember which timer events, and which macro conditionals, needed to be manually updated each year.  That, as with any manual process which relies on a person's memory year after year, is very prone to mistakes.
Logged
* Sears Home Control System, Radio Shack Plug 'n Power, NuTone, Stanley LightMaker, BSR, HomeLink.
* Tecmar Device Master, CP290 (LightHouse), CM11A (AH), CM14A (AH2), CM15A (AHPro).

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: How to use "Holiday" Conditional
« Reply #9 on: May 28, 2007, 09:26:33 PM »

...However, it would not require one to remember which timer events, and which macro conditionals, needed to be manually updated each year.  That, as with any manual process which relies on a person's memory year after year, is very prone to mistakes.
I suppose you could declare the holiday "Tweak Day" to be say Dec 31 and have a macro email you a reminder to tweak all the floating holidays for the next year.  ;)
BTW: In spite of the fact this forum so far just been a dialog between the two of us, It has had 156 views so far.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Walt2

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 28
  • Posts: 787
Re: How to use "Holiday" Conditional
« Reply #10 on: May 29, 2007, 08:02:49 AM »

I suppose you could declare the holiday "Tweak Day" to be say Dec 31 and have a macro email you a reminder to tweak all the floating holidays for the next year.  ;)

Unfortunately, by next Dec 31, I would not remember which timer events and which macro conditionals made use of Holidays, and needed to be tweaked.   I would, therefore, need to exhaustively go thru each and every one, looking for the use of a Holiday.  Miss just one, and I could end up spending months trying to figure out what went wrong.
Logged
* Sears Home Control System, Radio Shack Plug 'n Power, NuTone, Stanley LightMaker, BSR, HomeLink.
* Tecmar Device Master, CP290 (LightHouse), CM11A (AH), CM14A (AH2), CM15A (AHPro).

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: How to use "Holiday" Conditional
« Reply #11 on: May 29, 2007, 10:33:53 AM »

Unfortunately, by next Dec 31, I would not remember which timer events and which macro conditionals made use of Holidays...
Yeah I would need to save a tweak me text file to remind me of all the macros and modules using floating holidays.
It's all less than an ideal approach but if you want to use floating holidays as conditionals, what choices do you have?
« Last Edit: May 29, 2007, 10:36:10 AM by steven r »
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

tom j

  • Hero Member
  • *****
  • Helpful Post Rating: 16
  • Posts: 1270
Re: How to use "Holiday" Conditional
« Reply #12 on: July 06, 2007, 11:43:10 PM »

Yea, I think that is what I kind-of need to do.

I set up a simple macro that sets a flag.  Then, I set up timers that run this macro at 2am (I guess I could have gone 12:01am instead).  I have another macro that resets that same flag, and that runs at 11:30pm (again, I guess I could have done 11:59pm instead).

The problem is that there has to be one timer for each holiday.  Add a holiday to AHP's table, or remove a holiday, and it does not appear that AHP will automatically add/delete a timer.   ???

Also, I have a feeling that if a user updates the holiday table each year, with the correct dates for some of the "moving" holidays, that all those timers will not automatically adjust.  For example, the timer tagged as being "memorial day" should change to the new date for memorial day, but I bet doesn't.

This all kind-of defeats, IMHO, the whole reason for a holiday table in AHP, no?

Years ago, I pushed X10 to go from 7-day timers to 8-day timers (8 is a nice binary value too), where the 8-th day is any predetermined holiday.    Basically, when setting up a timer, there would be the Sunday to Saturday check boxes, plus an 8th check box called "holiday".  Seemed simple enough, but what was implemented in AHP doesn't seem to quite get there.  :(



Say Walt2 really excellent idea!! not surprised that x10 didn't implement it they still haven't incorporated some of the features that were standard on the OLD ACTIVEHOME! like something as simple as being able to combine dust/dawn and security, used to do this all the time in the old Activehome I heard that people complained so much that the programmers decided not to put it back in also someone told me that the software had so many patches (resembling a calico cat) that it was difficult to now make the change. This thing could really be almost indispensable for the average home owner that's just a little computer literate but these folks apparently don't realise what they really have if this thing had some decent range and some much need software upgrades they could sell 10 times what they are selling now who EVER was responsible for this range issue should be fired immediately and I mean immediately the person responsible for the interface should get a raise, why can't this company ever get anything right they do occasioanlly but it's a hit and miss process at best, once again great idea talking to another company about constructing another unit with these much need changes I'm tired of waiting on x10 stay tuned!!

Tom j
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.