ronengr / hass_nuki_bt

Control Nuki Lock over bluetooth
MIT License
36 stars 7 forks source link

First initial setup failed. (Failure while polling; Error setting up entry Nuki for hass_nuki_bt) #42

Closed 011V32 closed 6 months ago

011V32 commented 6 months ago

System Health details

System Information

version core-2024.3.3
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.20-haos
arch x86_64
timezone Europe/Vienna
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4988 Installed Version | 1.34.0 Stage | running Available Repositories | 1404 Downloaded Repositories | 8
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.1 -- | -- update_channel | stable supervisor_version | supervisor-2024.03.0 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 468.7 GB disk_used | 14.0 GB healthy | true supported | true board | generic-x86-64 supervisor_api | ok version_api | ok installed_addons | Samba share (12.3.1), File editor (5.8.0), RaspberryMatic CCU (3.75.6.20240316), Advanced SSH & Web Terminal (17.2.0), Mosquitto broker (6.4.0), VNC Viewer (1.6.0), ESPHome (2024.3.0)
Dashboards dashboards | 2 -- | -- resources | 0 views | 12 mode | storage
Recorder oldest_recorder_run | March 17, 2024 at 19:10 -- | -- current_recorder_run | March 26, 2024 at 20:33 estimated_db_size | 187.55 MiB database_engine | sqlite database_version | 3.44.2
Spotify api_endpoint_reachable | ok -- | --

Checklist

Describe the issue

I tried to install and connect my nuki 3.0 for the first time. I have all Versions on Top. HA see above. (I use HA OS on a x86 machine) Version of Nuki is 3.8.7. Version of hass_nuki_bt is 0.0.9. I use a Olimex PoE esp32 bt proxy around 1.5m away from the lock.

Reproduction steps

  1. Deinstallation of hass_nuki_ng
  2. Installation of hass_nuki_bt.
  3. Restart.
  4. Configuration of the lock with the autodiscover was succesfull.
  5. Error of the integration. Even after restart of HA or the integration. See below.

Debug logs

2024-03-26 20:32:59.986 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-03-26 20:32:59.987 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration hass_nuki_bt which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-03-26 20:33:04.878 WARNING (MainThread) [homeassistant.helpers.frame] Detected that custom integration 'hacs' accesses hass.components.frontend. This is deprecated and will stop working in Home Assistant 2024.9, it should be updated to import functions used from frontend directly at custom_components/hacs/frontend.py, line 68: hass.components.frontend.async_register_built_in_panel(, please create a bug report at https://github.com/hacs/integration/issues
2024-03-26 20:33:05.111 ERROR (MainThread) [custom_components.hass_nuki_bt] 54:D2:72:75:B2:FC: Bluetooth error whilst polling: No backend with an available connection slot that can reach address 54:D2:72:75:B2:FC was found
2024-03-26 20:33:15.563 WARNING (MainThread) [pyNukiBT.nuki] parse error Error in path (parsing) -> crc
wrong checksum, read 2051, computed 22476
2024-03-26 20:33:15.563 WARNING (MainThread) [pyNukiBT.nuki] Got unexpected message length for command 62486. got length:107 expecting length:8
2024-03-26 20:33:15.563 WARNING (MainThread) [pyNukiBT.nuki] Got 99 unknown bytes with value: b'\xc7G&\x8fHCEc.\xf4Aa\xa9\xc0)\x91\x02s\x04\x00\xc7fM\x00X&7]\x96\x9c\xdcnO\x0b.|*?\xdb\xb0\xe8\xfcVd\xd0\x0e7\x92\xc6~s~\xddQU\x89\xa3O\x98\x9b\xdc\x9a\xd7\x95\xd7 \x1d\xaaF|\xc5\x9b\xc7\t\xe2\xcb\xf9K@F\xc8q&;\xc5\xc3\xfc\x1c\xc2\xf0q\x8f\x95\x9a\x06\xf3\xebV\x8b'
2024-03-26 20:33:15.564 ERROR (MainThread) [pyNukiBT.nuki] HomeAssistant: Received unsolicited notification: Container:
auth_id = b'\x86G\x14\x1f' (total 4)
command = (enum) (unknown) 62486
payload = None
crc = 18375
2024-03-26 20:33:15.564 ERROR (MainThread) [pyNukiBT.nuki] was expecting STATUS
2024-03-26 20:33:15.602 ERROR (MainThread) [custom_components.hass_nuki_bt] 54:D2:72:75:B2:FC: Failure while polling
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/bluetooth/active_update_coordinator.py", line 129, in _async_poll
self.data = await self._async_poll_data(self._last_service_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/bluetooth/active_update_coordinator.py", line 122, in _async_poll_data
return await self._poll_method(last_service_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_nuki_bt/coordinator.py", line 116, in _async_update
if logs[0].type == NukiConst.LogEntryType.LOCK_ACTION:
~~~~^^^
IndexError: list index out of range
2024-03-26 20:33:15.850 WARNING (MainThread) [pyNukiBT.nuki] parse error Error in path (parsing) -> crc
wrong checksum, read 2051, computed 22476
2024-03-26 20:33:15.851 WARNING (MainThread) [pyNukiBT.nuki] Got unexpected message length for command 9625. got length:107 expecting length:8
2024-03-26 20:33:15.851 WARNING (MainThread) [pyNukiBT.nuki] Got 99 unknown bytes with value: b'T\x06\xa4\xc2T$\xddh\xef\xb4\x16\x8c\xbb\xf2\xd9\xd3\xb6\xd3\x04\x00\xc7fM\x00c\xaac\xb2\xbb\xb4\xed}U\x157\xac\xbee\x18;gI\xdf\xeae\xc7\xb6\x18"\xe5lk\x88\xea\x7f\x1ahHO_c\x96R9\x1bY\x8f\xa2\x9d1l\xb3:\x87\xef\xa8(\x87\xfd!\xec\xda\xfa\xc7M\x18sBO\x9be|\xb5\xe0\xf4\xe5\xab\xdfD'
2024-03-26 20:33:15.851 ERROR (MainThread) [pyNukiBT.nuki] HomeAssistant: Received unsolicited notification: Container:
auth_id = b'8ws\\' (total 4)
command = (enum) (unknown) 9625
payload = None
crc = 1620
2024-03-26 20:33:15.852 ERROR (MainThread) [pyNukiBT.nuki] was expecting STATUS
2024-03-26 20:33:15.898 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Nuki_3575B2FC for hass_nuki_bt
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 504, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_nuki_bt/__init__.py", line 86, in async_setup_entry
if not await coordinator.async_wait_ready():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_nuki_bt/coordinator.py", line 151, in async_wait_ready
await self._async_update()
File "/config/custom_components/hass_nuki_bt/coordinator.py", line 116, in _async_update
if logs[0].type == NukiConst.LogEntryType.LOCK_ACTION:
~~~~^^^
IndexError: list index out of range

Diagnostics dump

No response

011V32 commented 6 months ago

I wanted to create this issue so I could maybe show someone else the solution. My problem was that before this integration I had installed the hass_nuki_ng integration. I uninstalled the hass_nuki_ng integration beforehand, but didn't restart the system in between. I then uninstalled the hass_nuki_bt integration again, restarted the system and reinstalled the hass_nuki_bt and restarted it again. After that it worked as expected. So my mistake was that I didn't restart after uninstalling the hass_nuki_ng integration, which caused the above errors to appear.