Comments (5)
@Jc2k Thank you for all the information. It is now more clear.
I think you can close the ticket.
from aiohomekit.
Its normal for it to be a bit slow to reconnect since it only holds the connection for a few seconds after an operation, but taking a whole minute to reconnect is not normal. At most it should take 15s, at best 1-2s with a high performance adapter https://www.home-assistant.io/integrations/bluetooth/#known-working-high-performance-adapters.
If you enable debug logs for bleak_retry_connector
and aiohomekit
you can see why its taking so long to reconnect.
from aiohomekit.
Hi
In general it's better to raise issues in the HA repo first. In this case the maintainers are the same, but you could easily be pinging strangers about HA misusing their library. Also, HA has a template that prompts you to give us the bare minimum of info about your environment (HA version, how HA is installed, diagnostics report).
If it generally works but is slow we'd usually start by looking at environmental factors.
So as above - What HA? What is it running on? How is it installed?
What is the model of lock?
Have you got any other homekit devices working with HA? One about other Bluetooth ones?
Have you turned on the signal strength sensor, and what is that looking like?
Are you using a Bluetooth dongle? Is it on the list of "high performance" dongles? Are you using HA OS? Is it up to date? Are you using any esphome proxies?
from aiohomekit.
@bdraco @Jc2k Thanks for reply
@bdraco I wasn't clear enough. It takes around 5-10 seconds (not 1 minute), so it seemed to be normal.
Is there a way to send operation to maintain/prepare a connection inadvance? so I can use it before I know there is a high chance I'm going to use the device.
@Jc2k Sorry, next time I will post directly to HA repo
So as above - What HA? What is it running on? How is it installed?
I'm using latest HA 2022.11.5. running on Raspberry Pi 4 64bit model B using latest HA OS 9.3.
What is the model of lock?
Nuki Smart Lock 3.0
Have you got any other homekit devices working with HA? One about other Bluetooth ones?
No
Have you turned on the signal strength sensor, and what is that looking like?
-85dBm
Are you using a Bluetooth dongle? Is it on the list of "high performance" dongles? Are you using HA OS? Is it up to date? Are you using any esphome proxies?
No dongle, I'm using Raspberry Pi 4B hardware.
Raspberry Pi 4B listed as high performance
Using latest HA OS 9.3
No, I'm not using any esphome proxies?
from aiohomekit.
85 is on the weak side. You are likely seeing packet loss, connection failures etc which won't be helping performance.
An external dongle closer to the lock (ideally with an extension to help avoid noise from usb3 etc) and that is from the high performance list might help.
Alternatively you could try using an esphome device as a "Bluetooth proxy" range extender. These are looking like they will be pretty stable for homekit when 2022.12 is out.
2022.12 includes fixes that should make connection setup slightly faster, but this will be dwarfed by connection failure due to a weak signal.
Homekit Bluetooth devices aggressively disconnect to conserve battery, so we can't keep connections up. Also there are limits to how many active connections can be sustained on the host side (5 active connections is considered a good setup). We also go to great lengths to avoid connecting (sensors don't need us to connect and read at all any more). But when we do connect we have to wait for the lock to turn its radio on. This means that the worst case could be always be a little slow.
from aiohomekit.
Related Issues (20)
- Process notifications as disconnected events if we cannot decrypt so we don't get out of sync
- Modify COAP and IP backends to send state right away like we did for BLE
- Raise a subclassed exception of ValueError when a service is missing so we can disconnect and let the retry reconnect to force BlueZ to re-resolve services
- Make zeroconf availablity drive the decision to poll or not HOT 10
- Pair by QR code or NFC tap
- Replace most asyncio.wait_for with async_timeout or asyncio.timeout on 3.11
- Sleepy Thread devices HOT 8
- Avoid BlueZ mtu warning by setting `_mtu_size`
- Always subscribe to all available encrypted notifications
- Characteristics for Fibaro Wall Plug (Homekit version)
- Don't fetch programmable switch events on reconnect without getting a GATT notify for them HOT 5
- There is a race where we can be waiting for the device to be detected at startup and we get it more than once because we don't clear it before its detected again
- Fetching friendly_name does a linear search
- Using aiohomekit standalone: transport not supported HOT 2
- Eve Degree: Various BLE errors HOT 1
- asyncio.exceptions.TimeoutError during zeroconf search needs to be re-raised as AccessoryNotFoundError
- Log says "pairing established" but any interaction throws "is no known alias" HOT 4
- `first` to get accessory_info at startup is unexpectedly expensive
- Connection refused HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohomekit.