This Blueprint detects mail deposits and collections in your mailbox using a motion sensor, confirmation entities, and optional counters or datetime entities.
Use a mail counter to track the number of mails in the mailbox.
Record the date and time of the last mail deposit and collection with datetime entities.
Trigger custom actions for deposits or collections.
Scenarios
Mail collection
The user checks their mailbox, triggering the motion sensor inside the mailbox. The configured timeout provides enough time for the automation to check if any mail collection confirmation sensors (e.g., a door sensor or a switch) were triggered within that period.
Scenario A
The user checks the mailbox first, then enters their home, triggering the door sensor or a switch.
Scenario B
The user exits their home (triggering the door sensor or a switch) first, then checks the mailbox.
In both cases, the timeout allows the automation to determine that this activity is most likely a collection rather than a deposit.
Mail deposit
When mail is deposited, the motion sensor inside the mailbox is triggered. If no confirmation entities (e.g., door or window sensors, switches) are activated during the timeout period, the automation classifies this as a deposit.
It would be sweet if there was a binary sensor built into this so that we could show an icon with either “Empty” or “Delivery!”. It’s nice knowing how many deliveries have been made with the counter, however I think a simple yes or no would be more effective. If there were 10 deliveries, I would still only need to go to the mailbox once.
I could update the template to be more permissive on the type of sensor allowed here.
In my case, I have a letterbox with a trapdoor for mail, or a front door for larger parcels. The advantage of the motion sensor is that I can detect both.
The advantage of a counter over a Boolean is that you can not only count the number of items deposited, but also determine whether the mailbox is empty or not.
All you need to do is test if the counter is greater than 0.
If there’s a case where you think this isn’t possible, I might consider adding the option of a binary_sensor
I’ve created the following card, which I use in my dashboard. It allows me to display the date of the last mail collection or deposit, and the number of deposits not yet collected (up to 9, after which it displays 9+ because I don’t need the details at this stage). The number of deposits is shown in red, so I can see at a glance whether there’s mail or not, and when it was deposited.
I’m not a template expert, so maybe there’s a better way to share a template? If you know how, I’d be happy to look into it.
I use a door sensor on mine. It works but they don’t always close the mailbox when mail is delivered. So when we get the mail and close the mailbox door it doesn’t count as a collection.