Jump to content

Day After Holiday in Notification Program


bernieb

Recommended Posts

Wonder if someone can help me brainstorm this one, keep in mind that I am still in my learning curve period here.

 

Last night, I setup a Pushover notification to remind me on Thursday morning to take the garbage out. But got thinking that what if Thursday is a holiday (like Thanksgiving or any other holiday that may fall on Thursday).  At this time, I wouldn't want to receive the notification Thursday, but Friday instead.

 

From what I am seeing, from different examples on the board, the ELSE statement is rarely used, not exactly sure why and if there is a reason.

 

My first thought would be to set up a program as such:

 

If

   Not a holiday

   and Thursday at 7:00 AM

Then

   Send Pushover notification - "Take Garbage Out"

Else

   Wait 24 hrs

   Send Pushover notification - "Take Garbage Out"

 

Then got thinking that I am not sure that I want a wait time that long, what if the ISY gets rebooted in the meantime.

 

So my second thought would be to create a variable called "Day.After.Holiday"  (init-0 but could be passed a value from 1 to 7 depending on the day Ex. Friday would be 5)

 

My first thought would be to set a program that would look something like this:

 

If

   Not a holiday

   and Thursday at 7:00 AM

   or

   If time is 7:00 AM on Friday

   and Day.After.Holiday =5

Then

   Send Pushover notification - "Take Garbage Out"

Else

   Set Day.Ater.Holiday = 5

 

First of all, would this work?

Then this is where I get a brain cramp.

I need to reset the variable, but not sure I want to do it there since it may be helpful for other programs not to run on a holiday, but the day after. So It should not be reset until 12:01AM the next day.

With this being said,  would I be better off not to set the Day.After.Holiday in this program, but create a program, (after clearing the variable, and after the one that sets my variable of Is.Holiday=1) that would run and add the appropriate value (in this case 5) to the Day.After.Holiday variable?

 

What would be your best practice? 

Hope this wasn't too confusing.

Link to comment

There is no reason that I can think of to avoid using the else path of a program. So long that one understands program triggers and evaluation logic, they are a powerful tool that would be silly to ignore. I suspect most of the reason you see empty else statements is based on need rather than some inherent flaw.

 

Coneceptually, I see nothing wrong with your "not a holiday" program. Yes power failure could be a practical concern. Another might be how you intend for the ISY to know whether it is, or is not, a holiday. That is more complicated than it sounds.

 

If you desire to be somewhat tolerant of power failures, I would simply break this into two programs

 

If not a holiday

And thursday

Then

Send notification

Else nothing

 

If a holiday

And friday

Then send notification

Else nothing

 

But, your bigger problem, I suspect, is programming the ISY to know what days or weeks are holidays.

Link to comment

Thanks oberkc,

 

Seems like I am on the right path.

As far as how to determine if the day is a holiday, although I haven't implemented it yet, I am looking at the following 2 solutions:

 

http://wiki.universal-devices.com/index.php?title=ISY-99i_Generic_Calendar_Using_Programs_and_Variables

or

http://forum.universal-devices.com/topic/14096-one-more-date-variable-program/?hl=calendar&do=findComment&comment=117531

Link to comment

Good. I am glad you found that wiki article.

 

This is one of those cases where I have decided that the the payoff is too low for the amount of work required. My approach would simply be

 

If

Thursday

Send notification

 

In the notification, I would simply include a reminder to self to wait an extra day if there was a holiday this week.

Link to comment

I hear ya,

 

But in my opinion, a smart home should be just that.  I've been putting around with home automation for a bunch of years and I've alway found that this feature ( Is a Holiday) and others like personal reminers of important dates (birthdays, anniversary, etc) is missing from every solution.

 

I would agree with you that the pay off is small if I just wanted to get a reminder for garbage day, but in the grand scheme of things, I also want to incorporate the detection of a holiday with other events at the house.  Like not sounding the alarm clock that morning, opening up the shades an hour later.

 

I could even use a "Day.Before.Holiday" variable (if I could figure out how to do this) because I am more likely to stay up the night before a holiday to watch TV or a movie although I know that a simple "Good Night" program could take care of this.

Link to comment

If I had to identify the one shortcoming with ISY organic programming capabilities, it would probably be in this area. I have always wanted the ability to be more generic in specifying times and dates, such as

 

If april first of any year

 

If holiday,

 

If on vacation

 

Integration with a shared calendar such as outlook or google or ical or whatever would be wonderful. I understand this is "on the list" of improvements, by not as high a priority as I would prefer.

 

Someday, I may take the time to do what you are about to do, but not now. I agree that this has broader implications than a simple trash notification.

 

Perhaps, too, that a smart home is not a single device that does everything, but a well-integrated ecosystme where your phone, apps, computer, calendars, hvac, all can talk to each other and trigger events.

Link to comment

Perhaps, too, that a smart home is not a single device that does everything, but a well-integrated ecosystme where your phone, apps, computer, calendars, hvac, all can talk to each other and trigger events.

 

We've pretty much have four of those now. Missing is a calendar that can accommodate a fixed day that wanders, for example, New Years Day and Independence Day in which the day number is fixed, but the day of the week isn't or President's Day and Thanksgiving Day where the day of the week is constant, but not the date.

Link to comment

We've pretty much have four of those now.

I should have been more clear. When I suggested apps and computers talking to insteon, I was thinking broader than a dedicated app or software. I was thinking more universal integration, where all apps can trigger insteon events, not just one or two apps, or vice versa. For example, my mail and calendar apps could trigger an insteon scene. Or the ISY could send a text message from hangouts. Or the ISY could trigger the remote control app to turn on the tv or music.

 

With regards to the original request, it seems an ultimate goal would be for the ISY to integrate with whatever calendar application one uses, allowing one to define a given day as a work, holiday, vacation, weekend, party, and have the ISY react in a coordinated fashion without having to recreate the calendar in the ISY.

 

But, for now, I think annual and monthly days in theISY would be a great start.

Link to comment

Archived

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


×
×
  • Create New...