Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for hass_Bluetooth_Proxy_Companion [was: Orphaned ble scanner?] #193

Open
sdholden28 opened this issue May 14, 2024 · 5 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@sdholden28
Copy link

Version of the custom_component

v0.6.5

Describe the bug

I'm seeing errors in the logs that I believe are related to a BLE proxy that I removed from Home Assistant, but apparently Bermuda is still looking for it? If I am correct, I'm unsure how to remove it. I can't find any related devices/entities in HA.

Debug log

This error originated from a custom integration.

Logger: custom_components.bermuda
Source: custom_components/bermuda/init.py:169
integration: Bermuda BLE Trilateration (documentation, issues)
First occurred: 6:25:48 PM (390 occurrences)
Last logged: 8:51:04 PM

Failed to find config for scanner b84a63eaf58f89218e88c58c06b3dafd, this is probably a bug. (40680 previous messages suppressed)
Failed to find config for scanner b84a63eaf58f89218e88c58c06b3dafd, this is probably a bug. (41276 previous messages suppressed)
Failed to find config for scanner b84a63eaf58f89218e88c58c06b3dafd, this is probably a bug. (40742 previous messages suppressed)
Failed to find config for scanner b84a63eaf58f89218e88c58c06b3dafd, this is probably a bug. (41172 previous messages suppressed)
Failed to find config for scanner b84a63eaf58f89218e88c58c06b3dafd, this is probably a bug. (8038 previous messages suppressed)

@agittins
Copy link
Owner

Curious!

The value b84a63eaf58f89218e88c58c06b3dafd is coming from BaseHaScanner's source attribute, and we expect it to be a BLE MAC address, but this looks like a UUID, like those used for config entry IDs etc.

I haven't been able to replicate this on my test setup, which is annoying! :)

Can you post your dump_devices service output? You can limit it to just one device using the addresses parameter, I'm mainly interested in what shows up in the scanners block of a device.

@agittins agittins self-assigned this May 17, 2024
@agittins
Copy link
Owner

Something else that might help is if you can Enable Debug Logging in the Bermuda integration page, reload the integration, then Disable Debug Logging and send me the file it downloads to you. This might give me some logging messages about why it's trying to necro a non-existent proxy.

You can email to me ash@ajg.net.au if you would rather not upload it here.

@sdholden28
Copy link
Author

Ok, new information, or newly remembered old information actually. I setup this less than alpha integration a while back. https://github.com/kvj/hass_Bluetooth_Proxy_Companion. The goal or purpose of that integration is to turn fixed android devices with Bluetooth scanning capability into Bluetooth proxies, like wall mounted tablets. This is a really great idea actually, especially for me with 4 already mounted Samsung tablets in my home. It uses the tablets Bluetooth connection and makes calls to HA via a webhook. The scanner ID bermuda was picking up was from the one tablet I set the integration up on. Home assistant was storing information from that tablet received via webhook in bluetooth.remote_scanners, for whatever that's worth. I can send that config file if it was interesting to you. I don't know if that integration is going anywhere, but in its current state, bermuda did not pick up and use the information for another scanner, for whatever reason. If something like that was working, it could potentially be an easy way for some people to add ble proxy functionality to existing devices, but its easy enough to install a shelly device or whatever, so I don't think people who didn't already have tablets would be too excited about it. All that to say, not sure if its worth further exploration or not.

@agittins
Copy link
Owner

Ahh, now that's interesting!

I do a relatively unsophisticated trawl through config entries to find scanners, just looking to see if they enter themselves as having a MAC address we recognise from advertisements. Due to that I suspect the integration you used was found, but Bermuda grabbed the config entry_id or something like that instead of its mac address, and maybe that's why it's making bad decisions trying to find it (and maybe why it didn't work for you out of the box).

I might try it out if I get a moment, as it would be good to support if it works more-or-less the same way as other proxies - especially once I get the options in to choose which proxies to use for location.

@agittins agittins changed the title Orphaned ble scanner? Support for hass_Bluetooth_Proxy_Companion [was: Orphaned ble scanner?] Jul 3, 2024
@agittins agittins added the enhancement New feature or request label Jul 3, 2024
@agittins
Copy link
Owner

agittins commented Jul 3, 2024

The companion app sends BLE adverts via a webhook to:
https://github.com/kvj/hass_Bluetooth_Proxy
which registers as a bluetooth scanner in HA.

Adding support for this probably requires just being less naive about how Bermuda looks for scanners, and to use the APIs rather than blindly trawling through config entries looking for mac addresses, on the assumption of them being esphome or local BT adaptors.

Note: will need to add docs on how this works and how to diagnose faults, since peeps will have trouble seeing where in the process things are or are not working, and the project is in its early stages of development / experimentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants