feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

Add pairing support to BTProxy

Open dbuezas opened this issue 3 years ago • 7 comments

Describe the problem you have/What new integration you would like

To be able to pair with BLE devices from the BTProxy, even if the pairing pin has to be entered via YAML.

Please describe your use case for this integration and alternatives you've tried:

The Bluetooth EQ3 Thermostats integration require active and paired connections and they stop working as soon as a BTProxy has better RSSI than the local adapter.

Additional context

This is the custom EQ3 Thermostat integration I am using: https://github.com/dbuezas/eq3btsmart The integration in HA's core has been broken for a couple of months so I made this fork that brings back support, adds discovery and config-flows, all missing entities and services to change the internal heating schedules. I intend to publish the new python library and make a PR to the HA core once the incompatibility with BTProxy is solved.

I gave it a shot to implement pairing in esphome but did not succeed. I understand HA doesn't support it yet, but adding pairing pin via yaml would already be super useful in these cases :)

dbuezas avatar Dec 11 '22 18:12 dbuezas

bleak is adding pairing APIs which should make this possible in the future see https://github.com/hbldh/bleak/pull/1100

bdraco avatar Dec 18 '22 17:12 bdraco

bleak is adding pairing APIs which should make this possible in the future see hbldh/bleak#1100

Why do you think that this is going to work with bluetooth_proxy?? I don’t think so as the pairing is done by particular esp32. Furthermore, many devices can be paired only with one master at the same time… You cannot pair with device directly via bleak when you use bt proxy and then connect to it via another proxy or bt adapter because the key exchange is done between the paired devices only…

G-S-E avatar Dec 19 '22 15:12 G-S-E

From the integration perspective, BTProxys don't exist. HA manages the routing so I think he means that once the API is there the ESPHome team will be unblocked from implementing the proxy side. And who knows, maybe the keys can be shared like this

dbuezas avatar Dec 19 '22 16:12 dbuezas

And who knows, maybe the keys can be shared like this

This case is different because in both OS the MAC is the same, so you can share the key. In our case with proxies MACs are different

G-S-E avatar Dec 21 '22 12:12 G-S-E

bleak is adding pairing APIs which should make this possible in the future see hbldh/bleak#1100

Do I understand it correctly that the lack of pairing API in Bleak is the problem? I have already worked with the ESP32 and the NimBLE Arduino Library with the EQ3 thermostats and that worked fine. Maybe an integration in HA/ESPHome via NimBLE-Arduino would be possible?

https://github.com/h2zero/NimBLE-Arduino

EDIT: I quickly checked that the tasmota integration is also using NimBLE.

Eroli avatar Jan 11 '23 08:01 Eroli

https://github.com/esphome/esphome/pull/4258 https://github.com/esphome/esphome-docs/pull/2607

ignisf avatar Jan 21 '23 12:01 ignisf

something new?

milandzuris avatar Oct 16 '25 22:10 milandzuris