bernieb Posted December 4, 2014 Posted December 4, 2014 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.
oberkc Posted December 4, 2014 Posted December 4, 2014 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.
bernieb Posted December 4, 2014 Author Posted December 4, 2014 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
oberkc Posted December 4, 2014 Posted December 4, 2014 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.
bernieb Posted December 4, 2014 Author Posted December 4, 2014 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.
oberkc Posted December 4, 2014 Posted December 4, 2014 (edited) 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. Edited December 4, 2014 by oberkc
stusviews Posted December 5, 2014 Posted December 5, 2014 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.
Michel Kohanim Posted December 5, 2014 Posted December 5, 2014 Agreed and definitely part of 5.x. With kind regards, Michel
oberkc Posted December 5, 2014 Posted December 5, 2014 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.
Recommended Posts