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

August Lock Bluetooth - can't setup #77987

Closed
hanfreakingsolo opened this issue Sep 7, 2022 · 28 comments
Closed

August Lock Bluetooth - can't setup #77987

hanfreakingsolo opened this issue Sep 7, 2022 · 28 comments

Comments

@hanfreakingsolo
Copy link

The problem

So happy about the new bluetooth integration for v.9, but I'm having an issue setting it up that I didn't have before it was merged into home assistant core.

I have a gen 3 August Lock Pro. The Yale Access BLE integration doesn't allow manual setup, only for discovered devices. That was ok in the past, I was able to trigger HA to discover the device by factory resetting it and then (I'm assuming) it started broadcasting a bluetooth message tha HA could see.

Before, I was able to get HA to pull the keys from the cloud by timing my august integration setup just before the yale_ble setup so HA had the keys while the device was discovered. Now that's not working.

I've tried this approach

  • factory reset the lock, and home assistant shows it as a discovered device. But it doesn't have the keys yet as now the august integration has no devices anymore so it's asking for a key
  • setup the lock and reload august; now yale_ble showed initializing but fails over and over. On the last attempt, it showed initializing forever until I deleted it
  • Tried over and over with setting up yale_ble integration at different stages of setup (before initializing lock, after initializing lock and before adding august connect, after adding august connect...)

How can we both trigger the lock to become discovered, and have HA pull the keys from the august integration? Reporting as a bug as I believe I've exhausted methods to do both things and it worked before.

What version of Home Assistant Core has the issue?

core-2022.9.0

What was the last working version of Home Assistant Core?

2022.9.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Yale Access Bluetooth

Link to integration documentation on our website

https://www.home-assistant.io/integrations/yalexs_ble

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@probot-home-assistant
Copy link

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (yalexs_ble) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)


yalexs_ble documentation
yalexs_ble source
(message by IssueLinks)

@bdraco
Copy link
Member

bdraco commented Sep 7, 2022

Not all owner accounts will have the keys. Please check the documentation for alternative ways to get the key.

@hanfreakingsolo
Copy link
Author

hanfreakingsolo commented Sep 8, 2022

I don't believe that's the problem as I've gotten the keys from my account before, also rooting my phone is not an option.
Also only one owner account is tied to this lock.

@bdraco
Copy link
Member

bdraco commented Sep 8, 2022

https://www.home-assistant.io/integrations/yalexs_ble#yale-access-or-august-cloud

You may need to create or use a non-primary existing account with owner-level access to the lock, as not all accounts will have the key loaded.

@hanfreakingsolo
Copy link
Author

hanfreakingsolo commented Sep 8, 2022

So I left August setup and just gave it time, the lock was discovered during the night. I setup the integration, and it did not prompt for a key so it must have got it from August.
The integration added successfully, but it's been showing "initializing" for 20 minutes.
Edit: should mention.. it prompted for a key the first time I tried this morning - after reloading the August integration, Yale _ble did not prompt for the key and went straight into initializing the lock

@bdraco
Copy link
Member

bdraco commented Sep 8, 2022

You'll likely need to turn on debug logging for yalexs_ble and bleak_retry_connector to see whys its stuck. It could be an old key

@jhoff80
Copy link

jhoff80 commented Sep 8, 2022

https://www.home-assistant.io/integrations/yalexs_ble#yale-access-or-august-cloud

You may need to create or use a non-primary existing account with owner-level access to the lock, as not all accounts will have the key loaded.

I've tried on a Gen 4 lock with both my main August account and a secondary owner-level account that was created specifically for the purposes of HA, and nothing. Is it just a matter of creating a bunch of new accounts and hoping one of them works? Or is there something else to try?

For what it's worth, if I download the August diagnostics it does say " "OfflineKeys": "REDACTED" ". To me that would imply that it had access to the Offline Keys in order to redact them, but I don't know if it's just redacting a blank field for security purposes anyway. Unfortunately I don't have access to an iOS device or rooted Android device to get the key another way.

@bdraco
Copy link
Member

bdraco commented Sep 8, 2022

If it's not in the loaded field for OfflineKeys then it won't work.

You may need to enable Auto Unlock and use it at least once to force the lock to load it

@finder39
Copy link
Contributor

finder39 commented Sep 8, 2022

I'm having the same stuck on "Initializing" issue.

Screen Shot 2022-09-07 at 5 34 11 PM

Here is whats in the logs:

2022-09-07 20:14:22.950 ERROR (MainThread) [yalexs_ble.lock] Outer Front Door (L50007L): Failed to connect to the lock: Outer Front Door (L50007L) - /org/bluez/hci0/dev_78_9C_**_**_**_**: Failed to connect:
2022-09-07 20:14:22.985 ERROR (MainThread) [yalexs_ble.push] Outer Front Door (L50007L): Error updating
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 357, in establish_connection
await client.connect(
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 133, in connect
connected = await super().connect(
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 175, in connect
await self.get_services()
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 157, in get_services
return await super().get_services(
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 489, in get_services
self.services = await manager.get_services(self._device_path)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 521, in get_services
await self._wait_condition(device_path, "ServicesResolved", True)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/manager.py", line 612, in _wait_condition
await event.wait()
File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait
await fut
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 356, in establish_connection
async with async_timeout.timeout(BLEAK_SAFETY_TIMEOUT):
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 129, in __aexit__
self._do_exit(exc_type)
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/yalexs_ble/push.py", line 571, in _queue_update
await self._update_task
File "/usr/local/lib/python3.10/site-packages/yalexs_ble/push.py", line 92, in _async_wrap_operation_lock
return await func(self, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/yalexs_ble/push.py", line 113, in _async_wrap_retry_bluetooth_connection_error
return await func(self, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/yalexs_ble/push.py", line 391, in _update
async with lock:
File "/usr/local/lib/python3.10/site-packages/yalexs_ble/lock.py", line 63, in __aenter__
await self.connect()
File "/usr/local/lib/python3.10/site-packages/yalexs_ble/lock.py", line 93, in connect
raise err
File "/usr/local/lib/python3.10/site-packages/yalexs_ble/lock.py", line 83, in connect
self.client = await establish_connection(
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 370, in establish_connection
_raise_if_needed(name, description, exc)
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 303, in _raise_if_needed
raise BleakNotFoundError(msg) from exc
bleak_retry_connector.BleakNotFoundError: Outer Front Door (L50007L) - /org/bluez/hci0/dev_78_9C_**_**_**_**: Failed to connect:

@bdraco
Copy link
Member

bdraco commented Sep 8, 2022

Are you using a long range adapter? The normal range on the lock is around 20 ft.

@finder39
Copy link
Contributor

finder39 commented Sep 8, 2022

I have two August (WiFi Smart Lock - Gen 4) that both seem to be stuck on the Initializing screen with the new integration. They were auto-discovered, and are within 10-15 feet of the rPi. I've tried restarting, rebooting the Pi, and reloading; nothing seems to help.

I'm running in a docker container on a rPi 4, using built in bluetooth, and have dbus installed.

Theres some extra info, happy to send more if needed

@bdraco
Copy link
Member

bdraco commented Sep 8, 2022

Please enable the loggers listed above #77987 (comment)

Bluetooth diagnostics would be helpful as well

@bdraco
Copy link
Member

bdraco commented Sep 8, 2022

Also, when I did testing with the lock and the RPis I had to sit the lock right on top of the pi to get it work until I added an external adapter on an extension cable (then I got about 45ft out of it).

@finder39
Copy link
Contributor

finder39 commented Sep 8, 2022

Please enable the loggers listed above #77987 (comment)

Bluetooth diagnostics would be helpful as well

2022-09-08 16:17:56.779 DEBUG (MainThread) [bleak_retry_connector] Outer Front Door (L50007L) - /org/bluez/hci0/dev_78_9C_85_17_B5_B6: Timed out trying to connect (attempt: 2, last rssi: -85)
2022-09-08 16:17:56.779 DEBUG (MainThread) [bleak_retry_connector] Outer Front Door (L50007L) - /org/bluez/hci0/dev_78_9C_85_17_B5_B6: Connecting (attempt: 3, last rssi: -86)
2022-09-08 16:18:12.531 DEBUG (MainThread) [bleak_retry_connector] Outer Front Door (L50007L) - /org/bluez/hci0/dev_78_9C_85_17_B5_B6: Timed out trying to connect (attempt: 3, last rssi: -86)
2022-09-08 16:18:12.532 DEBUG (MainThread) [bleak_retry_connector] Outer Front Door (L50007L) - /org/bluez/hci0/dev_78_9C_85_17_B5_B6: Connecting (attempt: 4, last rssi: -84)
2022-09-08 16:18:15.027 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Front Door' for yalexs_ble integration not ready yet: No Bluetooth advertisement received; Try moving the Bluetooth adapter closer to L50005Q; Retrying in background
2022-09-08 16:18:15.029 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Outer Front Door' for yalexs_ble integration not ready yet: Could not connect; Try moving the Bluetooth adapter closer to L50007L; Retrying in background
2022-09-08 16:18:31.952 DEBUG (MainThread) [bleak_retry_connector] Outer Front Door (L50007L) - /org/bluez/hci0/dev_78_9C_**_**_**_**: Connecting (attempt: 1, last rssi: -87)

I can try with it literally on top of it like you said, and I guess I may have to order an external adapter with an extension cable

@bdraco
Copy link
Member

bdraco commented Sep 8, 2022

This one is really close to the long range adapter and I've got -68 on it

Screen Shot 2022-09-08 at 6 24 16 PM

This one is one room away and its -76

Screen Shot 2022-09-08 at 6 24 47 PM

In general it seems -78 is about the end of the usable range. You might be able to get it to work with lower if you have line of sight

@bdraco
Copy link
Member

bdraco commented Sep 8, 2022

FWIW I've given up on the PIs internal bluetooths as the range isn't great. Coupled with the short range on the locks (likely to preserve battery life), it is not a great combination.

Surprisingly the range on the ESP32 chips seems to be better so once we have active connection support with ESPHOME devices, that might make things a bit easier.

I'm using an active usb-ethernet extensions to reach the front door lock
https://www.amazon.com/gp/product/B01K9V7D18/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Also for my side door lock which is only two rooms away I was able to use a passive usb-ethernet extension
https://www.amazon.com/gp/product/B003L14ZTC/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

@finder39
Copy link
Contributor

finder39 commented Sep 8, 2022

home-assistant.io/integrations/bluetooth/#known-working-adapters home-assistant.io/integrations/bluetooth/#bluetooth-interference-with-other-devices

This is the one I'm using with them

amazon.com/gp/product/B09KG7QQ5V/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Along with an extension cable to get it away from the USB3 ports usb.org/sites/default/files/327216.pdf

amazon.com/gp/product/B07RQRMGKB/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Cool, just ordered these with same day delivery, so should be able to test out later tonight if no delays. Gotta love modern day conveniences

Will get back to you with updates on how it works. Thanks for fast responses!

@finder39
Copy link
Contributor

finder39 commented Sep 9, 2022

Turns out that bluetooth adapter isn't compatible with rPi 4. I ordered a new one to be delivered Saturday and will test then

@liquidbear99
Copy link

Is the signal strength reading on the Yale Access for bluetooth or WiFi? I installed an ESP32 bluetooth proxy to help improve my signal strength and it did nothing. If it is bluetooth, does this integration support connecting to ESP32 proxies (new with the September release of home assistant). If not, are there plans for this?

@bdraco
Copy link
Member

bdraco commented Sep 9, 2022

The ESP32 proxies only do passive connections so it won't help. Active connection support isn't available yet for the esp bluetooth proxies. The signal strength is bluetooth

@liquidbear99
Copy link

I see, so my only options now are buy a bluetooth adapter and USB extension cord for the pi4 or wait until ESP32 proxies get an update for active connection support (which in the release notes was said will be released later). Thanks for the clarification, I will probably wait it out.

My lock is working ~50% of the time via Yale access but takes FOREVER to respond. Signal strength hovers around -77 so I assume that is the problem.

@bdraco
Copy link
Member

bdraco commented Sep 9, 2022

My lock is working ~50% of the time via Yale access but takes FOREVER to respond. Signal strength hovers around -77 so I assume that is the problem.

Sounds like signal / range is the issue here. The range on these locks is not so great, but I guess thats what you get with a battery powered device.

@hanfreakingsolo
Copy link
Author

FWIW I've given up on the PIs internal bluetooths as the range isn't great. Coupled with the short range on the locks (likely to preserve battery life), it is not a great combination.

Surprisingly the range on the ESP32 chips seems to be better so once we have active connection support with ESPHOME devices, that might make things a bit easier.

I'm using an active usb-ethernet extensions to reach the front door lock
https://www.amazon.com/gp/product/B01K9V7D18/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Also for my side door lock which is only two rooms away I was able to use a passive usb-ethernet extension
https://www.amazon.com/gp/product/B003L14ZTC/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

Is it possible the setup process requires a better signal than day to day operation?

Before this was added as a core integration, I setup the lock with my pi4 close to the lock. Once set up I moved it back to it's original location (about 10ft away with one wall in between) and it still worked, albeit with a bit of delay.

This time around I'm trying to complete setup without moving my pi and it won't finish initializing

@bdraco
Copy link
Member

bdraco commented Sep 9, 2022

The setup process does require a good connection

@liquidbear99
Copy link

My lock is working ~50% of the time via Yale access but takes FOREVER to respond. Signal strength hovers around -77 so I assume that is the problem.

Sounds like signal / range is the issue here. The range on these locks is not so great, but I guess thats what you get with a battery powered device.

Hopefully active ESP32 proxy will be released on HA this year! I really like the easy online configurator. Thanks for quick response.

@liquidbear99
Copy link

Does anyone know if there is there any way I could use a raspberry pi zero W as an active bluetooth proxy? That may fix my issue!

@bdraco
Copy link
Member

bdraco commented Nov 23, 2022

Make sure you are using one of the high performance adapters listed on the Bluetooth integration docs as the Yale locks have a long service list which makes connecting difficult for some of the less performant adapters.

Here is a branch with some esphome changes that should improve the performance and reliability:

esphome/issues#3761 (comment)

I'm going to close this issue since there is already an esphome issue that is tracking this problem and that's where the changes need to happen

@bdraco bdraco closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants