bruxy70 / Garbage-Collection

🗑 Custom Home Assistant sensor for scheduling garbage collection (or other regularly re-occurring events - weekly on given days, semi-weekly or monthly)
MIT License
382 stars 90 forks source link

Holiday carryover question #403

Closed trizmark closed 2 years ago

trizmark commented 2 years ago

Before you submit a new bug report, please check that

Write your question here

Hi,

I've been trying to get the automatic rescheduling of garbage collection working using the published blueprints. I'm not sure if I'm misunderstanding what each blueprint should do or if there's an issue with the actual blueprint.

Let me explain. In the UK (where I live) garbage collection is shifted if there's a bank holiday during the week or the collection day falls on a holiday. After the shift, there's a catch-up on each Saturday, so in case of multiple holidays the schedule only restores after a few weeks.

I have added the 'Move to next day on public holiday, carry-over to next week if there are more public holidays.' blueprint, which seems to be shifting the collection days, but does not carry over properly. I have 3 separate bins set up as collection is bi-weekly and I also set up the 3 different automations to shift the dates.

My collection day is Monday. Last week we had 2 bank holidays (Thu/Fri). I expect today's collection to be shifted to Wed, next Monday's collection to Tue, with normal schedule resuming on the 20th. Instead I've got today's collection moving to tomorrow and everything back to normal next week.

Same issue around Christmas. This is he currently generated calendar: image

This is what it should be: image

Collection is correctly moved to the 28th (from 26th), but next week should still be the 4th as there was another holiday.

Am I correct in my understanding that the above mentioned blueprint should do the shifts I require? Or is the algorithm implemented there is different?

Thanks, Zoltan

bruxy70 commented 2 years ago

Zoltan, I made the blueprint based on what was described by the users. It could be that the process in your area is slightly different. In which case you can always take the blueprint and modify it to your liking.

There are a couple of variants, I think the one you talk about is moving the event by 1 day if there is a public holiday in the collection week, and is before or on the collection day (so if the collection day is on Monday and public holiday on Tuesday, it has no effect). And if there are two holidays before the collection, it will carry 1 day over to the next week, if thee are two into 2 following weeks etc. This is how I was told to do it, and they said it worked for them. But I have no personal experience with how well it works. In my area the collection works on the date, whether there is a public holiday or not (and if there is a rare exception once a year or so, they announce it, and I just know it and I do not bother changing HA config because of that).

trizmark commented 2 years ago

Ah, I think I get it now (based on your description) - let me try to change the blueprint and see if it works.

Scoff123 commented 2 years ago

Sorry if this should be a new issue but it seems somewhat related. I am not very experienced with Blueprints yet, so I wondered if someone could suggest what needs to be changed to achieve the following please? I am also in the UK, however my normal collection is on a Wednesday. On Wednesday last week the collection was made as normal, but the Thursday and Friday were both Bank Holidays. I can't find an existing blueprint that handles this scenario as the Bank Holiday did not fall on or before the collection date, it was AFTERWARDS, which normally shouldn't cause any change to the schedule, but it has this time. Instead of next Wednesday, 8th June, the next collection is on Thursday 9th June, then collections resume every Wednesday after that.

I need a blueprint that effectively manually shifts the next collection due date back by one day. Probably very simple for someone with more knowledge/experience! Thanks

bruxy70 commented 2 years ago

@Scoff123. The integration is really meant to help with regular events, so that you do not have to think about them. If there is an exception from the rule, I'd question how much effort one should spend to configure this one-time exception. You might as well just remember that - which you do as we are having this chat. But if you insist on having this exception in HA, you can use the blueprint to manually include/exclude dates.

Scoff123 commented 2 years ago

Thanks, a good point about the effort involved. Its really more of a case of being able to make a change here or there, should the regular schedule get knocked out. The integration will work great providing there are no exceptions to the normal schedule, that the existing blueprints can't handle. For my own learning, I will try to understand how to achieve a blueprint to change an upcoming date as a single one off change.

trizmark commented 2 years ago

Thanks for the help. I'll close this for now as I've no idea when I'll have time to tinker with the blueprints. If I come up with something good, I'll post it, so others can reuse it.