ronengr / hass_nuki_bt

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

Sporadic no connection after startup #55

Closed 011V32 closed 4 months ago

011V32 commented 4 months ago

System Health details

System Information

version core-2024.5.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.29-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 | 4911 Installed Version | 1.34.0 Stage | running Available Repositories | 1396 Downloaded Repositories | 11
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.3 -- | -- update_channel | stable supervisor_version | supervisor-2024.05.1 agent_version | 1.6.0 docker_version | 25.0.5 disk_total | 468.7 GB disk_used | 15.9 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.7.20240420), Advanced SSH & Web Terminal (17.3.0), Mosquitto broker (6.4.0), VNC Viewer (1.6.0), ESPHome (2024.5.0)
Dashboards dashboards | 3 -- | -- resources | 0 views | 14 mode | storage
Recorder oldest_recorder_run | May 9, 2024 at 08:06 -- | -- current_recorder_run | May 17, 2024 at 07:38 estimated_db_size | 272.82 MiB database_engine | sqlite database_version | 3.44.2
Solcast PV Forecast can_reach_server | ok -- | -- used_requests | 0 rooftop_site_count | 1
Spotify api_endpoint_reachable | ok -- | --

Checklist

Describe the issue

It happens from time to time that no connection can be established after restarting HA. After restarting the integration it works successfully every time. I use an ESP Home Bluetooth Proxy. Maybe it needs more time to start and the integration should wait until it has started and established a connection? I activated debug logging but haven't gotten any errors since then. I will submit it later after I get an error and it contains additional information.

Reproduction steps

Restart HA

Debug logs

2024-05-17 07:38:29.856 ERROR (MainThread) [custom_components.hass_nuki_bt] 54:D2:72:75:B2:FC: Bluetooth error whilst polling: failed to discover services, device disconnected
2024-05-17 07:38:29.858 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 575, 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 152, in async_wait_ready
await self._async_update()
File "/config/custom_components/hass_nuki_bt/coordinator.py", line 114, in _async_update
logs = await self.device.request_log_entries(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py", line 592, in request_log_entries
self._const.NukiCommand.REQUEST_DATA,
^^^^^^^^^^^
AttributeError: 'NukiDevice' object has no attribute '_const'

Diagnostics dump

No response