Skip to content
/ BPS Public

A BLE positioning sytem for Homeassistant providing realtime tracking indoors. Dependent on the Bermuda component built by @agattins.

License

Notifications You must be signed in to change notification settings

Hogster/BPS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notice:

There seem to be an issue with running on arm based hardware (e.g. Raspberry Pi) due to lack of ability to load sciPy which is required. However, work is on-going, stay tune!

BPS Logo

BLE Positioning System (BPS)

A BLE positioning sytem for Homeassistant providing realtime, multi device, floor plan tracking indoors. Dependent on the Bermuda component built by @agattins.

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Follow the discussion on Home Assistan Community

GitHub Release GitHub Activity License

pre-commit

hacs Project Maintenance BuyMeCoffee

Discord Community Forum

What it does:

BLE Positioning System (BPS) continues on the great work by @agittins and his Bermuda. Based on Bermudas ability to, in near-realtime, estimate distance to ESPHome devices running bluetooth_proxy BPS can leverage this information and by trilaterate give a precise position.

Tracking

By exactly placing the location of the bluetooth_proxy devices as well as defining specific zones, BPS can show:

  • Where exactly a device is located on a floorplan (like a GPS on a map)
  • Determine which floor you are currently on. Gives the ability to automate when changing floor.
  • Determine which zone (Kitchen, Bedroom etc.) a device is currently in. Gives the ability to automate based on specific devices entering or leaving a zone.

This is done for all devices you track with Bermuda so you can track different persons or objects and automate based on this.

For my specific purpose I Sonoff NS Panels in all rooms of my house which I run esphome on. This together with other stationary bluetooth proxies I have good coverage to do trilataration.

Bermuda aims to let you track any bluetooth device, and have Homeassistant tell you where in your house that device is. The only extra hardware you need are esp32 devices running esphome that act as bluetooth proxies. Alternatively, Shelly Plus devices can also perform this function.

What you need:

  • Home Assistant up and running (duhh!) duhh
  • Bermuda bermuda installed and tracking at least one bluetooth device
  • At least three devices providing bluetooth proxy information to HA using esphome's bluetooth_proxy component. (it needs data from three devices to be able to track so if you only have three devices and you loose one due to distance it is not able to track)

@agittins writes on the Bermuda readme: " I like the D1-Mini32 boards because they're cheap and easy to deploy. The Shelly Plus bluetooth proxy devices are reported to work well. Only natively-supported bluetooth devices are supported, meaning there's no current or planned support for MQTT devices etc.

  • USB Bluetooth on your HA host is not ideal, since it does not timestamp the advertisement packets. However it can be used for simple "Home/Not Home" tracking, and Area distance support is enabled currently."

    I can from my own experience add NS Panel since I use them all around the house as replacement for wall switches and thus get great coverage.

  • Install BPS via HACS: Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Documentation and help - the Wiki

See The Wiki for more info on how it works and how to configure for your home.

Screenshots

After installing, the integration should be visible in Settings, Devices & Services The integration, in Settings, Devices & Services The integration, in Settings, Devices & Services

The integration has now, if you are tracking devices, created 2 sensors for each device you are tracking. One for tracking device floor and another for tracking device zone Created entities

You will now also have a new panel in the side panel named "BPS"

BPS Panel

The BPS panel for tracking is used for placing receivers (Bluetooth_Proxy devices) and defining zones. The "real-time" tracking is more to get a sense about what i happening and a form of debugging. You will notice where you have good precision as well as worse. And thus can give you an idea where to add devices for improved tracking.

Tracking

TODO / Ideas

  • Improve the GUI (adding circles around the receivers for showing the distance and thus where the intersections are i.e. visualizing the trilataration)
  • Be able to create zones that are not square (not a priority)
  • Improve speed and performance in general
  • Create a lovalace card with a map showing tracked devices
  • And more...

Feed back

To set the stage. I'm not a programmer and not even close to have this as a profession. I'm just a hobyist who love home automation and built this out of the urge to be able track people in realtime. Do you think there is room to improve or in any other way add to the experience. GREAT! Please contribute or let me know.

Again, this work is only possible due to the great work by @agittins and his Bermuda. This is a teamwork, if we can improve Bermuda's abilties (precision & stability) BPS will also greatly benefit.

Prior Art

There are other like Bermuda, bluetooth_tracker, ble_tracker and ESPresense. The bluetooth_tracker and ble_tracker integrations are only built to give a "home/not home" determination, and don't do "Area" based location. (nb: "Zones" are places outside the home, while "Areas" are rooms/areas inside the home). I wanted to be free to experiment with this in ways that might not suit core, but hopefully at least some of this could find a home in the core codebase one day.

The "monitor" script uses standalone Pi's to gather bluetooth data and then pumps it into MQTT. It doesn't use the bluetooth_proxy capabilities which I feel are the future of home bluetooth networking (well, it is for my home, anyway!).

ESPresense looks cool, but I don't want to dedicate my nodes to non-esphome use, and again it doesn't leverage the bluetooth proxy features now in HA. I am probably reinventing a fair amount of ESPresense's wheel.

Installation

Definitely use the HACS interface! Once you have HACS installed, go to Integrations, click the meatballs menu in the top right, and choose Custom Repositories. Paste Hogster/BPS into the Repository field, and choose Integration for the Category. Click Add.

You should now be able to add the BLE Positioning Sytem integration. Once you have done that, you need to restart Homeassistant, then in Settings, Devices & Services choose Add Integration and search for BLE Positioning Sytem or 'BPS'.

Once the integration is added, you need to set up your devices by clicking Configure in Devices and Services, Bermuda BLE Trilateration.

In the Configuration dialog, you can choose which bluetooth devices you would like the integration to track.

The instructions below are the generic notes from the template:

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called BPS.
  4. Download all the files from the custom_components/BPS/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for BLE Positioning Sytem or 'BPS'

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines

Credits

The idea for this project was initiated by the work of @agittins and his Bermuda. With an idea and great help from chatGPT this project came to life.

Say thanks

If you found this helpful and you'd like to say thanks you can do so via buy me a coffee or a beer. I've put a bunch of time into this integration and it always puts a smile on my face when people say thanks!