Overview
A tech-savvy homeowner in Texas was frustrated with high energy bills and manual light switches. His 2,500 sq ft home had 40 light fixtures, but lights were often left on in empty rooms. He decided to build a DIY PIR sensor system using ESPHome and Home Assistant.
The Challenge
The homeowner faced several specific issues:
- Family members frequently left lights on in empty rooms
- No central control for lighting automation
- Commercial smart home systems were expensive
- Privacy concerns with cloud-based systems
- Wanted local control without internet dependency
The Solution
The homeowner built a DIY system using these components:
- Sensors: AM312 PIR sensors (35µA standby, 3.3V compatible)
- Controllers: ESP32 boards running ESPHome
- Hub: Home Assistant on Raspberry Pi 4
- Lights: Existing LED fixtures with smart switches
- Quantity: 12 PIR sensors + 15 smart switches
Total cost: $180 (ESP32 boards $60, sensors $24, smart switches $96).
The system logic:
- Each room had a dedicated PIR sensor connected to an ESP32
- ESPHome reported motion status to Home Assistant via Wi-Fi
- Home Assistant automations turned lights on/off based on occupancy
- Hallways and bathrooms used shorter hold times (2-5 minutes)
- Living areas used longer hold times (15-30 minutes)
- Bedrooms used vacancy mode (manual-on, auto-off)
Implementation
The project was completed over three weekends:
- Weekend 1: Set up Home Assistant on Raspberry Pi, install smart switches (4 rooms)
- Weekend 2: Build ESP32 sensor nodes (6 rooms), test connectivity
- Weekend 3: Create automations, fine-tune hold times, add battery backup
Each sensor node was powered by USB (existing outlets) with a supercapacitor backup.
Results
After 12 months of operation:
| Metric | Before | After | Reduction | Annual lighting energy | Annual HVAC energy | Total energy | Annual cost |
|---|
