Bermuda - Bluetooth/BLE Room Presence and tracking [custom integration]

Awesome, thanks! Is the board_build.flash_mode: dio a hard requirement or does that depend on the individual board?

From the 2 variants of the S3 I’ve tried, they are required to boot properly after flashing with a cable. Otherwise, they just boot loop.

Good to know, thank you!

I created a SQL integration with the following query to help with bouncing between areas. This query looks back for 1 minute and returns the area that had the most time in. Let me know if anyone tries it and finds any problems with it:

4 Likes

Excuse my ignorance of this type of coding but does this provide an additional entity or is it a new way to generate the Area entity value?

Hi Ashley,

A quick test shows that it is fixed in 0.7.2. Keep you posted otherwise.
Also thank you for this great component, appreciate all the efforts.

1 Like

@Stephenn You go to add integration > SQL > paste the query (modify the sensor id) and specify “state” for the column field. This will give you a new entity which has the debounced value. If you want it to debounce more/less than 60 seconds just change the two places where it says 60 in the query to the desired number of seconds.

Hi,

Not sure what I’m doing wrong as this is my first time using Bermuda. I’m on 0.7.2 and have one proxy set up. I’m tracking a watch and have set global area radius to 20m. But whenever my device is in the area (distance less than 20m), area doesn’t get updated. In fact it’s always at “Unknown”.

Howdy - a couple of things…

  • The max radius is not a great “lever to pull” for getting started, and the default might be a lot lower than I (now) think it should be. I’d put it up to 100m or something, at least while you’re testing and working out what’s going on.

  • If you put the watch right up next to a proxy, does it still show “Unknown”?

  • Which watch is it? A lot of the smarter/pricier/recent ones will have a “random mac address” which will change periodically (anywhere from daily down to 15 minutes, perhaps). So the watch might not have the same address now that it had when you first set it up in Bermuda. If that’s the case, Bermuda needs a way to be able to identify the watch after the address of it changes. There are two primary ways to do this:

    • Using the Private BLE Device integration, but you need to be able to find the “IRK” or key for the watch’s address.
    • Having the watch send a known advertisement like iBeacon, and having Bermuda track the iBeacon. For some watches there may be an iBeacon app you can install.

If you can let us know which watch you’re using, and also send a screenshot of your “Select Devices” screen in Bermuda’s configuration, we can take a look from there, and if anyone else has the same watch they might be able to help as well.

Hi Ashley, thank for getting back to me. :slight_smile:

  • I’ve played around with settings. From my understanding max radius setting cuts the device off if it’s beyond the threshold, correct? For example if I set radius to 10m and my device is detected at 20m, it will show as Away? I’m trying to control my living room (that’s where proxy is) area as the bluetooth signal seems to be strong enough to penetrate walls into adjacent rooms.

  • Yes, it shows as unknown, even though the distance is updating live. Home/away status also gets triggered if I get close/far enough from the proxy.

Could this also have something to do with the following log in the HA?

  • Watch is Amazfit GTR3 and I don’t think this is the random mac address issue as I assume distance and home/away state would be having issues as well. Here is the requested screenshot:

The area sensor would show “Unknown”, rather than “Away”, iirc. “Home/Away” is for the device_tracker sensors, while the area sensor will only use area names or the unknown / unavailable values.

Also, yes - if the detected distance is greater than the max_radius value, the area will switch to unknown.

Yes. Step 1 with Bermuda is to ensure your scanner devices have an “area” assigned in their settings - otherwise Bermuda has no way to know what Area to use.

Yep you’re correct, if you’re getting updated distance estimates then the device address stuff is all good.

So the root of your issue is probably that you haven’t assigned an Area to your bluetooth proxy - once you fix that (go to the esphome device, pencil in top-right corner) then you should be up and running, I expect.

Ok, thanks, once we get area working I’ll be good with the area sensor.

I assume scanner device is “Bermuda Global” in Home Assistant? If that’s the case it is set to “Living Room”:

Ahh, to answer my own question (and maybe someone elses at some point), the actual proxy device was “ESPHome Web somethingsometing123”. Once I set it to desired area, it also started updating properly. Thank you for the help. :slight_smile:

1 Like

Anyone have experience with multifloor setups? I’m surprised to find my setup constantly thinks I am in the upstairs even when I am fairly close to the sensor in my first floor. I even tried putting two sensors in my downstairs but it still often thinks I am upstairs. I have calibrated these sensors and they are all the same exact model/maker.

I have two devices per floor (basement, 1st floor, 2nd floor) and it definitely works better than when I just had one. In the devices’ defense, it’s possible that I could be in basement and closer to the device on first floor vertically than the one basement device horizontally.

I am afraid I am not much help other than to say that two per floor has been significantly more accurate than just one per floor. Trying to go by rooms originally was never reliable enough.

Yeah it’s tricky because I have no clue if I am closer to the upstairs beacon horizontally than the one in the same room vertically. I put two sensors in the main floor but somehow the upstairs still picks me up even when using my SQL query above to debounce it!

I’ll try two sensors in the upstairs and see how much that helps.Are you using the HA ibeacon phone app? If so, what settings have you found work best?

Yep, you got it! :slight_smile:

Multifloor is definitely trickier, since the vertical separation is probably less on average than the horizontal separation (floors are often what, 2.2m apart, while bedrooms are often 3m or more, on average? Wide variances, of course).

I note you’ve already done some calibration, you could experiment a bit with the per-scanner offsets even further just to tame down the upstairs proxies if they’re particularly keen to pick up devices from lower floors.

Also experiment with the proxy’s orientation - the antennae on these boards do have a somewhat uneven directional pattern - they’re not bad, but I think they tend to be a bit more sensitive normal to the plane of the pcb, meaning if the board is lying horizontal it might be more sensitive to things above and below it than to things around it horizontally. It might work better by having the board “standing up” - but experimentation is probably the best way to find out.

For typical ESP32 boards I’d suggest having the board vertical, so that the usb connector points down and the antenna is toward the top. Then ideally face the component-side surface toward your area of interest - but this part is less critical, I think. This way you will have the least-sensitive direction (that of the usb connector) facing the lower levels, and optimising for receiving signals on the same horizontal plane (ie, the same floor).

Ultimately the floors thing will always be a bit of a tricky thing to solve, and especially difficult with the current naive area detection which just picks the closest scanner. However, when I get trilateration going I’m sure we’ll have a whole new set of problems, but it might make the multi-floor thing slightly easier.

If anyone wants further reading on antennae radiation patterns:

3 Likes

I am having similar issues and did not even think about radiation patterns. I am now going to try this vertical approach to see if this helps with areas upstairs showing up downstairs. Thank you!

1 Like

Thanks to @agittins for the advice on positioning the ESP32 boards. I have them vertical and it seems going through the global options is more stable.

Q: In the global and individual RSSI settings what does 0, 1, 2, 3, 4 reference? Are these just (5) quick pulls of the RSSI strength? Or are these representative of (5) proxies?

The reason for my question is the RSSI values are significantly off from each other. I see the following values which are not even close to other values:

Glad the orientation thing helped!

Yes the 0,1,2 etc represent the 5 most recent readings from the selected proxy / device combination.

The numbers are all over the place because it’s showing you the raw data - as you can see, rssi is a very noisy signal!

You want to look at the shortest distances, as these are the “least noisy” values.

It’s perhaps a bit more complicated than it needs to be, I’ll have a think about some improvements there - maybe I could change it so that when you hit submit it could spend 5 seconds gathering new measurements and report back a single value instead :thinking:

1 Like