Node-RED for Waste Collection Automation: A Step-by-Step Guide

Hey everyone, I wanted to share my recent experience with Node-RED and how it transformed my waste collection management. I’ve always struggled with keeping track of different waste pickup schedules, especially since our local waste management doesn’t provide digital data. After some research, I decided to give Node-RED a try, and I’m thrilled with the results!

The Challenge

I have four types of waste pickups: blue bin, yellow bin, general waste, and hazardous waste. Each has its own schedule, and keeping track manually was error-prone and time-consuming. I needed a system that could fetch the latest pickup dates, sort them, and notify me in a user-friendly way.

The Solution

I discovered that Node-RED has a fantastic library called node-red-contrib-ical-events which allows fetching events from iCal calendars. Here’s how I set it up:

  1. Create Separate Calendars: I created separate iCal calendars for each waste type, importing the pickup dates manually at the start of each year.
  2. Node-RED Flow Setup: I configured the Node-RED flow to fetch events from each calendar, sort them by date, and extract the next two pickup dates for each type.
  3. Data Processing: The flow processes the events, calculates the time until the next pickup, and formats the data for display in Home Assistant.
  4. Integration with Home Assistant: I set up MQTT sensors in Home Assistant to display the next pickup dates and times, complete with icons for each waste type.

The Outcome

Now, I have a clean, consolidated view of all my waste pickups directly in my Home Assistant dashboard. The system automatically updates daily, ensuring I never miss a pickup. It’s been a game-changer for me!

Tips for Getting Started

  • Install Required Nodes: Make sure to install node-red-contrib-ical-events and node-red-contrib-sun-position for accurate time calculations.
  • Backup and Test: Before deploying, test the flow with dummy data to ensure everything works as expected.
  • Customize for Your Needs: The flow is highly customizable. You can adjust the number of days to fetch, the notification times, and even integrate it with voice assistants like Google Home or Alexa.

Community Support

If you’re new to Node-RED, don’t hesitate to ask for help. The community is incredibly supportive, and there are plenty of tutorials and guides available. I’d love to help anyone who’s interested in setting up a similar system!

Happy automating! :rocket: