Build a few cheap ESP32 Bluetooth proxies to extend Home Assistant's BLE reach, then use an iBeacon tag for rough room-level presence. I have not run this exact build, so test as you go. Concepts are in my Bluetooth overview thread in this forum, and this is a modern alternative to the hand-written daemon approach in the beacon listener thread.
You need: Home Assistant with ESPHome, one ESP32 board per area (check ESPHome's docs for supported variants), and an iBeacon-compatible tag, or a phone beacon simulator app for testing.
Step 1: Flash a proxy
This is based on the "recommended configuration for a WiFi-connected Bluetooth proxy" in the ESPHome docs. Add your own API encryption key if you like.
Code: Select all
substitutions:
name: my-bluetooth-proxy
esphome:
name: ${name}
name_add_mac_suffix: true
esp32:
variant: esp32
framework:
type: esp-idf
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
logger:
api:
ota:
platform: esphome
esp32_ble_tracker:
bluetooth_proxy:
active: trueStep 2: Place the proxies
- One per area where you want coverage, close to the devices you care about.
- Keep them at least 3 metres from routers and switches (EMI hurts reception, per the ESPHome docs).
- Ethernet-based boards perform better than Wi-Fi ones, according to the docs.
Step 3: Add iBeacon Tracker
- Settings > Devices & services > Add Integration > iBeacon Tracker (needs the Bluetooth integration working).
- Set your tag's UUID, major and minor in its own app. The docs suggest one UUID for the house, a major per floor and a minor per room or tag.
- For the distance sensor, calibrate: place the tag 1 metre from the receiver in line of sight, read the signal strength (dBm), and set it in the tag's app.
- HA creates an Estimated Distance sensor. With several scanners, the one with the best signal reports it, so check the source attribute to see which proxy that is.
This is the shape of the example in HA's docs. Entity name and numbers are placeholders.
Code: Select all
alias: "Tag has left"
triggers:
- trigger: state
entity_id: sensor.my_tag_estimated_distance
to: "unavailable"
for:
minutes: 5
actions:
- action: notify.notify
data:
message: "The tag has not been seen for 5 minutes"Phones use randomised addresses, so you would need HA's Private BLE Device with an IRK. Follow HA's docs, and treat the IRK like a password. Don't paste it into a post.
Troubleshooting
- Tag not appearing: iBeacons without stable major/minor values aren't supported by the integration, and beacons that don't broadcast a name aren't added automatically (the docs mention an options list for allowed UUIDs).
- Distance bounces around: the docs say the estimate assumes perfect conditions. Use it as near/far, not as a measurement.
- Proxy overheating or Wi-Fi flaky: keep scan settings at the defaults. The docs say aggressive values cause problems.
Discussion: How many proxies did you need for your house, and how accurate was room-level presence for you?