Effortless Recycling Bin Management with OpenHAB Automation

I’ve always been a bit forgetful when it comes to recycling schedules, but I’ve found a fantastic solution using OpenHAB to keep track of my bin collection days. Let me share how I set it up and how it’s made my life easier!

The Problem
Our local council provides two bins—one for general waste and one for recycling. The recycling bin needs to be put out every second week, and I often forget when it’s due. This led to missed collections and a pile-up of recyclables!

The Solution
I decided to create a simple indicator in my OpenHAB interface to show whether it’s a recycling week or just a waste pickup. Here’s how I did it:

  1. String Item Setup
    I created a String item to track the bin collection week:
    plaintext
    String BinCollectionWeek “Bin Week [%s]” (Home)

  2. Sitemap Configuration
    I added a frame to my sitemap to display the current status:
    plaintext
    Frame label=“Home Info” {
    Text item=BinCollectionWeek
    }

  3. Rule Implementation
    I set up a rule to update the bin collection status every Monday morning:
    plaintext
    rule “Bin Week”
    when
    Time cron “0 0 7 ? * MON *”
    then
    val DateTime BinCollectionStartDate = new DateTime(“2020-08-07T00:00:00”)
    if (Weeks.weeksBetween(BinCollectionStartDate, now).getWeeks() % 2 == 0)
    BinCollectionWeek.sendCommand(“recycling”)
    else
    BinCollectionWeek.sendCommand(“waste”)
    end

  4. Icons Setup
    I added two icons to visually represent the status:

  • Waste bin icon for regular weeks
  • Recycling bin icon for recycling weeks
  1. HabPanel Integration
    Finally, I integrated everything into my HabPanel app for easy viewing on my phone.

The Result
Now, every Monday, my system automatically updates the bin collection status. I’ve never missed a recycling pickup since! It’s such a small thing, but it’s made a big difference in keeping our home tidy and environmentally friendly.

Tips for Others

  • If you’re using an iPhone, make sure to handle the icon display correctly to avoid any bugs.
  • Keep your rule simple to ensure reliability.
  • Customize the icons to match your home’s aesthetic!

This project was a great way to dip my toes into OpenHAB automation. It’s empowering to create solutions that solve everyday problems. If you’re looking to streamline your home management, I highly recommend exploring OpenHAB for similar automation tasks!

Happy automating! :star2: