Garbage Collection Reminder


#104

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?


#105

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:


#106

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.


#107

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


#108

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…


#109

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


#110

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.


#111

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.


#112

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.


#113

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


#114

You set dayofA to 2 and dayofB to 4.


#115

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

or both?


#116

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


#117

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?