You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
High Peak Borough Council - bin sensor goes Unavailable when next collection falls just outside the current Month view #2218
The scraper waits for .e-appointment elements in the default Month view, then filters for collectionDate >= today. Because the Month grid only renders trailing days up to the end of the last displayed week (not a full rolling window), a bin type whose next collection falls just past that cutoff - while its last collection is already in the past — returns zero appointments and the HA sensor shows Unavailable.
Additionally, the < today filter (not <= today) means a bin type with an appointment dated today that's already been collected (Status: Closed-Complete) is still returned as if it were the next collection - masking the bug for bins whose cycle happens to align with today.
Suggested fix: switch to the site's built-in Agenda view (option: "Agenda", agendaDaysCount: 31), which shows a rolling 31-day window from today rather than a fixed calendar month - or advance to the next month if no valid appointment is found before returning.
Happy to test a fix if pointed in the right direction.
changed the title [-]High Peak Borough Council — bin sensor goes Unavailable when next collection falls just outside the current Month view[/-][+]High Peak Borough Council - bin sensor goes Unavailable when next collection falls just outside the current Month view[/+]on Aug 31, 2026
Fixed the primary bug: switched the scraper to the site's built-in Agenda view (a toolbar button already on the page) before reading appointments, which gives a genuine rolling window from today instead of a fixed calendar month. Verified end-to-end that this resolves the cutoff. Included in the September release PR.
On the second part — the "today, already collected" edge case — I looked for a way to detect completion status in the appointment data (the way a couple of other councils in this repo expose a Status: Closed-Complete field), but High Peak's calendar appointments carry no such signal in their aria-labels or CSS classes to distinguish "today, not yet collected" from "today, already done". Changing the filter to exclude today entirely would risk hiding a genuine same-day collection for anyone checking before it happens, which seems like a worse trade-off than the rare case this issue describes. Leaving that part as-is for now — happy to revisit if you spot a status signal I missed.
Activity
[-]High Peak Borough Council — bin sensor goes Unavailable when next collection falls just outside the current Month view[/-][+]High Peak Borough Council - bin sensor goes Unavailable when next collection falls just outside the current Month view[/+]fix(highpeak): switch to Agenda view to avoid Month-view cutoff (#2218)
robbrad commentedon Sep 2, 2026
Great diagnosis, and confirmed both parts live.
Fixed the primary bug: switched the scraper to the site's built-in Agenda view (a toolbar button already on the page) before reading appointments, which gives a genuine rolling window from today instead of a fixed calendar month. Verified end-to-end that this resolves the cutoff. Included in the September release PR.
On the second part — the "today, already collected" edge case — I looked for a way to detect completion status in the appointment data (the way a couple of other councils in this repo expose a
Status: Closed-Completefield), but High Peak's calendar appointments carry no such signal in their aria-labels or CSS classes to distinguish "today, not yet collected" from "today, already done". Changing the filter to exclude today entirely would risk hiding a genuine same-day collection for anyone checking before it happens, which seems like a worse trade-off than the rare case this issue describes. Leaving that part as-is for now — happy to revisit if you spot a status signal I missed.