Tracking Holidays


#1

I’d like to create a piston where I can set the holidays I’m interested in watching and then verifying when they occur (possibly with a web service…?). Has anyone done something like this and would you mind sharing?

There are some pistons I would prefer not run during holidays.

Thanks in advance…


#2

I think @eibyer posted something for that.


#3

Not I, @bangali did – but I think it was for lighting?


#4

My bad… it was @bangali


#5

It’s a good starting template for tracking all the holidays though.


#6

:+1:


#7

Just did some digging around… found this webservice for holidays in various countries

http://kayaposoft.com/enrico/json/

Now I have something to play around with for similar needs

JSON call:
https://kayaposoft.com/enrico/json/v2.0/?action=getHolidaysForYear&year=2018&country=us&region=pa&holidayType=all

output
[{"date":{"day":1,"month":1,"year":2018,"dayOfWeek":1},"name":[{"lang":"en","text":"New Year's Day"}],"holidayType":"public_holiday"},{"date":{"day":15,"month":1,"year":2018,"dayOfWeek":1},"name":[{"lang":"en","text":"Dr. Martin Luther King, Jr. Day"}],"holidayType":"public_holiday"},{"date":{"day":19,"month":2,"year":2018,"dayOfWeek":1},"name":[{"lang":"en","text":"Presidents' Day"}],"holidayType":"public_holiday"},{"date":{"day":28,"month":5,"year":2018,"dayOfWeek":1},"name":[{"lang":"en","text":"Memorial Day"}],"holidayType":"public_holiday"},{"date":{"day":4,"month":7,"year":2018,"dayOfWeek":3},"name":[{"lang":"en","text":"Independence Day"}],"holidayType":"public_holiday"},{"date":{"day":3,"month":9,"year":2018,"dayOfWeek":1},"name":[{"lang":"en","text":"Labor Day"}],"holidayType":"public_holiday"},{"date":{"day":8,"month":10,"year":2018,"dayOfWeek":1},"name":[{"lang":"en","text":"Columbus Day"}],"holidayType":"public_holiday"},{"date":{"day":11,"month":11,"year":2018,"dayOfWeek":7},"observedOn":{"day":12,"month":11,"year":2018,"dayOfWeek":1},"name":[{"lang":"en","text":"Veterans Day"}],"holidayType":"public_holiday"},{"date":{"day":22,"month":11,"year":2018,"dayOfWeek":4},"name":[{"lang":"en","text":"Thanksgiving Day"}],"holidayType":"public_holiday"},{"date":{"day":23,"month":11,"year":2018,"dayOfWeek":5},"name":[{"lang":"en","text":"The Day after Thanksgiving"}],"holidayType":"public_holiday"},{"date":{"day":25,"month":12,"year":2018,"dayOfWeek":2},"name":[{"lang":"en","text":"Christmas Day"}],"holidayType":"public_holiday"}]

Looks pretty comprehensive although not sure if it will grab all the non ‘holiday’ holidays (halloween for example


#8

Thanks to everyone that responded, this gives me a good starting place!


#9

Would you mind sharing your piston once you have worked out how to use the holiday info?

I make use of a piston as my daily (weekday morning) alarm, turning stuff on as wake-up time approaches until it finally turns on the TV and lights in my bedroom. Would be nice if I could add a restriction which will prevent it from running on public holidays.


#17

Wanted to see if you had made any progress on your piston, @salieri…? Looking to do something like this as well. Thanks in advance!