Track bluetooth devices by Area (Room) in HomeAssistant, using ESPHome bluetooth_proxy devices.
(eventually) Triangulate device positions! Like, on a map. Maybe.
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.
device_tracker
entities for chosen devices, which can be linked to "Person"s for Home/Not Home trackingbermuda.dump_devices
service.One or more devices providing bluetooth proxy information to HA using esphome's bluetooth_proxy
component.
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.
Some bluetooth BLE devices you want to track. Smart watches, beacon tiles, thermometers etc
See The Wiki for more info on how it works and how to configure Bermuda for your home.
After installing, the integration should be visible in Settings, Devices & Services
Press the CONFIGURE
button to see the configuration dialog. At the bottom is a field
where you can enter/list any bluetooth devices the system can see. Choosing devices
will add them to the configured devices list and creating sensor entities for them. See How Do The Settings Work? for more info.
Choosing the device screen shows the current sensors and other info. Note that there are extra sensors in the "not shown" section that are disabled by default (the screenshot shows several of these enabled already). You can edit the properties of these to enable them for more detailed data on your device locations. This is primarily intended for troubleshooting or development, though.
The sensor information also includes attributes area name and id, relevant MAC addresses etc.
In Settings, People, you can define any Bermuda device to track home/away status for any person/user.
See The FAQ in the Wiki!
Wanna improve this? Awesome! Bear in mind this is my first ever HA
integration, and I'm much more greybeard sysadmin than programmer, so ifwhere
I'm doing stupid things I really would welcome some improvements!
You can start by using the service bermuda.dump_devices
to examine the
internal state.
bermuda.dump_devices
serviceJust calling the service bermuda.dump_devices
will give you a full dump of the internal
data structures that bermuda uses to track and calculate its state. This can be helpful
for working out what's going on and troubleshooting, or to use if you have a very custom
need that you can solve with template sensors etc.
If called with no paramaters, the service will return all data. Paramaters are available
which let you limit or reformat the resulting data to make it easier to work with. In particular
the addresses
paramater is helpful to only return data relevant for one or more MAC addresses
(or iBeacon UUIDs).
See the information on paramaters in the Services
page in home assistant, under Developer Tools
.
Important: If you decide to use the results of this call for your own templates etc, bear in mind that the format might change in any release, and won't necessarily be considered a "breaking change". This is beacuse the structure is used internally, rather than being a published API. That said, efforts will be made to indicate in the release notes if fields in the structure are renamed or moved, but not for adding new items.
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 experiement 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!).
ESPrescence 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 ESPrescense's wheel.
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 agittins/bermuda
into
the Repository
field, and choose Integration
for the Category
. Click Add
.
You should now be able to add the Bermuda BLE Trilateration
integration. Once you have done that,
you need to restart Homeassistant, then in Settings
, Devices & Services
choose Add Integration
and search for Bermuda BLE Trilateration
. It's possible that it will autodetect for you just by
noticing nearby bluetooth devices.
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:
configuration.yaml
).custom_components
directory (folder) there, you need to create it.custom_components
directory (folder) create a new folder called bermuda
.custom_components/bermuda/
directory (folder) in this repository.If you want to contribute to this please read the Contribution guidelines
This project was generated from @oncleben31's Home Assistant Custom Component Cookiecutter template.
Code template was mainly taken from @Ludeeus's integration_blueprint template Cookiecutter User Guide**