And your holidays are not the same, either.
Maybe this might work:
Garbage Collection Reminder
Would there be a way to test this piston any other way than waiting for the days to come and see if it calls it correct? Thank you for your help by the way. Very advanced stuff.
What I would really want is on this Thursday at 6pm to announce its trash day tomorrow then next Thursday would be recycle bin day and to continue that pattern. Not too concerned about holidays if I can easily restart the piston to the correct timings if anything changes in future.
I hope you understand what I mean. How easy this would have been if they just collected both bloody bins on the same day!
Anyone know what these errors in the logs mean?
I simply imported xjc6 and changed the day of week to 0 and 3.
Error executing virtual command [].setVariable: (2ms) groovy.lang.MissingPropertyException: No such property: result for class:
An error occurred while executing the event: java.lang.NullPointerException: Cannot get property ‘v’ on null object
There is an error in this piston. I had the same errors until I added under “define” a dynamic variable TheDayType at line 22. Then on line 51 - change variable to TheDayType and on line 53 - Change {@HolidaysObserved} to your newly created dynamic variable TheDayType.
@Sh8dyDan Ran the piston last night and also ran into this error in the logs, even though it seems to have worked. Would this cause an issue down the road or is this common?
EDIT; this seemed to have been a glitch the first time it ran. Worked great this morning!
Now looking to see if I can figure out how to make this run the night before since thats when we take out the trash.
Maybe my pistons might help. Take a look.
I created two pistons (Modified Existing), for simplicity, to notify me of garbage collections.
I have 2 pickup day per week. 1st pickup - Garbage / Yard Waste. 2nd - Garbage / Recycle.
Garbage Day Today - Runs at 6am every day (Essentially reminds me garbage collection is today)
Garbage Day Tomorrow - Runs every day at 6pm (Essentially reminds me garbage collection is tomorrow)
It did help! I only need reminders the night before since they come by very early in the morning so day of reminders would be too late already. Took your piston, added my 3rd pickup and retooled the formulas to look 1x day forward. Ran and worked great last night, just need to verify that it can look forward 1x day to a holiday based off your URL.
I’m a noob here. Can someone help me refactor this such that it follows my trash pickup? I have pickup of trash one week, and the following week it’s trash + recycling, the following week its trash only.
Thanks a ton.
Might be easier to break it up into 2x pistons, 1x for weekly, the other for bi-weekly. What are the day’s of the week that these pickups happen?
Actually, probably easiest to just add a Boolean variable and toggle it each week when the notification is sent. So week 1 it is false and only the trash reminder is sent and the variable is changed to true. The next week it is true so both notifications are sent and then it is changed back to false. Etc.
Try this. Rushed through it but looks like it would work for you. Few things to do on your end;
- Import the piston using the backup code.
- In the variables in the top of the piston update your region code to whatever state you are in. Mine is fl.
- Set the last boolean variable in the top list whether this is trash only week or trash and recycle week. The catch is that you would have to set this before Wednesday. If you are setting this up past Wednesday and trash only has already happened you want to set the boolean value to false so its ready for next week’s trash and recycle.
- In the bottom it will send push notifications and/or speak all based on location modes. Adjust these as needed bu you will have to do it in both sections for trash only and trash plus recycle weeks. You might not want location mode restrictions or have speaking devices. If so you can remove those individual sections. But leave anything else so that it doesn’t loose functionality.
EDIT: corrected green piston based on errors found in below posts
There is an error here:
“Reminder: tomorrow it’s " formatDateTime(addDays($now,1),“EEEE”)”: "
if({holidaysObserved} != “”,“No Trash Collection Tomorrow. Holiday: ]” {holidaysObserved},
if({$dayOfWeek} == NightBeforeA, “Trash and Recycling Collection Tomorrow”))
The expression translates to: Reminder: tomorrow it’s Wednesday: Invalid parameters. Expecting if(condition, valueifTrue, valueifFalse)
It looks like lines 89 and 98 need a ', “No collection tomorrow” ’ added so they look like line 63 and 72.
Since its already Wednesday please make sure to set the boolean on line 36 for the correct value now. If today was trash only set it to false since it has already happened, if today was trash and recycle set it for true since thats whats coming up.
Hoping you can help me here. Not sure whats broken but it appears to be defaulting to holiday behavior even though it says holiday is “Regular Day”
Can you post your log from the day that was incorrect? There is a lot of helpful data that should print out down there. Also, comparing that bad log to a successful log can shed a lot of light as well…
Someone took a lot of care creating detailed logs with this piston.