Notification sent by Home Assistant.
So, I created an locally-hosted AI-powered solution using YOLO object detection, with a model specifically trained to recognize my trash cans. Now, the system automatically stops the reminders once I’ve put the trash out!
Tech Stack
- eufy-security-ws - integrates Eufy Security cameras into Home Assistant
- Home Assistant - provides interface to cameras and motion detections
- Node-RED - handles all logic for automations
- YOLO - provides AI-powered object detection
- YOLO web service - Provides web API interface for YOLO inside Docker container
- EMQX - MQTT broker used for messaging
- Labelme - used for labelling images for iterative learning
Machine Learning Approach
I leveraged YOLO, a real-time object detection algorithm, to train a model specifically designed to detect my trash cans. The process involved:
- Dataset Collection: Gathering and labeling images of trash cans from various angles, lighting conditions, and weather scenarios to ensure accurate detection.
- Model Training: Using YOLO to train a custom model, fine-tuning hyperparameters for accuracy.
- Testing and Optimization: Conducting multiple tests to minimize false positives and enhance detection reliability in all conditions.
- Retraining and Fine-tuning: Analyzing misdetections, labeling them correctly, and retraining the model to improve accuracy.
- API setup: Configuring an API Docker container to serve as the interface between the YOLO model and my home automation system.
Integration with Home Automation
After training the model and ensuring its accuracy, I integrated it into my home automation setup using Node-RED:
- Camera Integration: Security cameras capture images when motion is detected.
- Image Processing: Node-RED sends API request with image to YOLO Docker container, where it is analyzed to detect the presence of a trash can and returns the results.
- Notification System: If a trash can is detected by the front cameras, it confirms the trash has been put out and stops the reminders.

Image of ‘Trash cans out back’ input boolean in Home Assistant.
Trash can detection logic
Four cameras in two locations are checked for trash cans: two in front (front door and front yard) and two in the backyard (driveway and back door). This lets me know with reasonable certainty whether the trash cans are in the front or back yard. The selected cameras also reduce the likelihood of a neighbor’s trash cans being detected.
- Node-RED listens to the MQTT topic
camera/+/event
for animage_downloaded
event - The image size is compared to the known size of a full notification image and only proceeds if it is
- This prevents cropped images (such as would occur with a person detection event on the camera) from being processed for trash cans, as they often are cropped out
- The image is sent to a locally-run YOLO service using a model custom-trained on my particular trash cans
- The number of trash cans detected is counted and if > 1, the trash cans are assumed to be in the same location as the camera image being processed
- If the trash cans were NOT detected, only update the trash cans’ location between 5AM and 11PM
- This prevents false negatives from causing my reminders to prematurely be disabled when a dark camera image causes the system to think the trash cans are no longer out back
“Put out trash” reminder logic
- If a “Put out trash” event is in the “Household Tasks” calendar in Home Assistant, a “Put out trash” input boolean is turned on
- If trash cans are NOT detected out back and trash is scheduled to be put out today, it’s assumed the trash has been put out, so “Put out trash” is turned off
- If trash cans ARE detected out back and trash is scheduled to be put out today, the “Put out trash” boolean is turned on
- This is a fail-safe in the off-chance that a false negative causes the system to think trash had been put out prematurely
- At 9am, 12pm, 5pm, and 7pm if “Put out trash” boolean is on, reminders are sent in the form of notifications and spoken announcements on smart speakers in occupied rooms. If “Put out trash” is off, the reminders are skipped.
Results and Impact
This system has significantly improved the reliability of my trash reminders and reduced notification fatigue. And I no longer have to remember to mark the trash cans as being put out, which saves me from being reminded when it isn’t necessary. The project demonstrates a practical application of machine learning and automation to solve everyday challenges efficiently.
Future improvements
- Streamline YOLO call to reduce duplicated nodes
- Support for when one trash can is in front and the other is in back
- Iterative training for a few rare edge cases that result in a false negative
Conclusion
This project showcases how AI and automation can be combined to create smart, practical solutions. By leveraging YOLO’s real-time object detection, I developed a system that reduces forgetfulness and enhances household efficiency. It’s a great example of applying machine learning to everyday life in a meaningful way.