ESP32 BLE beacons for room presence tracking in Home Assistant provide the most accurate and privacy-preserving indoor location system available for Indian home automation. By placing small ESP32 beacons (or using phones/smartwatches as beacons) and fixed BLE scanners (ESPHome Bluetooth proxies) in each room, Home Assistant knows which room each family member is in – enabling truly intelligent automations like auto-adjusting the AC temperature as you move from bedroom to living room.
Table of Contents
- How BLE Beacon Room Tracking Works
- Hardware: ESP32 Beacons and Bluetooth Proxies
- Setting Up ESPHome Bluetooth Proxy
- ESP32 as iBeacon Firmware
- Bermuda Integration for Room-Level Tracking
- Room Presence Automations for Indian Homes
- Using Smartwatch/Phone as Beacon (No Extra Hardware)
- Frequently Asked Questions
How BLE Beacon Room Tracking Works
The system uses three components:
- Beacon: A small BLE device (ESP32, coin-cell badge, or your phone/smartwatch) that broadcasts a unique BLE advertisement packet every 100-500ms
- Proxy scanners: ESP32 devices with ESPHome Bluetooth proxy firmware, one per room, that receive the beacon signal and report RSSI (signal strength) to Home Assistant
- Bermuda integration (HA): Calculates which scanner is closest to each beacon using RSSI, thereby determining room location
Accuracy in typical Indian homes: ~1-3 metres. Enough to distinguish bedroom, living room, kitchen, and bathroom reliably. Not precise enough for corner-vs-centre-of-room detection.
Recommended: UNO WiFi R3 (ATmega328P + ESP8266)
The UNO WiFi R3 with ESP8266 acts as a WiFi reporting node for your BLE presence tracking network. It bridges MQTT presence data to Home Assistant and can simultaneously drive relay outputs based on detected room occupancy.
Hardware: ESP32 Beacons and Bluetooth Proxies
Recommended hardware (India prices 2025):
| Role | Device | India Price | Notes |
|---|---|---|---|
| Beacon (wearable) | ESP32-C3 mini dev board | Rs 250-350 | CR2032 battery lasts 6-12 months |
| Beacon (wearable) | nRF51822 BLE module | Rs 200 | Ultra-low power, 3.3V coin cell powered |
| Proxy scanner | ESP32 DevKit V1 | Rs 350-400 | One per room, USB powered |
| Beacon (zero cost) | Phone (Android/iOS) | Rs 0 | Uses Bluetooth advertisement in HA app |
| Beacon (zero cost) | Fitbit/Mi Band/Samsung Watch | Rs 0 | Passive BLE advertisement tracked by proxies |
For a 2BHK Indian flat, you need 4-5 proxy scanners (one per room: bedroom 1, bedroom 2, living room, kitchen, bathroom). Each scanner costs approximately Rs 400, total infrastructure Rs 2,000.
Setting Up ESPHome Bluetooth Proxy
esphome:
name: bedroom-bt-proxy
friendly_name: Bedroom BT Proxy
esp32:
board: esp32dev
framework:
type: esp-idf
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
bluetooth_proxy:
active: true # active proxy can request more device data
api:
encryption:
key: !secret api_key
logger:
ota:
Flash this ESPHome config to one ESP32 per room. In Home Assistant Settings -> Integrations -> Bluetooth, each proxy appears as an additional Bluetooth adapter. HA automatically uses the closest proxy for device tracking.
ESP32 as iBeacon Firmware
#include "BLEDevice.h"
#include "BLEUtils.h"
#include "BLEBeacon.h"
#define BEACON_UUID "12345678-1234-1234-1234-123456789012"
void setup() {
BLEDevice::init("Bedroom-Beacon");
BLEServer* pServer = BLEDevice::createServer();
BLEAdvertising* pAdvertising = BLEDevice::getAdvertising();
BLEBeacon oBeacon;
oBeacon.setManufacturerId(0x4C00); // Apple iBeacon format
oBeacon.setProximityUUID(BLEUUID(BEACON_UUID));
oBeacon.setMajor(1); // Floor number
oBeacon.setMinor(101); // Room number (1=bedroom, 2=living, etc.)
oBeacon.setSignalPower(-59); // Calibrated TX power at 1m
BLEAdvertisementData oAdvertisementData;
oAdvertisementData.setFlags(0x04); // BR_EDR_NOT_SUPPORTED 0x04
oAdvertisementData.setManufacturerData(oBeacon.getData());
pAdvertising->setAdvertisementData(oAdvertisementData);
pAdvertising->setAdvertisementType(ADV_TYPE_NONCONN_IND);
pAdvertising->start();
// Deep sleep between advertisements to save power
esp_deep_sleep(100000); // 100ms on, then sleep
}
void loop() {}
Recommended: Mega WiFi R3 (ATmega2560 + ESP8266)
The Mega WiFi R3 serves as a powerful automation execution node. When BLE presence tracking identifies which room you are in, this board drives the appropriate relay outputs for that room’s lights, fan, and AC based on your presence.
Bermuda Integration for Room-Level Tracking
Install the Bermuda integration from HACS (Home Assistant Community Store):
- In HA: HACS -> Integrations -> Search “Bermuda BLE Trilateration” -> Install
- Settings -> Integrations -> Add Integration -> Bermuda
- In Bermuda configuration, assign each BT proxy to a room:
bedroom-bt-proxy -> Bedroom 1,living-bt-proxy -> Living Room - Bermuda creates a
device_trackerentity for each tracked beacon, showing which room it is in
Bermuda uses a combination of signal strength averaging, Kalman filtering, and room boundary logic to determine location. It handles the case where a person sitting near a room boundary shows up in the adjacent room by applying a configurable hysteresis (default: beacon must be 3dB closer to new room for 30 seconds before switching).
Room Presence Automations for Indian Homes
With room-level tracking, write HA automations that follow each family member:
# Automation: AC follows person
id: ac_follows_person
alias: AC adjusts when person changes room
trigger:
- platform: state
entity_id: device_tracker.ravi_beacon
action:
- choose:
- conditions:
- condition: state
entity_id: device_tracker.ravi_beacon
state: bedroom
sequence:
- service: climate.set_temperature
target:
entity_id: climate.bedroom_ac
data:
temperature: 24
- service: climate.turn_off
target:
entity_id: climate.living_room_ac
- conditions:
- condition: state
entity_id: device_tracker.ravi_beacon
state: living_room
sequence:
- service: climate.set_temperature
target:
entity_id: climate.living_room_ac
data:
temperature: 25
- service: climate.turn_off
target:
entity_id: climate.bedroom_ac
Using Smartwatch/Phone as Beacon (No Extra Hardware)
You can use existing devices as beacons without any additional hardware:
- iPhone/Android with Home Assistant app: Enable Bluetooth in HA Companion app settings. Your phone broadcasts BLE advertisements tracked by ESPHome proxies. Works with iPhone 12+ and most Android 10+ phones.
- Mi Band 4/5/6 (popular in India, Rs 1,500-2,500): Broadcasts BLE advertisements passively. Add its MAC address to Bermuda’s tracked devices. No app needed.
- Noise, boAt, and Realme smartbands: Most Indian budget smartbands broadcast passive BLE – check with a BLE scanner app (nRF Connect) to verify your specific model is advertising.
- Titan, Noise Colorfit (smartwatch): Most actively advertise BLE – add to Bermuda’s device list after finding the MAC address in nRF Connect app.
Recommended: 12V 1-Channel Relay Module (RS485/Modbus)
Combine BLE room tracking with this relay module to execute physical control actions. When Bermuda detects you enter the study room, this relay can automatically turn on the desk lamp and study fan without any manual switching.
Frequently Asked Questions
- How accurate is room-level BLE tracking in Indian concrete homes?
- Typically 80-90% accurate for room determination in a standard 2BHK or 3BHK. Accuracy drops near room boundaries (2-3m from doorways) and when concrete walls cause multipath reflections. Using 3+ proxies per room improves this significantly through signal triangulation.
- Does BLE beacon tracking drain phone battery?
- The HA Companion app’s BLE advertising uses approximately 3-5% extra battery per day. Using a dedicated ESP32 beacon (CR2032 coin cell) avoids any phone battery impact while providing 6-12 months of battery life.
- How do I prevent the system from losing track when I go to sleep?
- When you put your phone face-down or plug it in, BLE advertisements continue. However, if your phone’s Bluetooth is turned off (common practice in some Indian households to save battery), tracking stops. Use a dedicated wearable beacon (nRF51822 module in a small printed case) for always-on tracking.
- Can I track multiple family members simultaneously?
- Yes. Each person carries a unique beacon (different UUID, or different phone). Bermuda creates separate device_tracker entities for each beacon. A 4-person Indian family would have 4 device_tracker entities, each showing which room that person is in.
- What happens when guests visit?
- Untracked devices (guest phones) simply are not tracked by Bermuda. Automation triggers based on tracked family members still work normally. For guest-aware automations, have guests install the HA Companion app temporarily or carry a spare ESP32 beacon programmed as a guest device.
Add comment