Raspberry Pi Zero W Smart Mailbox

Mailbox alerts for your smart home.

Mail Fob is an open-source mailbox alerter that lets you know when mail is received. It works with Raspberry Pi Zero W, Home Assistant, MQTT, webhooks, and more.

Open
Source
MQTT
Ready
No Fees
DIY Build
Mail Received

Notification sent through Home Assistant.

Online
Features

More than just a mailbox sensor.

Mail Fob can trigger phone alerts, lights, automations, dashboards, speakers, and custom API actions.

Instant Mail Alerts

Get notified when the mailbox opens, closes, or receives mail.

Home Assistant Support

Use sensors, automations, dashboards, notifications, lights, and speakers.

MQTT Mode

Publish mailbox events to MQTT topics for smart home platforms.

Webhook Mode

Send alerts to Discord, Slack, IFTTT, Node-RED, Zapier, or custom apps.

Pi Zero W Powered

Built around a small, affordable Raspberry Pi with Wi-Fi built in.

Open Source

Customize sensors, notification rules, battery logic, and software.

How It Works

A simple path from mailbox to notification.

Mail Fob detects mailbox activity, sends the event over Wi-Fi, and lets your smart home decide what to do next.

1
Sensor detects mail activity

Use a magnetic reed switch, tilt sensor, vibration sensor, PIR sensor, or distance sensor.

2
Pi Zero W reads the sensor

Python watches the GPIO pin and decides if the mailbox was opened or mail was received.

3
Event is sent

Send the alert through MQTT, webhook, REST API, email, Discord, or Telegram.

4
You get the alert

Your phone, lights, speaker, dashboard, or automation responds instantly.

Works With More

Connect Mail Fob to your favorite tools.

Use Home Assistant first, or connect it directly to other apps and services.

Home Assistant

Automations, dashboards, lights, speakers, and mobile alerts.

MQTT

Publish to topics like mailfob/status.

Discord

Send a message to a Discord channel using webhooks.

Slack

Notify a household, office, or mailroom channel.

Telegram

Send quick bot messages when mail is received.

Email

Send simple SMTP email alerts to any inbox.

Node-RED

Create advanced smart home flows with webhook or MQTT nodes.

Apple Shortcuts

Trigger iPhone automations through webhook services.

Hardware

Use the sensor setup that fits your mailbox.

Mail Fob can work with different sensor types depending on whether you want to detect the door opening, movement, or actual mail inside.

Best for detecting when the mailbox door opens. Simple, cheap, and reliable.

Good for mailboxes where the door or flag changes angle when mail is delivered.

Detects movement or impact when the mailbox is opened or mail drops in.

Can detect if mail is physically sitting inside the mailbox by checking distance changes.
Setup

Build Mail Fob in 5 steps.

This section can become your docs or installation page later.

1
Flash Raspberry Pi OS

Install Raspberry Pi OS Lite and enable Wi-Fi and SSH.

2
Wire the Sensor

Connect the reed switch or sensor to a GPIO pin and ground.

3
Install Mail Fob

Run the Python listener service on the Raspberry Pi Zero W.

4
Connect Integrations

Add MQTT, webhook, Home Assistant, Discord, or email settings.

5
Mount It

Place it in a weatherproof case near or inside your mailbox.

MQTT Example
mailfob:
  mqtt_host: "homeassistant.local"
  mqtt_port: 1883
  mqtt_topic: "mailfob/status"

sensor:
  gpio_pin: 17
  type: "reed_switch"

alerts:
  event_opened: true
  event_received: true
Home Assistant Automation
alias: Mail Fob Alert
trigger:
  - platform: mqtt
    topic: "mailfob/status"
    payload: "received"

action:
  - service: notify.mobile_app_phone
    data:
      title: "Mail Fob"
      message: "Mail has been received."

  - service: light.turn_on
    target:
      entity_id: light.entry_lamp
Open Source

Built for makers, smart homes, and DIY automation.

Mail Fob can be expanded with battery monitoring, solar charging, camera snapshots, mail count detection, mail carrier logs, and dashboard history.

FAQ

Questions about Mail Fob.

Use this section for common setup questions.

No. Home Assistant is recommended, but Mail Fob can also send alerts through MQTT, webhooks, Discord, Slack, Telegram, email, Node-RED, or custom APIs.

Yes, but it depends on the sensor. A reed switch detects opening. A distance sensor, weight sensor, or light sensor can help detect mail sitting inside.

Yes. The same idea can work with Raspberry Pi Zero 2 W, ESP32, ESP8266, Arduino with Wi-Fi, or other small boards.

The electronics need a weatherproof enclosure. Keep the Pi protected from rain, heat, cold, and moisture.

Make your mailbox smart.

Build a Mail Fob device and receive alerts the moment your mail arrives.

Start the Build