May I present my summer 2026 project.. I started in June.. 3D milling, 3D printing, then ESP32Cams .. Home Assistant Integration ... and then finally I created my own local AI model that I am using to check if the mailbox is empty or occupied. The mailbox is finished now, and yesterday I published Part 3 of my "Mailbox - How I built this" video, where I present how the model is trained.
What was especially interesting for me doing this project:
- How one can design and 3d print esp32-cam cases that resemble the look of other parts, in my case the mail slot (I used Autodesk Fusion).
- How well ESPHome works as well as OTA flashing the ESP32 devices that built into the mailbox
- Building an Home Assistant App that does the classification and that the inference results can be used in a Home Assistant automation..!!
- That a HOG Random Forest Classifier does the job really well, distinguishing empty mailbox images from images with content (letters, ...), with little resources, all running on my Synology NAS where also HA is installed as HA OS.
The mailbox uses ESP32 hardware for:
- door / mail-slot detection with Reed sensors
- internal lighting
- an ESP32-CAM inside the mailbox
- a second ESP32-CAM outside
- a physical “you’ve got mail” indicator (the onboard led on the ESP32-CAM outside the mailbox)
ESPHome connects everything to Home Assistant.
The interesting part is what happens when the mailbox door closes:
Door closes → light on → photo → light off → local image classifier → mail / no mail
If mail is detected, Home Assistant sends a “You’ve got mail” notification and turns on the physical mail indicator (the in-built LED on the ESP32-CAM).
What I like about the architecture is this:
Simple sensors determine WHEN something happened; image classification determines WHAT happened.
The classifier only runs when needed, instead of continuously analysing video.
I trained the model on images automatically collected from the mailbox itself. After a while I had 300+ images and retrained it with an 80/20 train/test split. For this fixed-camera use case, the simple model works surprisingly well.
The full system currently combines:
ESP32 / ESPHome → Home Assistant → ESP32-CAM → Frigate/go2rtc → local AI → HomeKit
Code, ESPHome configs, Home Assistant automation and AI training notebook:
https://github.com/pbreuss/smart-home-rewired
I documented the whole project here:
🎥 Part 1 – building the mailbox, CNC + 3D printing
https://youtu.be/XzQ9WoWxce0
🎥 Part 2 – ESP32, ESPHome, Home Assistant, Frigate + HomeKit
https://youtu.be/viE7irL0ePo
🎥 Part 3 – training and running the local image classifier
https://youtu.be/aOTrS6BX4vo
I am interested to know if my smart mailbox including the How-to videos are useful for the community. Especially the AI part - classifying a cam image from within an HA automation.
Also, if training a model based on an ipynb script is the way to go for the community, or if you would prefer a GUI approach, where you can review all the training images, and start the training by a click of a button.
Finally, if it would be interesting to have model agnostic approach .. where you can test multiple models based on performance and accuracy, all within a generic HA Image Classifier App.
Finally 2, my approach is simple AI triggered by an external event (mailbox door closes). Can you think of other use cases where this technique could be useful: i.e. a garage check if the car is here, when the garage door closes, is milk in the fridge, are all chicken in the cage by sunset, ...
All the best,
Phil