Interfacing Mailbox Alert® with SmartThings® via WiFi using ESP8266 NodeMCU and Tasmota Edge

Interfacing Mailbox Alert® with SmartThings® via WiFi using ESP8266 NodeMCU and Tasmota Edge

This document assumes you have a.) a SmartThings® installation at your location, b.) working knowledge of how to configure SmartThings® Devices and Routines and, c.) the ability and willingness to solder. A basic working knowledge of Tasmota and Tasmota Edge would be helpful. (Users of Habitat, Home Assistant, and other HA solutions should have no problem adapting the basic ideas presented here in order to implement their own solution.)

Mail Alert® is.a commercial product which will tuns on an LED light and sounds a buzzer whenever the mail box door is opened. In this document we will describe how to interface this unit with the SmartThings® platform. Once interfaced, you can write routines to perform various tasks whenever the Mailbox Alert® is triggered.

Technical Overview
In this solution, we connect the buzzer output of the Mailbox Alert® to a 5v opto-isolated relay. The relay is in turn connected to a GPIO pin on the ESP8266. When the Mailbox Alert® is triggered, the voltage from the buzzer circuit drives the relay. The Tasmota software on the ESP8266 senses the changes in the relay state and sends a notification to SmartThings® over WiFi and SmartThings® performs whatever routine(s) are applicable.

Block Diagram

Build Steps

  1. Open up the Mailbox Alert® receiver and de-solder the buzzer from the PCB. Note that the + (pos) contact is closest to the outside edge of the board

  2. Connect two wires to the PCB in place of the buzzer. Pass the wires out of the top of the plastic case using the buzzer vent holes and re-assemble the case

  3. Connect the - (neg) wire to the DC- terminal on the relay

  4. Connect the + (pos) wire to the DC+ terminal on the relay

  5. Connect a jumper wire from the DC+ terminal on the relay to the In/Trigger terminal on the relay

  6. Set the Bias jumper on the 5v relay to HI. This will keep the contact closed when there is no power to the relay

  7. Adjust the voltage being sent to the relay as follows:
    a.) Power up the MailBox Alert® receiver and press the reset button to turn off the LED
    b. )Turn the volume all the way down, but do not click it off.
    c.) Use the door sensor to trigger the Mailbox Alert® receiver. The LED should come on immediately. The receiver (thinking it still has a buzzer) will turn the buzzer on/off rapidly for about 3 secs and then pause for about 1 sec. It does this four times.
    d.) Slowly turn up the volume until the relay starts receiving power, it lights up it’s LEDs, and you can hear the relay clicking. Do not over power the relay.

  8. Flash the ESP8266 with the current release of TASMOTA firmware. Instructions for this are outside of the scope of this document but can be found here Getting Started - Tasmota. (Caution: Power the ESP8266 via the USB port for flashing, do not use external power)

  9. Configure the ESP8266 as a Generic Tasmota device. Designate GPIO14 as switch 1 and GPIO12 as Relay 1 (We don’t use the relay, but the device GUI looks better when a relay is configured in tandem with a switch)


  1. Add the device to SmartThings® using TASMOTA EDGE drivers. Instructions for this are outside of the scope of this document but can be found here. [ST Edge] •• Tasmota Edge •• for Sonoff, Tuya & many other ESP WiFi & HTTP devices - over 2000 Tasmota supported devices - #473 by ragoss

  2. Connect the COM terminal on the 5v Relay to the G pin on the ESP8266. Connect the NC terminal on the 5v Relay to pin D5 (GPIO14) on the ESP8266.

  3. Long Term Power Options. The Mailbox Alert® runs on 12v DC power. The ESP8266 runs on 5v dc if powered via the USB port -OR- 3.3v dc if powered via the Vin pin. I have used a single 12V wall wart connected in parallel to the Mailbox Alert® and a DC-DC step-down converter which provides the correct voltage for the ESP8266.

SmartThings® configuration

Issue: When triggered by the receiver, the 5v relay will open and close about 50 times in 12 seconds! We only need to capture ONE event that we can act upon in SmartThings®.

Solution: Debounce the relay using a virtual switch and routines.

Create a routine that says if the physical switch state (GPIO14) changes to ON or OFF, turn on the Virtual switch. The virtual switch masks the flapping of the physical switch.

The virtual switch can now be used to trigger events such as sending a text that says ‘You Have Mail’. You can turn it off at night as part of your GOODNIGHT routine, manually in the app, with voice commands from Alexa, or with a custom routine. Note that the red light on the Mailbox Alert® needs to be reset manually.

Mailbox Alert® from Hannah Products
5v Opto-isolated relay fro HiLetGo
ESP8266 NodeMcu (With CH340 serial chip)
DC-DC step-down converter

Software TASMOTA software flashed to ESP8266
TASMOTA EDGE driver installed on SmartThings® Hub

This solution builds upon prior work which is documented in this thread

1 Like

Nice concept, but probably not applicable for a multifamily situation. Too bad the USPS hasn’t figured out how to notify users when the mail actually arrives like all the other delivery services have…

1 Like

They do for packages or anything with a tracking number, but not for standard mail. USPS informed delivery will tell you when packages are delivered and you can receive texts and/or email notifications.

This is for all those other times the mail comes…


I’ve got that service set up, but unfortunately in my case it only means the mail is coming soon, which could be 2-3 days later…It is for the regular mail that I’m seeking a real time solution.

Tell us more about your challenges. Maybe someone will have some useful ideas…

1 Like

The need is the same as the single-family approach, but the multifamily mailboxes are usually grouped together and in my case five floors below me. Even if I could put a sensor inside the box (which I doubt the USPS would allow), it would need to sense the door opening and send a signal. Perhaps a light sensor might work if the box is opaque (mine is) and it were battery powered and small and could be put on the box door (or made to look like a piece of unretrieved mail).

Status Update July 2023.

I have been using my Mailbox Alert® for about five months now with very good results.

I estimate that it is 97-99% reliable. On the extremely few occasions where it has not alerted me to the mail delivery I surmise that the Mail Truck is blocking the signal.

I can live with those results…