Garbage Collection Reminder


And this is exactly why I wrote my piston to calculate its own holidays, rather than rely on an external holiday notification. In my area, the garbage holidays are NYD, PresidentsDay, Memorial, July4, Labor, Columbus, Xmas. Three are hard dates so that’s easy. The other four are all expressed as the “X-th Monday of (month)”, which is a rule that can easily be written. Why rely on externals when you don’t have to?


The advantage of the externals is that you can ask for a range (e.g., you need to know whether there is a holiday in the next week before or at the day in question) – rather than having to loop over each day a single result makes this a lot easier.

On another note – I have seen the holiday piston and it does look a little “brute force” to me. Using formatDate() you could make it a lot more compact:


Ok, need a little help here. So I’m looking at my dashboard right now and I see this, which is what I would expect. Capture
However last night and this morning I got these notifications

Here is a green snapshot of the piston.

Any help would be greatly appreciated. I can’t remember exactly who I stole this from, but it was in this thread.


Try this update. I changed how I deal with isHoliday.


When I import it it is asking for a url that is missing? Any idea what that might be? The only webpage I see is down on line 45, but that imported correctly…


You can skip the url line. it will be generated when the piston runs.


Awesome, thanks. I see you define two days of the week, do you have collection 2x a week? I just have collection once a week with recycling every other week.

I will set this up to alert me tomorrow, so thanks again.


Yes I have trash collection twice a week, and recycling once a week on same day as my trash pickup. There are other examples to show how to deal with recycling every other week.


I barely have enough trash for once every week, not sure what i would do if it was collected 2x a week. Appreciate the piston, just going through it to try and figure out how to drop the 2nd collection without messing anything else up.


How do you edit this so that it reminds me of my actual trash days? Which happen to be Tuesday and Thursday btw.


You set dayofA to 2 and dayofB to 4.


On all the lines where it says: dayofweek = x
dayofweek is x

or both?


Line 29 const integer dayofA = 2
line 31 const integer dayofB=4


So with your piston you should get a push notification as well as an announcement on whatever speakers you select? I set the reminder for today to test it out and I got nothing. The only things I changed was region code to al for Alabama, dayofA and dayofB, the time and the speakers used for the announcement.

I changed the time just now and tried it again and see nothing in my SmartThings activity feed. Any ideas what I might have changed that messed things up?