The ESP32 is one of the most versatile microcontrollers out there, capable of Wi-Fi connectivity and, in the case of the original ESP32, full-on Bluetooth, too. However, nearly every ESP32 device can at least do Bluetooth Low Energy, allowing them to capture data from a wide range of smart devices. However, with a custom Home Assistant integration and ESPHome, we can turn a few ESP32s into a way to track the presence of devices, like Apple's "Find My" network, but built for your home, instead.

To make it all possible, we'll be using the Bermuda integration, found on the Home Assistant Community Store, also known as HACS. With our ESP32 devices set up as Bluetooth proxies for Home Assistant, we can set the location of our ESP32s, then track individual devices in Bermuda. From there, we can identify where a device is in our home, and with enough information (and coverage), you'll always be able to see a rough location of where a device is at any given time.

Note that not every ESP32 is supported, so I recommend reading the wiki for Bermuda to ensure that yours is supported first. Some, like the ESP32-C3, require a custom configuration, too.

Setting up Bermuda

Bermuda is a pretty powerful integration and has a number of powerful features to make it perfect for tracking devices. Very simply, it can read from any device in Home Assistant registered as a Bluetooth scanner, which means not only can an ESP32 work, but so can the on-board Bluetooth of the hardware running your Home Assistant, assuming that it exists.

From there, it can be set to track specific devices, and it enumerates a list of all of the Bluetooth devices that have been spotted by each and every ESP32. Using the Received Signal Strength Indicator (RSSI), it can then guess the distance that the device is from the ESP32 that picked up the signal. It's not perfect by any stretch, but it means you can track devices on a per-room level using a network to do so.

Of course, given that accuracy is merely a guess on the strength of the signal, how do you account for interference? Bermuda has a clever way around this, too; you can adjust the calibration of the RSSI value so that it more accurately represents the distance from it. It'll never be perfect, but you can get it within a meter or two pretty consistently. The Bermuda wiki has a lot of information regarding calibration and testing, and it's something that you'll need to play with to get right if the accuracy matters to you.

As for adding devices with a randomized Bluetooth MAC address, you have two options. The first is to capture the Identity Resolving Key (IRK) using a tool like Wireshark, as this key is where those randomized MAC addresses are derived from. Then, you can pair a "Private BLE Device" in Home Assistant using this key. Otherwise, a simpler option is to create an iBeacon and track that value, though these are only available on Android.

There's one other trick as well that I've seen others recommend, even if the developer of Bermuda recommends against it. Bermuda considers every UUID/Major/Minor version to uniquely identify a given iBeacon, so if a beacon sends multiple UUIDs or changes its major or minor version, Bermuda will identify it as a separate device. Devices that keep things similar will be lumped into one, though, so they can theoretically be trackable. It's not worth it, though.

Instead, you're better off installing something like FryeFryeFrye firmware to capture the IRK and emit it over serial to your PC by pairing your device with an ESP32 running it. This means no root access is needed, there's no dealing with Wireshark, and you'll get reliable identification of your devices. Finally, you can also use ESPresence or, potentially even a MacBook, to pull those keys.

Bermuda offers no-fuss tracking at home

Never lose a device again

If you're the kind of person who frequently misplaces devices, Bermuda can be a great tool to help tackle that problem. I know I'm guilty of leaving my phone down somewhere and not remembering where, and the previous tracking tool I built with ESPHome and a basic Bluetooth scanner has already helped me realize I left my phone in my room, once. This is a more granular level of control, and when you calibrate your ESP32s just right, you can even get a feel for where in the room the device might be.

Honestly, this tool is one of the best and simplest ones in the entire Home Assistant repertoire. It's easy to use to configure, and all you need are some ESP32s to make it work. I have one Bluetooth scanner in the mini PC running Home Assistant, and multiple ESP32s dotted around the apartment, scanning away and tracking my phone's movements.

With this, I'll never struggle to find my phone again, nor any of the other devices I can add to it, too. It's something you can set up in an afternoon in under an hour, so if you have the spare hardware, I highly recommend it.