Garbage Collection Reminder


#63

Apparently the end point returns “Christmas” rather than “Christmas Day” – you need to change that in the initial definition of holidays (observedHolidays).

Also, it runs nightly in order to send the notification (if necessary) – seeing it being scheduled doesn’t mean that it is actually going to send a notification.


#64

Thanks, easy quick fix. Appreciate you taking the time to clear that up for me.


#65

Is this piston still working for anyone. It stop working for me, and I do not know what has changed.


#66

Still working for me. You might try to “Test” the piston to make sure it gets properly scheduled.


#67

The API call is timing out for me at:

http://holidayapi.riccardoravaro.com/api/v1/holidays?country=US&year=2018&month=3&day=20


#69

OK - seems like that API is no longer available. I found another one and reworked the piston to use that one as well (the piston actually got a little simpler since it can query for multiple days in a single request).


For some reason the editor likes to replace &r with ® – the URL expressions is

format('https://kayaposoft.com/enrico/json/v2.0/?action=getHolidaysForDateRange&fromDate=%s&toDate=%s&country=%s&region=%s&holidayType=public_holiday',formatDateTime($now, "d-M-y"), formatDateTime(addDays($now, pickupDay), "d-M-y"), countryCode, regionCode)

Please note that you need to adjust the countryCode and regionCode variables to match your need (the API website at the beginning of the post lists the available values for them).


Garbage collection/boolean function piston help
#70

Seems this feature is broken with your piston now.


#71

Nothing to do with the piston — webCoRE changed the way this is handled and now shows a dialog when editing variable values:


#72

So change it to true ?
https://drive.google.com/file/d/1WtnvskXIfcYAszbRES4lPZztn5dQO5iX/view?usp=drivesdk


#73

True or false, depending what week you’re currently in. It will alternate after that.


#74

We have recycling every week


#75

Then just initialize it to true in the code itself. That way it will always be true.


#76

I did and I reported that it didn’t work last week. I’ll wait again for this week and see if it triggers correctly.


#77

At the end of the line 45 it has ‘with type JSON’ but when I put this code in I don’t have that and can not find a way to add it.

Also I am in Aus so can not use SMS and also using Hubitat so can not use push notification. I usually go with IFTTT push notification but how do I set it up for this instance?

EDIT: Never mind, worked it out with some other code to do Pushover.net with out IFTTT. Thank for the piston!


#78

My screenshot is from an older version of webCoRE – if I would create a new screenshot now it would no longer show the with JSON either.

See the following announcement for more details on the change:


#79

Fair enough, thanks for that!


#80

Apparently this isn’t working anymore. Not sure if the GET format is asking in JSON format.

We had a holiday this week and all pickup is for Saturday but the piston returned Friday.


#81

It works just fine for me:
07

It lists Friday but my normal pickup day is Thursday:

(also note that isHoliday is correctly set to true).

Please make sure that you have the holidays listed, correctly spelled, and that both countryCode and regionCode are set correctly.


#82

isHoliday is set false in the boolean

country us
region wa

strange


#83

Hmm - the request does return the correct result:
https://kayaposoft.com/enrico/json/v2.0/?action=getHolidaysForDateRange&fromDate=2-9-2018&toDate=6-9-2018&country=us&region=wa&holidayType=public_holiday