LoRa 868 MHz mailbox detection system with Home Assistant integration. Detects mail delivery via a reed switch and reports wirelessly via LoRa to an ESP32-C3 receiver running MQTT.
The receiver also handles plant sensor packets from a separate PlantSensor node.
[ATtiny85 + LoRa] ---868MHz---> [ESP32-C3 + LoRa] ---MQTT---> [Home Assistant]
Mailbox transmitter Combined receiver
(reed switch, battery) (WiFi, MQTT, NTP)
- Reed switch triggers mail detection event
- LoRa packet types: S (startup), M (mail), H (health/hourly heartbeat)
- ACK protocol with 3 retries for reliability
- Sequence number deduplication
- VCC battery monitoring via ATtiny internal reference
- EEPROM persistence for sequence counter and event count
- ISO-8601 last delivery timestamp via NTP
- Full MQTT auto-discovery for Home Assistant
ESP32-C3 with LoRa SX127x. Handles mailbox and plant packets.
| Component | GPIO |
|---|---|
| LoRa SCK | 4 |
| LoRa MISO | 5 |
| LoRa MOSI | 6 |
| LoRa SS | 7 |
| LoRa RST | 2 |
| LoRa DIO0 | 3 |
| LED Blue | 10 |
| LED Green | 9 |
- Copy
Sketches/plant_receiver/secrets.h.exampletosecrets.h - Fill in WiFi and MQTT credentials
- Flash to ESP32-C3
ATtiny85 with soft-SPI LoRa SX127x. Powered by a small LiPo. No WiFi — LoRa only.
| Component | Pin |
|---|---|
| Reed switch | PB5 (INT0) |
| LoRa SCK (soft) | PB3 |
| LoRa MOSI (soft) | PB0 |
| LoRa MISO (soft) | PB1 |
| LoRa SS | PB4 |
| LoRa RST | PB2 |
| Entity | Type | Description |
|---|---|---|
| Mailbox Mail | binary_sensor | ON when mail detected |
| Mailbox Battery | sensor | Battery % |
| Mailbox Battery mV | sensor | Raw battery voltage |
| Mailbox Event Count | sensor | Total mail events |
| Mailbox Last Delivery | sensor | ISO timestamp |
| Mailbox RSSI / SNR | sensor | Link quality |
| Mailbox Reset Mail | button | Clear mail state |
Receiver:
LoRaby Sandeep MistryPubSubClientby Nick O'Leary
Transmitter:
- Custom soft-SPI LoRa driver (included)