mampfes / hacs_waste_collection_schedule

Home Assistant integration framework for (garbage collection) schedules
MIT License
996 stars 634 forks source link

Chesterfield not working for bank Holidays #1007

Open callacomp opened 1 year ago

callacomp commented 1 year ago

Just missed my bin collection. Yesterday it was showing as in 2 days time, yet today on the gov website it says today. The history shows the jump. Screenshot_20230527_082358_Home Assistant Screenshot_20230527_082338_Home Assistant

dt215git commented 1 year ago

If I read that right, you're collection would have been on Monday, so at mid-night last night it changed to indicates 2 days. If the dark blue history bar indicated 3 days, that would seem to be the expected behaviour. Then when HA re-queried the website at 01:37, it returned the collection date for Monday week, hence the jump to 9 days.

Given the jump in dates seems to match the last update time, I suspect they updated the schedule at some point between the two most recent HA queries.

image

5ila5 commented 1 year ago

The used API does return a currentScheduledDate and originalScheduledDate for the next and last pickup. The source uses the currentScheduledDate so it should have picked the right date if they updated their data in time. Unfortunately this is not really reproducible. But I checked with the currentScheduledDate argument from the last pickup (see below) and the source would have returned the right date (2023-05-27).

currentScheduledDate: "2023-05-27T05:30:00.000Z", originalScheduledDate: "2023-05-28T23:00:00.000Z"
callacomp commented 1 year ago

It's normally a Monday, but over a Bank Holiday it changes to a Saturday. It's right today on gov website but i can't tell what it was yesterday. Seems idd they would have updated it between updates. I'll have to check next bank holiday, but that's some time away. Screenshot_20230527_162308_Chrome

dt215git commented 1 year ago

In HA, you could set up a sensor to log the collection dates being used - that way you could view a history of collection dates the script has retrieved. Probably not something you'd want running all the time, but might be worth considering in December when the next public holidays are due.