The dream of every Home Assistant enthusiast is to use low-cost Bluetooth/BLE-capable ESP32 boards to track presence on a room-by-room basis. Imagine turning a ~US$3 board into a node that tracks your smartwatch's or phone's location within a couple of meters and adjusts the environment accordingly. A new project aims to achieve this goal: ESPresense. But can it fulfil its promise?
Contents
Every Presence Sensor Has Its Issues
Traditional methods of presence detection often have limitations:
- Motion sensors can't detect subtle movements when you're sitting still for long periods. The same goes for microwave presence sensors.
- Door/window sensors rely on remembering which doors to leave open.
- The Grid-EYE (AMG8833) and Omron D6T sensors supported by room-assistant are expensive.
- Using humidity sensors to track bathroom presence introduces delays.
What's New in ESPresense?
In the title, I referred to ESPresense as the successor to ESP32-MQTT-Room. Although ESP32-MQTT-Room is still functional, it hasn't received recent updates, with the last feature update over a year ago.
ESPresense can be seen as the spiritual successor to ESP32-MQTT-Room. It is a fork/rewrite of it, introducing several new features for those using ESP32 boards to track presence:
- Fingerprint Tracking: ESPresense uses fingerprints instead of MAC addresses, allowing it to track devices that randomize their MAC addresses, such as Apple devices.
- Tile Tracker Support: It has built-in support for popular Tile trackers.
- Advanced Filtering: A three-value median filter combined with a Kalman filter processes the RSSI (Received Signal Strength Indicator).
- Multithreading and Constant BLE Scanning: ESPresense is fully multithreaded and constantly scans for BLE devices.
- AppDaemon Integration: An AppDaemon app processes MQTT topics into IPS (Indoor Positioning System) topics, providing x, y, z coordinates and latitude, longitude, elevation data.
- OTA Auto-Updates: ESPresense supports OTA updates, eliminating the need to manually update each node.
Getting Started with ESPresense
To track presence on a room level with ESPresense, you'll need two components: a sender/beacon and a receiver. The receiver will always be an ESP32 board, which you can purchase for ~US$3 from AliExpress.
For a more advanced setup, ESPresense can be installed on M5Sticks, which display nearby devices on their screen and come with built-in cases, eliminating the need for 3D printing.
The sender/beacon is typically a BLE-broadcasting device. Your iOS or Android device will work, but you can also use trackers like Tile or Chipolo. For a cheaper option, BLE trackers from AliExpress are available. Searching for iBeacon or Eddystone will yield many options. Some fitness trackers also function as beacons. The ESPresense website confirms that the Mi Band 2 works, though Garmin watches do not.
Installing ESPresense
ESPresense uses the ESP Web Tools for installation on an ESP32 board. To install the firmware, you need a compatible browser (Chrome) and a USB cable. Connect the ESP32 to your computer, open the installation page, and press the installation button.
Tracking Android and iOS Devices with ESPresense
For Android devices, the easiest tracking method is using the Home Assistant companion app. Enable the BLE transmitter under sensor settings in the app to allow ESPresense tracking. Be aware that this feature consumes battery power. ESPresense tracks iPhones and Apple Watches using their fingerprint.
For detailed configuration, refer to the ESPresense Home Assistant guide. As I currently don't have any spare ESP32 devices, I haven't set it up myself and will defer to the official guide.
Limitations of BLE Tracking with ESPresense
While ESPresense offers many advantages, it also has limitations, many of which are beyond its control:
- Aggressive Background Restrictions: Some Android vendors implement aggressive background restrictions that can stop your smartphone from broadcasting. The worst offenders are Samsung and OnePlus, and as a OnePlus 6 owner, I can confirm this behaviour.
- BLE Broadcasting Limitations: Not all BLE devices broadcast continuously. For example, Garmin sports watches and Fitbit trackers, which would be ideal for presence detection, do not allow continuous broadcasting.
Summary
ESPresense brings a new level of sophistication to room-level presence detection using ESP32 boards. With features like fingerprint tracking, support for Tile trackers, advanced filtering, multithreading, and OTA updates, it significantly improves upon its predecessors. While it has some limitations, particularly related to device-specific restrictions, it represents a promising solution for Home Assistant users seeking precise and reliable presence detection.
For a deeper dive into setup and configuration, visit the ESPresense website, and start transforming your home automation experience today.
hi, thanks for sharing your insights. Just to let you know i can use my garmin FR935 with ESP32-mqtt-room. In order for it to work I’ve configured a bixby routine on my phone to turn off BT while home. Not ideal but no big deal not having BT while home.
That’s actually quite an interesting solution. Turns out Bixby is good for something 😃 (I’ve never actually used it). I guess the same is doable with Tasker. Unfortunately, this wouldn’t work for me, as the watch is my notification machine and I always have the phone on silent.