Solar-powered LoRa door sensor system with Home Assistant integration for long-range, off-grid monitoring
I built this system to monitor two doors on an outbuilding that is too far for WiFi and has no power.
This project uses LoRa for long-range communication and a solar-powered transmitter to send door states back to my house, where a receiver integrates with Home Assistant.
- Long-range LoRa communication (no WiFi required)
- Solar-powered transmitter (fully off-grid)
- Two door sensors (Garage Door and Service Door)
- Reliable state tracking with heartbeat system
- Home Assistant integration via ESPHome
- Local display on receiver (door status + signal strength)
- Transmitter reads reed switches on each door
- Sends updates on change + periodic heartbeat
- Receiver listens and forwards data to Home Assistant
- Home Assistant displays real-time door states
- TTGO LoRa32 ESP32 boards (915 MHz)
- Reed switches (2x)
- Solar panel
- Battery (LiPo or 18650)
- Charging module
- Enclosure (3D printed)
- transmitter/ (outbuilding unit)
- receiver/ (home unit)
- esphome/ (Home Assistant config)
Working reliably with consistent long-range performance.
Build the system with:
- 1 transmitter node in the outbuilding
- 1 receiver node in the house
- 2 reed switches for the doors
- solar power for the transmitter
See PARTS.md for the parts list.
Upload the transmitter code from:
transmitter/main.ino
This board reads the reed switches and sends LoRa packets.
Upload the receiver code from:
receiver/main.ino
This board receives LoRa packets and works with the ESPHome configuration.
Use this file in ESPHome:
esphome/receiver.yaml
Also make sure the custom header file is included:
receiver/lora_receiver.h
Before using:
- update WiFi credentials in the ESPHome YAML
- confirm your board version matches
- confirm your pin assignments match your hardware
- confirm your LoRa frequency matches your region
This project was built around my own hardware and setup, so you may need to adjust power wiring, pin assignments, and enclosure choices for your own build.
-
Battery level reporting
-
Improved enclosure design
-
Lower power optimization
- TTGO LoRa32 board in the outbuilding
- Reed switch 1 = Garage Door
- Reed switch 2 = Service Door
- Powered by battery and solar charging circuit
- TTGO LoRa32 board in the house
- OLED display connected by I2C
- Powered by USB
- Connected to Home Assistant through ESPHome
Pin assignments in this project are based on my specific build. Check the code and confirm all wiring matches your board before powering anything on.



