Private BLE Device for use with Bermuda BLE Trilateration (and others I guess)

So I decided to get started with Bermuda BLE to track devices around the house, mainly to control the main door automations to only trigger when presence is from people that don’t live here. At the moment we only have Android phones with bluetooth, but rarely do any of us leave the house or come back to the house without them.

That said the process is not as straight forward as it might seem, and I haven’t found good documentation where it puts everything together. Hopefully I can get some help on setting everything up correctly via this post, and in the future others can take advantage of what has been put together on this post. The main Bermuda BLE Trilateration has over 300 posts, which makes it very hard to find info we might be looking for.

So first the easy parts. Installing the HACS integration of Bermuda is pretty straight forward, and there is good documentation out there on how to do it. Once installed you should see something like this on your devices and services page

Once you click on Bermuda you will see this:

ADD DEVICE you will never use, since you can only run Bermuda once. The 3 dots are the regular 3 dots with options to change name, reload, etc. That leaves us with “configure”

First option is the Global Options. I haven’t played with it yet, but basically different variables that allows you to configure how the Bermuda integration processes the info. It does explain a bit what each option does.

The second option is to Select Devices, and that is where it gets totally confusing. But before we get into selecting devices, lets talk about the ESP BLE Proxies. They are actually extremely easy to install thanks to the ESPHome Ready made projects Ready-Made Projects — ESPHome

Again I won’t go into details on how to set it up and add it to your ESPHome dashboard in HA. There is plenty of good documentation for that out there. The install you get is with “vanilla” settings. It should work with Bermuda just as is, but if you want to tweak it a bit, you can add some code to the yaml file.

I will explain how to do that.

The code you would add then install is:

esp32_ble_tracker:
  scan_parameters:
    window: 900ms
    interval: 1000ms

The parameters are somewhat self explanatory but basically “window” is how long the actual proxy listens for a signal, and interval is how long it stops listening. The guy that actually created this integration says he suggests 320 for Window and 290 for interval, or around that range.

Now where to add the code. Well assuming you adopted the Proxy to your EPSHome, you would go to ESPHome which should look something like this

From there you click on “edit” of the Proxy you want to add the code to, it would look something like this:

It doesn’t really matter where you put the code, but indentation/spacing is VERY important. I could have put the code under the “wifi” section, or above the “api” section. It doesn’t matter. Once the code is there, you hit save and then install.

As an aside if you notice at the bottom of my code I added:

switch:
  - platform: restart
    name: Proxy Restart

That creates a switch on the proxy which allows me to restart the proxy. Some of my proxies have LD2410s mmWave sensors connected via bluetooth, and when they go offline often rebooting the proxy fixes the issue.

On the devices and services page under the ESPHome tab you can see a list of your proxies, this is what one of mine looks like:

So if you followed so far we have the Bermuda integration installed, and we have a few proxies setup. The more proxies you are able to set up the more mileage you should get out of Bermuda. I have 4 set up, but plan to add another 3 or 4 in the near future. Now how to “select” devices in Bermuda.

This brings us to the topic of this post. “Private BLE Device for use with Bermuda BLE Trilateration”. From what I understand there are couple different ways to track a device for Bermuda to do its thing, but Private BLE is the preferred method.

There isn’t much info on how to set up the Private BLE integration. I went to the official HA Private BLE page Private BLE Device - Home Assistant and this is what they say

When you follow those instructions you will see something like this

But you probably have no idea what an IRK is or how to get it. Oddly enough if you X out of that menu since you don’t have your IRK when you go back to devices and services you won’t see the integration. You have to click on “add integration” again.

The official Private BLE device page explains a bit on how to get the IRK for MACOS (apple stuff) but like I mentioned in my household we all have androids.

For non Apple users, they make it seem like ESPresence is how we would get the IRK, so basically we would have to set up ESPresence even if we don’t plan to use it. Luckily someone shared this link with me How to get the IRK (Identity Resolving Keys) for iOS, Android etc · agittins/bermuda Wiki · GitHub

From there you pick what works best for you. To me it seems the path of least resistance was the FryeFryeFrye Firmware. I won’t go into details here, but this link has pretty good instructions on how to get it going GUIDE - Getting the IRK for iPhone and Apple Watch without MacOS (Maybe also other devices?)

I did get the FryeFryeFrye setup working for me. I have the 4 proxies and the Bermuda integrated. I am about 90% there, and now I need help to get me all the way there.

1 Like

So I decided to reply to myself to ask my questions on a different post. Once I figure out with your help how to get to 100% I will go back to the original post and update it. That should make an easier reading for those trying in get going with Bermuda.

Yesterday I found a post/page that gave instructions on how to get the UUID from the HomeAssistant companion app. Also tweaked the BLE settings as suggested by the post. With that UUID I think I integrated it to I Beacon, but Bermuda wasn’t working.

Today once I got the FryeFryeFrye working and got my IRK I used Private BLE integration, put in my IRK and Bermuda started to do its magic! This is what it looks like for me:

If you notice under Diagnostics I have two listings, a Private BLE Device and a Bermuda tracker.

When I click on Private BLE and open settings/options I see this :slight_smile:

When I open the Bermuda Tracker options I see this:

It seems the Bermuda Tracker is pulling from the I beacon integration, and it realized it is the same device. Oddly enough yesterday I tried to delete the I beacon device tracker I created assuming I did it wrong (since it wan’t working), but even though it gives me option to delete, when I click delete it doesn’t go away.

I am able to walk around my house with my phone and the area changes accordingly. It does go to “unknown” now and then, but think that is part of the fine tuning/calibration. Not too worried about that at the moment.

According to @agittins the person who created Bermuda, we don’t need to use the I-beacon at all. So I picked up an old spare phone I have that doesn’t have the HA companion installed. Paired it up via bluetooth with the FryeFryeFrye and got my IRK. However when I went to Private BLE to add this new IRK i got this error:

Any ideas of what I should do next? Do the phones have to have the HA companion app installed so the Private BLE can see the IRK?

So I went ahead and installed the HA app on my phone. Enabled BLE transmitter, changed the other settings as suggested (Advertised mode to balanced and transmitter power to low). Then went back to Private BLE, put in my IRK code, and it worked!! This is what the screen looks like:

As you can see, again it created two trackers, a Bermuda tracker (device_tracker.d43aec2c0d574bc…00_40004_bermuda_tracker) and a Private BLE tracker (device_tracker.private_ble_device_a42xxx)

On the official Bermuda thread, @agittins mentioned regarding my trackers:

"So that page is all “one device”, but the entities come from two integrations. Yes, the one named Bermuda (and Area, Distance) are all from Bermuda.

The 7ac… one and the “Estimated distance” are from Private BLE Device.

That name, 7ac… looks to be the iBeacon uuid. Did you add the iBeacon tracker in Bermuda config’s “add devices”, or did it just show up like that? I’d recommend that if you have IRK set up, don’t add the device manually to Bermuda, just let Bermuda pick it up from Private BLE’s config.

It’s safe to go into Bermuda’s config and remove it now, and you should still see you have one device, and there’s a good chance it won’t show as “away/unknown” on the private ble sensors."

The answer to his questions are YES! I did add the UUID manually to Ibeacon. Not sure how to go to Bermudas config and remove it.

When I go to Ibeacon and select the 7ac this is what I see:

When I click the red Delete it asks me to confirm delete, I confirm, but it still there! Also shows estimated distance 20m

When I go to Bermuda and open up the same device I get this:

My estimated distance in Bermuda always shows zero, so it seems it is not pulling the info from the Ibeacon tracker.

^ No. Private BLE tracker (Device) phones don’t need to have the HA companion app installed…
Well not as far as I know anyway…
I have a Private BLE tracker device - an apple watch and that “doesn’t need the HA app”
Cheers

Thanks. Without the companion app I couldn’t get it to work. Even turned bluetooth on and off a couple of times, was standing about 1 meter away from the closest proxy, and nada. Once I installed the HA and tried again it worked immediately.

I am guessing that the HA app is not necessary, but what the HA app is doing is forcing the BLE transmission.

A few minutes later… So I uninstalled the HA app from my spare phone, and as soon as I did Bermuda stopped tracking that phone. Gave it about 3 minutes making sure the phone was on.

Do you have Bermuda tracking a phone that doesn’t have HA on it?

No I don’t

Correct. You don’t have to have the HA companion app installed, but the phone does need to be sending something via bluetooth. I’m guessing that the odds of having some app or another that is transmitting bluetooth goes up over time as we install more and more rubbish on our phones! :rofl:

Ahh… that wasn’t what I was referring to, but… you don’t need the iBeacon integration at all, so if you want to get rid of that device, you can remove the iBecaon integration.

You’ll still have the original thing that I thought might have come from tracking the ibeacon packets - if you go into Bermuda, Configure, Configured Devices, do you have selected in there? If so you can delete any that you are already tracking via IRK.

I suspect you don’t though - and that Bermuda has just given it the name from the uuid beacuse it’s trying to give you something other than just a raw address, to help you find/recognose it.

Once you found the sub-pages on the wiki did that answer most of the other questions you had?

So I did get side tracked and haven’t done much with Bermuda BLE. Soon I will come back and edit my new findings on the new post.

However I have ran into a big problem. The only things I am tracking with Bermuda are cell phones, but seems by default when phone screen turns off, they stop transmitting bluetooth. Since most of the time we walk in/out of the house with cell phone screens turned off I am not able to track when the phones are near a particular BT Proxy.

I am guessing if I was to figure out a way to transmit BT even when screen is off it would have a noticeable difference on the amount of battery used correct?

I was afraid of this myself, but using the HA app set to low power mode (which I found adequate for my setup), balanced advertise mode and having it only do so when on home WiFi (which is essentially always in my case), I honestly didn’t even notice a difference on battery drain. I haven’t actually USED Bermuda for anything yet, but I’m sure I’ll eventually come up with a good use-case… Maybe…

That is how I have mine setup as well, via the HA app, low power, transmit only when connected my home WiFis, but shortly after my screen turns off, it stops transmitting. A second or two after I turn screen on bermuda picks it up again.

I am guessing something on my phone is overiding the HA app setup, and forcing it to turn off BT transmit even when HA app is trying to transmit