How I Over-Engineered Bin Day Notifications

I hate bin day. No, seriously. I absolutely hate it.

It’s my job at home to take the bins out each week, and it’s not just the gross factor - it’s the mental gymnastics of trying to remember which of our multiple bins needs to go out on any given week. Is it recycling this week? Or landfill? Or both? Or neither because of that bank holiday? ARGH.

Look, I know this isn’t exactly world hunger I’m solving here, but considering I’m supposed to be this tech-savvy person, it’s embarrassing how often I mess this up. So I decided to fix it with entirely too much technology.

The Bin Day Struggle Is Real

Let me walk you through my usual Thursday evening panic:

  1. Suddenly remember tomorrow might be bin day
  2. Look out window to see if any neighbors have put bins out yet
  3. Nobody has (because they’re all functional adults who do it in the morning)
  4. Forget about it until midnight
  5. Remember again, briefly consider going outside in my pajamas
  6. Decide to just check in the morning
  7. Wake up to the sound of the bin truck already on our street
  8. Sprint downstairs and outside in whatever I’m wearing
  9. Realize I’ve put out the wrong bin
  10. Die a little inside

I swear our bin men must think I’m completely unhinged. I’ve literally chased the bin lorry down the street in my slippers.

The Local Council Website From Hell

I could just check the council website? Harlow Council’s website is like a case study in bad UX.

First, you need to find the bin collection page, which isn’t linked from the homepage because that would be too convenient. Then you have to enter your postcode, but the form keeps losing focus as you type because it’s doing an address lookup after EVERY. SINGLE. CHARACTER.

Once you finally manage to enter your entire postcode, you select your address from a dropdown, submit the form, and then wait… and wait… while the website thinks about it. It’s even worse on mobile - it’s like waiting for a dial-up connection to load in the ’90s.

Eventually it shows you a table with two entries for each collection date: one for which bin (recycling or landfill) and another for the food caddy (which goes out EVERY week, so why even list it separately?).

Bank Holidays: The Bin Schedule Destroyer

Just when you think you’ve got the hang of the every-other-week system, along comes a bank holiday and everything goes to pot. Collections get pushed back a day, but only sometimes, and occasionally they skip a week entirely.

The final straw was the chaos during Queen Elizabeth II’s funeral period. The bin collections were completely all over the place - moved forward, delayed by a week, random weekdays - it was bin anarchy. Yes, the council website had the correct dates, but as I’ve explained, using that site requires the patience of a saint.

After the third week of completely messing up which bin to put out, I decided technology needed to solve this problem for me.

The Internet Must Have Solutions, Right?

I Googled for bin notification systems and found some local councils actually offer email or SMS notifications for bin days! Amazing! So I immediately checked if Harlow Council offered this service.

Narrator: They did not.

Typical.

But during my search, I stumbled across this absolute legend named Darren Tarbard who built something called a “Bindicator” - a device that lights up different colors on bin day to tell you which bin to put out. I was in awe. This was the kind of pointless-yet-essential home automation I live for.

I really wanted to build Darren’s light-up version, but this was during that period when you basically had to sell a kidney to get a Raspberry Pi thanks to the chip shortage. A Pi Zero 2W was going for silly money, and I couldn’t justify it just to avoid bin-related anxiety.

So I scaled back my ambitions: what if I just got a text message on bin day? Less cool, but way easier to implement.

The Harlow Bindicator Is Born

Since I’d stolen borrowed the idea and name from Darren, I decided to call mine the “Harlow Bindicator” to avoid any confusion. I wanted a simple solution: just text me on bin day and tell me which color bin to put out.

For sending SMS, Twilio seemed like the obvious choice. Now I just needed to figure out how to get the bin schedule data and send the message.

ApplicationMQTTNodeRedTwilio

I already had MQTT and Node-RED running for other home automation stuff, and Node-RED has a nice Twilio node, so I decided to leverage that. This way, the Python application just needs to:

  1. Scrape the council website using Selenium (because of course it needs JavaScript to function)
  2. Parse the data with BeautifulSoup
  3. Publish a message to MQTT if it’s bin day

Then Node-RED can:

  1. Listen for these MQTT messages
  2. Check if it’s actually bin day
  3. Send an SMS via Twilio

This might seem overly complicated for sending a text message, but I’m a developer - unnecessarily complex solutions are kind of our thing.

The Python Code: Scraping A Terrible Website

My Python application does three main things:

  1. Configuration: Load settings like the MQTT connection details and my UPRN (Unique Property Reference Number - a special identifier for my address that I found using findmyaddress.co.uk)

  2. Web Scraping: Use Selenium to load the council website and extract the bin collection data

  3. MQTT Publishing: Send the results to my MQTT broker so Node-RED can pick it up

Here’s a fancy diagram I made to show the process flow:

ReadConfigurationLoadBSilneeSptateParseMSQoTuTrce

Setting up Selenium on a Raspberry Pi was… fun. I had to install Chromium and the matching ChromeDriver:

1
2
3
sudo apt-get update
sudo apt-get install chromium-browser
sudo apt-get install chromium-chromedriver

Then I had to make sure they were properly linked:

1
2
cd /usr/bin
ls -l chrom*

Parsing the council website was surprisingly straightforward once I’d looked at the HTML. Each bin collection is in an element with class “collectionsrow”, and within that I could find the bin type and collection date.

For the MQTT message, I created a simple JSON structure:

1
2
3
4
5
6
7
payload = json.dumps({
            "date": self.date.strftime("%d/%m/%Y"),
            "bin_day": self.is_bin_day(),
            "bin_type": self.wheelie.bin_type
        })

return payload

After sending the message, the application sleeps for an hour before checking again. I probably could have made it check just once a day, but what if the council updates the schedule during the day? (They don’t, but you never know!)

Node-RED: The Glue That Holds It All Together

Here’s my simple Node-RED flow:

MQTTSwitchLimiterTemplateTwilio

The flow consists of five nodes:

  1. MQTT Listener: Subscribes to my “bindicator” topic and passes any messages to the next node

  2. Switch Node: Acts like an if-statement, only continuing if the “bin_day” field is true (meaning today is actually bin day)

  3. Limiter: This is important! It only lets one message through per day, because Twilio costs money and I don’t need 24 texts telling me the same thing

  4. Template Node: Formats a nice message like “Today is bin day for recycling!”

  5. Twilio Node: Sends the SMS to my phone using Twilio’s API

The most important part was that limiter node. Without it, I’d get a text message every hour telling me the same thing, which would be both annoying and expensive.

What I Learned (Besides My Bin Schedule)

This little project taught me several things:

First, I got more practice with Python, which has been my “I should really learn this properly” language for ages.

I also learned web scraping with Selenium and BeautifulSoup, which felt like having superpowers. I can now extract data from any website, no matter how badly designed!

But the most valuable thing I learned was Python unit testing. Coming from a Java background with Mockito, Python’s testing approach with @patch felt weird at first. But after much frustration and some creative swearing, I got it working and even achieved 100% test coverage. Once it clicked, I had that “aha!” moment that makes learning new things so satisfying.

Did It Work?

Yes! I haven’t missed a bin day since setting this up. Every Friday morning (or occasionally Saturday after bank holidays), I get a text telling me exactly which bin to put out.

My partner thinks I’m ridiculous for spending days automating something that would take 30 seconds to check manually. She’s probably right, but I regret nothing.

The source code is available on GitHub if you also want to over-engineer your bin schedule. Or you could just write it on a calendar like a normal person. But where’s the fun in that?


↤ Previous Post
Next Post ↦