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

Bluetooth PIN Support #37

Open
3 tasks done
fti7 opened this issue Jan 20, 2025 · 1 comment
Open
3 tasks done

Bluetooth PIN Support #37

fti7 opened this issue Jan 20, 2025 · 1 comment
Labels
blocked External circumstances prevent progress enhancement New feature or request

Comments

@fti7
Copy link

fti7 commented Jan 20, 2025

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

Please consider to add PIN Support for Bluetooth Connections (esphome Proxy Mode)

Connect Device via Bluetooth.
IMPORTANT: PIN is not supported, please remove it first.

Describe the solution you'd like

PIN Form when adding Device

Describe alternatives you've considered

Additional context

@broglep
Copy link
Owner

broglep commented Jan 20, 2025

Out of the box support for bluetooth PIN is currently not really feasible due to limitation of the third party libraries & projects. For reference see:

For proper bluetooth PIN support in this integration, bleak will have to provide an PIN API, and ESP Home bluetooth proxy & its home assistant integration would have to implement it.

But you are not fully out of luck, there are two possible solutions you could explore:

  1. You can try ESPHome with a custom config and hardcode the PIN into the esphome proxy device. Check https://esphome.io/components/ble_client.html#on-passkey-request on how to do this. With this approach the esphome proxy device will provide the PIN and it will be fully transparent to this integration (work same way as device would not have a PIN). I have not yet tested this and I've so far not found any confirmation online that someone has got this working, only found people asking for help to get it working

  2. If you don't have to use ESPHome bluetooth proxy, you could switch to bluetooth dongle and I could build a experimental version of this integration with bluetooth PIN support based on Pairing agent hbldh/bleak#1100. I already did some experiments with this and it was kind of working, but only if you don't have any other pairing agents on your linux system. Whether this will be a viable solution depends on your system you are running home assistant in

In general in my own tests, the whole bluetooth pairing was quite difficult to get working reliably, apart from the rather experimental support from the projects, I also suspect some issues in combination with meshtastic firmware side.
For approach 2 I had occasionally to fully remove all pairings in bluez and then re-pair to get the connection working again.
And it only works for static PINs, dynamic PIN is even further away to be able to be supported

@broglep broglep added enhancement New feature or request blocked External circumstances prevent progress labels Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked External circumstances prevent progress enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants