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


#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.


#23

Brilliant discussion in this thread… So many great ideas and implementations!

You all have inspired me to find some way to distinguish the varying Solstices and Equinoxes based on dayOfYear. I have a hunch that the math would be even more complex than @Gopack2’s Easter math above. (if that’s possible, LOL)

I may end up ‘cheating’ by simply writing the next ten years into my code.