Bin / Waste Collection

I managed to solve this myself. The problem was that the bin schedule is loaded after the page loads so scraping the url didn’t work. Instead I used phantomjs to download the page and then ha-multiscrape to scrape based on the CSS Selectors.

Hello Dan. I’m also interested in understanding how you did this. Cheers

Here’s my attempt… This is all I get from the local council page, so I scrape the ‘alt’ text of these images. I tried to write a template to capitalise the text properly but have more pressing projects in hand currently.


#Bin collection
  - platform: scrape
    resource: https://www.southlanarkshire.gov.uk/directory_record/[Road where I live]
    name: wasteCollection
    select: ".serviceDetails img"
    attribute: "alt"

I’ve created a JSON file, but I’m really struggling to create a sensor to parse and show the detail. Could someone please point me in the right direction? Below is my JSON file that creates from the web. You’d think the sensor bit would be the easy part, but I’m failing utterly. The JSON file is in a folder which is accessable by Home Assistant - /config/customjson/bins.json

{
    "bins": [
        {
            "BinType": "Empty Standard General Waste",
            "collectionDate": "16/03/2022"
        },
        {
            "BinType": "Empty Standard Mixed Recycling",
            "collectionDate": "23/03/2022"
        },
        {
            "BinType": "Empty Standard Garden Waste",
            "collectionDate": "23/03/2022"
        },
        {
            "BinType": "Empty Standard General Waste",
            "collectionDate": "30/03/2022"
        },
        {
            "BinType": "Empty Standard Mixed Recycling",
            "collectionDate": "06/04/2022"
        },
        {
            "BinType": "Empty Standard Garden Waste",
            "collectionDate": "06/04/2022"
        },
        {
            "BinType": "Empty Standard General Waste",
            "collectionDate": "13/04/2022"
        },
        {
            "BinType": "Empty Standard Mixed Recycling",
            "collectionDate": "20/04/2022"
        },
        {
            "BinType": "Empty Standard Garden Waste",
            "collectionDate": "20/04/2022"
        },
        {
            "BinType": "Empty Standard General Waste",
            "collectionDate": "27/04/2022"
        }
    ]
}

In the UK, has anyone had any success getting data from https://iweb.itouchvision.com/:

https://iweb.itouchvision.com/portal/f?p=customer:BIN_DAYS:::NO:RP:UID:625C791B4D9301137723E9095361401AE8C03934

I have looked at the network headers / general info in the developer console, I found a cookie that was set and tried using that in a curl request but not successful.

Looks like this 3rd party portal is used by a lot of councils.

Seems that the cookie I found is a session cookie, in which case no point in hard-coding that into the request.

Just trying to avoid re-inventing the wheel :slight_smile:

My local council have also moved to this. I am now trying to find a way to get the updates without having to use the Ical file

Would really like to implement this in my setup, however reading all available relevant threads that I can find, I can’t work out the best approach. My local council site offers this information based on UPRN, and as an example, I have used a nearby postcode:

The information is clear on the site with dates, collection types by container colour etc, however I don’t know the best way to get this into HA. Would scraping (using multiscrape) this info be best as there is no API available? I know there is an integration available via HACS which I think also requires some automations in order to update for special days/public holidays when the regular schedule changes.

1 Like

can someone help me with this? for st helens borough council?

Anyone able to help with this one ?

Thanks

North East Lincolnshire · Issue #41 · robbrad/UKBinCollectionData · GitHub

Hi all,

I’ve recently added the following scripts based on some of the existing GitHub issues and the requests here:

  • Leeds City Council
  • North East Lincolnshire (requested by @tri_94 and one Github user)
  • St Helens Borough Council (requested by @chaddie)
  • Cardiff Council (requested by a few people)

I don’t personally use HomeAssistant, but I hope these scripts assist those that wanted/requested them. If they don’t, please feel free to raise issues on GitHub and I’ll try my best to fix them!

I’ve got you :slight_smile:

1 Like

#NotAllHerosWearCapes ! :man_superhero:

1 Like

Great thank you!! :blush:

1 Like

Huge kudos to @dp247 for taking some of these forward.

Keep checking the repo guys and contributing “many hands” ! :partying_face:

1 Like

Couldn’t have done it without you - thanks for letting me be a part of this! :slight_smile:

1 Like

If it’s any help at all (even though I know you said you solved it), I’ve just added a branch to my fork (will merge into main once the documentation is done) that will get the next collection for all bins for Blackburn Council.

Hi All

@dp247 and I have been working hard to make intergration tests available via GitHub Actions - these tests run nightly and on changes to the repo

If you want a quick way to see if the repo is still working with your council just go to https://robbrad.github.io/UKBinCollectionData/3.9/

Since this is seemingly very UK centric thread, I’m wondering if anyone has managed to sort this out for Bexley council? Their site seems to be a monstrosity with you needing to go through a set of forms to find your collection day and then parse from a calendar that it on a completely different page…

Failing that, I’ll probably just sump for a dumb sensor that changes every week for each bin…

Add it to GitHub (if its not there) and I’ll take a look sometime this week :slight_smile:

1 Like