Skip to content
Ashley Gittins edited this page Nov 20, 2024 · 8 revisions

Features

Can I track my Phone or Watch?

  • Yes! Both Android and iOS devices (iPhone, iPad) are supported. iWatch and Samsung watches are also reported as working. The key is to configure the built-in Private BLE Device core integration. Once you have a device paired with Private BLE it should automatically appear in Bermuda.
    • Apple devices are usually pretty chatty, so at that point they should be trackable, but sometimes they can go quiet during power saving or other events.
    • For Androids you might need to configure the iBeacon transmitter in the HA Companion app.

What about iBeacons?

Yes! iBeacons are natively supported by Bermuda. You do not need to install the core iBeacon integration.

  • Bermuda's iBeacon support is rather simplistic and opinionated, a bit like the author.
    • To create a sensor for iBeacons, choose them in the Configure dialog where you can pick them from a drop-down, searchable list. iBeacons will appear near the top of the list.
    • After Bermuda creates the device and sensors, rename them to something sensible.
    • Bermuda considers every UUID/Major/Minor version to uniquely identify a given iBeacon. That means the MAC address can change, or you can have multiple beacons transmitting the same uuid/major/minor and they'll all be one single device - but don't do that - the tracking will be all over the place!
    • If your beacon sends multiple uuid's or changes its major or minor version, they will show up as different "devices" that you can create sensors for. This might be good if you have one device that sends multiple IDs for some reason, or terrible if you have a device that tries to pack information into the major or minor fields. The latter device is, IMO, silly.
    • If there are known beacons (in reasonable numbers) that do something I thought was silly, I will consider adding support for them. I'd rather they don't exist though, and I think the iBeacon integration suffers because of its trying to support those cases.

Isn't mmWave better?

  • mmWave is definitely faster, but it will only tell you "someone" has entered a space, while Bermuda can tell you who (or what) is in a space. So it depends on your particular use-case (and budget) as to which will be better suited.

What about PIR / Infrared?

  • PIR is also likely faster than bluetooth, but again it only tells you that someone / something is present, but doesn't tell you who/what. For things like lights, PIR is usually a better choice, but having both is totally awesome, because the PIR gives you reliability, while Bermuda gives you persistence of not turning off while you're vegging out on the couch, plus there are times that Bermuda will spot you coming before the PIR does, which feels kinda like magic when it happens.

So how does that help?

  • If the home knows who is in a given room, it can set the thermostat to their personal preferences, or perhaps their lighting settings. This might be particularly useful for testing automations on yourself before unleashing them on to your housemates, so they don't get annoyed while you iron out the bugs :-)

  • If you have BLE tags on your pets you can have automations specifically for them, and/or you can exclude certain automations, for example don't trigger a light from an IR sensor if it knows it's just your cat, say.

How quickly does it react?

  • It can react in less than 2 seconds. There are three main factors.
    • How often your beacon transmits advertisements. Many are between 5 times a second and 2 seconds.
    • Bermuda only checks for new advertisements every second. It will update sensors immediately if devices get "closer", but it is more leisurely for devices that appear to be "leaving" an area.
    • The proxies might not catch every advertisement. In my esphome proxies I usually use these settings to ensure we don't miss toooo many:
      esp32_ble_tracker:
        interval: 320ms # default 320ms. Time spent per adv channel
        window: 290ms # default 30ms. Time spent listening during interval.
      This makes sure the device is spending the majority of its time listening for bluetooth advertisements, while ensuring it stops often enough to service the wifi requirements frequently.
  • So if your beacon transmits every second, it might take up to two seconds for Bermuda to come up with a new distance measurement, assuming no packets were lost. Which happens a lot.
  • Due to the noise inherent in RSSI measurements, we do a lot of filtering on the values. The upshot of this is that measurements that read "closer" come through a lot faster because they're more reliable / more likely to be accurate, while readings of an increasing distance will be tracked a lot slower because most of them are signals that were weakened by noise, reflections, dog bodies etc. So asserting that something is in an area is authoritative and quick, while asserting that something is leaving or not in an area carries less confidence and higher latency.

What's going on inside?

How is the distance calculated?

  • Currently, we use the relatively simple equation: distance = 10 ** ((ref_power - rssi) / (10 * attenuation))

    • ref_power is the rssi value you get when the device is 1 metre from the receiver. You can configure this as a global setting in the options, plus (or minus!) an offset per scanner, as well as an override value per device.
    • rssi is the "received signal strength indicator", being a measurement of RF power expressed in dBm. RSSI will usually range from -30 or so "down" to -100 or more. Numbers closer to zero are "stronger" or closer.
    • attenuation is a "constant" for the losses in the environment (humidity, air pressure(!), mammals etc). To be honest though, it's a bit of a "fudge factor". This is also set in the global options. Typical values are between 1 and 3 but can vary. Finding this value is part of the calibration/setup process.
    • distance is the resulting distance in metres.
  • The default values won't be suitable for all use-cases, but they will work. Apart from the environmental factors that we can't calculate (like walls, reflective surfaces etc), each device might transmit a different power level, and every transmitter and receiver might have antennae that perform differently.

  • See the Calibration Guide for instructions on calibration.

Configuration

How do the settings work?

See Settings for the explanation of each setting in detail.

How do I choose values for Attenuation and Ref_Power (calibration)?

  • Soon you'll be able to set this per-device to account for variations in circuits, antennas and cases, but currently there are only the global defaults to fiddle with. Check out the Calibration Guide for instructions.

How can I automate on an area being occupied or empty?

Bermuda doesn't support this natively as there's no clean way to do it, but the short answer is to use Labels on your tracked devices, and templates to count how many devices with that label are in that area. See https://github.com/agittins/bermuda/issues/203 for an example and discussion.

Another option may be magic_areas as there is a rumour that support might be forthcoming (to be confirmed!)