Can we do a “holiday variable” piston project as a team?


#3

I like it! Already have built the Presidents and Thanksgiving modes based on it.

Created a ‘holiday_var’ variable, setting it to ‘H’ at zero hours on the Wednesday before Thanksgiving and the Sunday before Presidents’ Day.

Will have the piston that provides the audio notifications clear the variable after the notifications are broadcast.

Edit: all are built except Memorial Day, getting there now


#4

Done. Handles the above-listed holidays, plus Xmas NewYears and July4


#5

So this tells you if tomorrow is a holiday? What clears the ‘H’? Why not make @holidaytomorrow a boolean? Just curious, what are you using this for?

Seems like this could also be done with the GCal Search smart app by subscribing to the Holiday calendar and writing your pistons around that, but I honestly don’t know much about it. Using a calendar subscription would also work for those in other countries and different holidays.


#6

For those that may want it… an Easter date calculator

It’s chunky, just as an FYI


#7

Yes, you could. It is in fact what I did in my previous configuration. And yes, Boolean would work just as well.

The objective here is to not have to rely on external links. If there is a rule that I can use to calculate something (and thanks to Bobbles, this was even simpler than I imagined), why leave it to others? It’s a simple matter to build the rule for myself; this makes it easier to utilize it for my own purposes.

The ‘H’ gets cleared by the piston that utilizes it for the final time for any holiday instance. In my case, I will have a piston that fires the evening before the holiday, telling me “holiday is tomorrow, don’t put out your trash”. Then the next morning, telling me “holiday is today, don’t put out your trash”… and after that announcement, it clears the ‘H’ out of the variable. And the ‘H’ then does not reappear in the variable until the day before the next holiday.

@gopack: thank God I don’t have to try to relate kooky religious parameters into my garbage pickup routine lol


#8

I can’t figure out why I’m getting bad dates for Thanksgiving, but this gives you the basic outline of what you’re trying to do. Just click Test and the variables at the top will populate with the dates. For next year, just change the start and end dates to 2019.


#9

heres another one for easter sunday calculation. doesnt do the job any better … might just be an easier read.

this is a formula by mathematician gauss … nobody please think i am suggesting i came up with the formula.


#10

I’m with @Equis on this one using**GCal Search SmartApp by @infofiend *. Let the :man_student::woman_student: programming wizards at the ‘Google Calendar Division’ do the heavy lifting when it comes to the thousands of events surrounding special days. The possibilities are endless, for example, I also have separate monitored Google calendars for vacation, doctor appointments, family events, when I want a WebCore piston to be aware and take action.

In addition to US and Global Religious Holidays, the folks at Google have several other special date category calendars aside from Holidays, like Sports, Phases of the Moon, etc, each that GCal Search creates either a virtual presense or contact in the ST things.


#11

I use those Gcals too.

Tell me how you would use it to give you a specific actionable variable the day before each major holiday.


#12

@Glen_King: The GCal device for each Google calendar has the following robust set of device state attributes which are accessible from WebCore:

Here is an expression that generates the date before Thanksgiving.


#13

But what do you want to use all this information on when a holiday is upcoming for? That’s the leap I’m not making here. What difference does it make to you motion controlled lights in your hallway whether it’s arbor day or not? What are you going to do differently on Holidays than on any other day of the year?


#14

It was explained in the original post in this thread. But here it is again:

(The folks in the thread on garbage collection alerts, for example, would greatly benefit both from knowing whether today a holiday, but also from knowing the day before in case they need to put their garbage out that night for early morning pickup.)

That’s just one example. More specifically, the garbage does not get picked up on holidays. So while I have spoken notifications (now on android tablet, but moving to Echo) to tell me what goes out on which night before and morning, with the holidays it reminds me to NOT put my garbage out on the curb.


#15

But that’s only for certain holidays. And also, with me, if the holiday is any day within the week, it moves my garbage day out by one. Why not just put a recurring event on your google calendar and then modify individual occurrences as needed. I don’t understand how you’re going to accomplish this with webCoRE logic.


#16

Your inability to understand the use case does not make the use case invalid.

Why “modify individual instances as needed” when a) it follows a very specific rule, b) we can use the existing rules engine to handle that rule, and c) we can use that engine/rule to enable predictive functionality?

As to your question of ‘how’, look at post four in this thread. Fixed holidays like Xmas and July4 are easy; indeed the piston sets the variable based on the preceding date. But the others are movable; they do not land on a date. They land on the “third Monday in February”.

I want my garbage reminder broadcasts to tell me, the night before the holiday, “no garbage pickup tomorrow” so I (being largely unconscious of holidays) do not drag that stuff out to the curb that night only to have to drag it back to the house the next day.

The holiday piston, by setting the variable, allows my announcement piston to do exactly that.


#17

I didn’t say it wasn’t valid…I simply do not understand why you are making it more complicated than necessary that’s all. I’m simply asking a question. I’m sorry that you don’t feel confident enough in yourself to be able to respond to questions in an adult manner but that is what a PUBLIC forum is for.


#18

How is this ‘complicating’ it?
By that criterion, we are all unnecessarily complicating our lives with Smartthings to begin with… after all, we can just get up and flip the switch, rather than making all these rules where a light gets turned on/off by “unnecessary complication”.

I’m actually simplifying it. By writing the rule such that it knows - and can act on - each and every day that precedes a movable holiday in the future, I never have to go and “modify individual occurrences as needed”. Dunno about your understanding, but to my mind that is one of the goals/hallmarks of intelligent automation. And if you look at the piston I wrote (and credit to bobbles, whose own piston example was the springboard), it’s incredibly simple. Took literally a half-hour, while I was working on other things. So one minute to grasp what he did, about five minutes applying it to my use case.


#19

Kurt, do you have to change that expression each year? I’m guessing that it would be easy enough to allow the year to be variable… it would be great to have a variety of pistons that can accomplish this task. Perhaps the one you are currently creating would work better - looking forward to seeing how it works for a slew of standard holidays…


#20

The one I posted above that creates dates for holidays could easily be modified to notify the day before, if you’re interested in it. Fixed ones could easily be added to repeat every year, too.

I have a different piston with a fixed list of dates that use list variables to assign names (so messages automatically insert April Fools Day, Happy Thanksgiving, etc.).


#21

@Glen_King : This example piston (WebCore Backup Code 025Y) is date dynamic and would always fire off the day before any event in each year that is designated as a Holiday on the Google Holiday calendar. If you have another Google calendar, like the OSU Buckeyes Football, it could remind one of the game a day before that event. The example piston can monitor any Google calendar from the GCAL Search smartApp.

One can set it once for a specified Google event calendar, and WebCore would always execute the “If True” logic the day before a Holiday. One could set a global boolean variable to be True in the “If True” section when it runs and all other pistons executing daily could take action on the day before a Holiday. The global variable would be set to ‘false’ in the else section of the logic.


#22

Some changes from the above. As I was building it I chose a string variable rather than Boolean. Perhaps I knew intrinsically that things would change… here’s the piston to set holiday variables. It now sets the following: X= Xmas and new years, 4= July4, M= the movable Monday holidays, T= thanksgiving. (edit: Aug31 should set M, not H)

And here’s the piston that makes the announcements on Echo at the desired times:

For the piston setting the variables, I might have it fire right after the old variable is set to H (essentially, clearing). That would allow me to ask “Alexa, what’s the next garbage day?” at any time, and it would respond accurately. That’s a more involved thing though. I did it with tasker, but it was not easy.