mampfes / hacs_waste_collection_schedule

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

[Bug]: Sheffield not showing green bins #1969

Closed danwall8585 closed 1 month ago

danwall8585 commented 4 months ago

I Have A Problem With:

A specific source

What's Your Problem

Green bin sensor is no longer available despite green bin collection showing on the website. I know the green bin only shows conditionally on the site based on if an address has paid for the year if that makes any difference (we have paid).

Source (if relevant)

sheffield_gov_uk

Logs

no relevant logs

Relevant Configuration

Version 1.47.0, using HACS.

:
  sources:
    - name: sheffield_gov_uk
      args:
        uprn: xxxxxxxxxxxx
      customize:
        - type: Black Bin
          alias: Black bin (General)
          icon: mdi:trash-can
        - type: Brown Bin
          alias: Brown bin (Bottles)
          icon: mdi:trash-can
        - type: Blue Bin
          alias: Blue bin (Paper)
          icon: mdi:trash-can
        - type: Green Bin
          alias: Green bin (Garden)
          icon: mdi:trash-can

sensor:
  #bins
  - platform: waste_collection_schedule
    source_index: 0
    name: Home bins
    #details_format: upcoming
    #count:
    #leadtime:
    #value_template: 'in {{value.daysTo}} days'
    #date_template:
    add_days_to: true
    #event_index:
    #types:
    #  -
  - platform: waste_collection_schedule
    source_index: 0
    name: Next bin
    details_format: upcoming
    add_days_to: true
    #
  - platform: waste_collection_schedule
    source_index: 0
    name: Black Bin
    details_format: upcoming
    add_days_to: true
    types:
      - Black Bin
      #
  - platform: waste_collection_schedule
    source_index: 0
    name: Green Bin
    details_format: upcoming
    add_days_to: true
    types:
      - Green Bin
    #
  - platform: waste_collection_schedule
    source_index: 0
    name: Brown Bin
    details_format: upcoming
    add_days_to: true
    types:
      - Brown Bin
    #
  - platform: waste_collection_schedule
    source_index: 0
    name: Blue Bin
    details_format: upcoming
    add_days_to: true
    types:
      - Blue Bin

Checklist Source Error

Checklist Sensor Error

Required

5ila5 commented 4 months ago

Your config looks like all your specifc sensors should not work as you change the name from Green Bin to Green bin (Garden) and the sensor looks for Green Bin but should look for Green bin (Garden)

I cannot reproduce the issue we currently have 4 test cases, the one that show green bin on the website, do return green bin events.

With green bin 100050938234, 100051085306 Without green bin: 100050961380, 100050920796

danwall8585 commented 1 month ago

I've finally got around to looking at this again. Tested with ...234 and that shows green bin correctly, switched back to mine and it's back to Unavailable.

Double checked on the website and that's definitely showing next green bin collections for my address so not sure what's going on! Is there an underlying API that gathers the data I can test or anything?

5ila5 commented 1 month ago

The script looks at https://wasteservices.sheffield.gov.uk/{UPRN}/calendar

Searches all divs with class calendar-table-cell in all these divs it looks for all child li elements, where it takes the title attribute and splits at - the script then tries to parse the first part (everything before -) to a date object. The second part is taken for the name shown in your calendar.

You can try to check what's different with your address, or you can send me the HTML of the website or your UPRN, so I can check: either here or privately to silaskoch@gmx.de

danwall8585 commented 1 month ago

Great thanks, so it looks like the green bin doesn't show on the calendar page for me but does on the page before (property). I'm 99% sure it should be there but it looks like an issue at the council's end so closing this. Thanks again