Mailbox Sensor

I plan on implementing a mailbox sensor to let us know when the mail has been delivered.

I have a z-wave door/window sensor which I plan on placing in the mailbox so that once opened - I’ll receive an event which I can act upon.

I’d like for the sensor status to remain OPEN for 8 hours so if we are not home, the mail delivered status will appear on our HabPanel status board - herein lies my question.

Can I use the expire binding to keep the status as OPEN, even though the mailbox has presumably been opened and then closed?

Should I create a proxy switch with a rule?

What’s the best method to keep the status OPEN, even thought it may be truly CLOSED?

I’m also planning on creating a reset button (maybe an Amazon Dash Button) to reset the state if we don’t want to wait the 8 hours or if we have collected the mail.

Any suggestions greatly appreciated.


I’m just switching a proxy switch item to ON when the flap has been opened and a time cron at midnight to set it back to OFF.
In addition to that I get a notification on my phone (and an image from my front door cam :sunglasses: ) for multiple flap open events.

Can you recommend a zWave device for this? I live in the midwest US which the temps can drop to -20 F during the winter.

I asked this question to Aerotek engineers and they said not to put their stuff in a metal box or in that temp.

Best, Jay

This is exactly what I do. :+1:

I use an Aeon ZW097 dry contact sensor, but I think these are NLA.

1 Like

This is the one I purchased from Amzaon - fairly inexpensive.

Metal box is self-explanatory for a radio device.

For low temperature, while the maker’s won’t guarantee correct operation - “you’ll probably get away with it”.

Likely of more concern is cold battery performance

I’m hopeful I can get about 10’ of range…I have a mains powered Z-Wave relay on my gate which about 8’ feet away. I’m in Texas so the coldest we typically get is about 20 F.


Yeah, it’s WAY outside their operating parameters. LOL

The device in my mailbox is showing just one neighbor, which is a wall switch about 2 meters from the mailbox. I really need to put the device inside the house, and just run a cable from the mailbox into the house. Not high on my priority list at the moment…

I’m missing something easy here…

Sensor is installed in the mailbox and working.


Contact Mailbox "The Mailbox Is: [%s]" { channel="zwave:devicexxxxxxxc:node30:sensor_door" }
Switch MailboxProxy "Mailbox is" <mailbox>


rule "Mail Delivery"
	Item Mailbox changed from CLOSED to OPEN
	say("The Mail Has Been Delivered")

The items are working as they should according to the log files…

2018-10-27 16:18:08.961 [vent.ItemStateChangedEvent] - Mailbox changed from CLOSED to OPEN
2018-10-27 16:18:08.962 [vent.ItemStateChangedEvent] - MailboxProxy changed from OFF to ON

Yet on the sitemap, I get no data,something is missing???


Or will the proxy item not display a switch/toggle and I just need to read the stTe?

[That doesn’t seem to be exactly the same label text as the Item.] Edit
yes it is, glasses needed.
Sitemap entry looks like?
I’d pop a [%s] into the Item temporarily, to help see what’s what.

Adding the [%s] returns nothing…

Sitemap Entry…

		Text item=MailboxProxy

I think you are going to want to use…

Switch item=MailboxProxy

Dooh! Geez I really had been staring at that too long.

Thank you!

1 Like

It’s ok to leave it as Text. You just need a [%s] in the item definition or in the sitemap widget.

Mine looks like this (with my own custom mail icon, and it only shows when there’s mail (or more specifically, when the mailbox has been opened)). There’s a rule to set YouHaveMail ON when the sensor triggers, and a rule to turn it off at midnight.


Switch YouHaveMail  "You Have Mail [%s]"


Text item=YouHaveMail label="Mail [MAP(]"  icon="c_mail" visibility=[YouHaveMail==ON]
Switch item=YouHaveMail label="Clear Mail []" icon="c_mail" visibility=[YouHaveMail==ON] mappings=[OFF="Clear"]

My contains this.


And here are the icons. The mail-off icon isn’t used here; it’s used in a HABpanel widget.

Edit: I take that back. mail-off isn’t used in HABpanel anymore.

<div ng-if="itemValue('YouHaveMail')=='ON'" ng-style="{opacity: 1.0}">
  <button class="btn btn-md" style="background: white; color: black" 
          ng-click="sendCmd('YouHaveMail', 'OFF')">
      <img id="mail-icon" src="/static/images/mail.png" width="48px" height="48px"/>

<div ng-if="itemValue('YouHaveMail')=='OFF' || itemValue('YouHaveMail')=='NULL'" ng-style="{opacity: 0.2}">
		<img id="mail-icon" src="/static/images/mail.png" width="48px" height="48px"/>

Got my first email from OH on mail delivery. I was so excited, like I won something :wink:

OpenHAB – The Mail Has Been Delivered.

I ended up putting 2 holes in the back of the mailbox (2 weeks ago) hoping the freq would send out those holes; been a month and all of sudden it worked.

Not sure why all of sudden but lets see if it continues. It’s actually cold here around 25 degrees also.

Thanks again!

Best, Jay


Here’s the final solution using Squid’s recommended mailbox sensor above.

Mailbox is about 50’ away from my house; the 2 closest zWave devices are Aeotec Repeater in the garage (door is closed 99% of the time) and an Aeotec Multisensor 6 on main via a upstairs window pointed out.

Drilled 4 holes in the back of the mailbox for zWave to communicate from. Tried 2 top holes first but had NO luck with them. Hopefully the wife doesn’t notice the holes anytime soon ;-(

It’s 22 degrees in Chicago today and it works perfectly. The sensor has been in the mailbox for over a month now.

Best, Jay

Chicago is so far away and yet we have the same Issues. When it comes to smartHome and openhab it all comes down to the wife not hitting us when things don’t work. I get that. Everything is working fine for 360 days a year, but hell breaks lose, when the system has some minor glitch and a light is not going on immidiately…

1 Like

this solution looks very insteresting.

I want to implement a reset button.

does someone know how to prepare it?

Just add a switch to your sitemap that displays only when YouHaveMail is ON.

Switch item=YouHaveMail label="Clear Mail []" icon="c_mail" visibility=[YouHaveMail==ON] mappings=[OFF="Clear"]

I use the EXPIRE binding to reset my switch after a set period of time.