ronengr / hass_nuki_bt

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

Can't setup Nuki 1.0 #70

Open DeamBeam opened 1 month ago

DeamBeam commented 1 month ago

System Health details

System Information

version core-2024.7.4
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.33-haos
arch x86_64
timezone Europe/Berlin
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4868 Installed Version | 1.34.0 Stage | running Available Repositories | 1388 Downloaded Repositories | 10
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.4 -- | -- update_channel | stable supervisor_version | supervisor-2024.06.2 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 30.8 GB disk_used | 8.4 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | kvm board | ova supervisor_api | ok version_api | ok installed_addons | File editor (5.8.0), Vaultwarden (Bitwarden) (0.22.0), Mosquitto broker (6.4.1), Terminal & SSH (9.14.0), Meross Local Broker Addon (0.0.1-alpha49), Zigbee2MQTT (1.39.0-1)
Dashboards dashboards | 2 -- | -- resources | 2 views | 9 mode | storage
Recorder oldest_recorder_run | 21. Juli 2024 um 20:53 -- | -- current_recorder_run | 31. Juli 2024 um 22:28 estimated_db_size | 181.86 MiB database_engine | sqlite database_version | 3.45.3
Spotify api_endpoint_reachable | ok -- | --

Checklist

Nuki Device type

Nuki Smartlock 1.0

hass_nuki_bt version

0.0.14

Describe the issue

Devices failes to setup. It automatically discovers the device and i can configure it. It also recognizes if the device is in pairing mode (instantly shows a message that pairing mode needs to enabled). If i set it up as client type "App" it creates the "Homeassistant" User on the Nuki lock. But with either client type it fails to setup the device.

I also tried to enable and disable passive scanning in the bluetooth integration.

(i use this Bluetooth adapter: https://www.amazon.de/gp/product/B0BW97QCTX/ )

Reproduction steps

  1. Clicking on configure device as it is discovered automatically
  2. Pressing the Button on the Nuki Lock for 6 seconds until the LED stays on
  3. Waiting until it finishes setting up

Debug logs

Logger: homeassistant
Quelle: /usr/src/homeassistant/homeassistant/runner.py:148
Erstmals aufgetreten: 23:06:05 (3 Vorkommnisse)
Zuletzt protokolliert: 23:06:59

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py", line 258, in _notification_handler
    msg = self._parse_message(bytes(data), encrypted)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py", line 208, in _parse_message
    msg = self._const.NukiMessage.parse(self._decrypt_message(data))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 404, in parse
    return self.parse_stream(io.BytesIO(data), **contextkw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 416, in parse_stream
    return self._parsereport(stream, context, "(parsing)")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 428, in _parsereport
    obj = self._parse(stream, context, path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 2236, in _parse
    subobj = sc._parsereport(stream, context, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 428, in _parsereport
    obj = self._parse(stream, context, path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 2770, in _parse
    return self.subcon._parsereport(stream, context, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 428, in _parsereport
    obj = self._parse(stream, context, path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyNukiBT/const.py", line 996, in _parse_other
    ret = super()._parse(stream, context, path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 4556, in _parse
    return self.subcon._parsereport(substream, context, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyNukiBT/const.py", line 993, in _parsereport
    return tmp_subcon._parsereport(stream, context, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 428, in _parsereport
    obj = self._parse(stream, context, path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 4036, in _parse
    return sc._parsereport(stream, context, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 428, in _parsereport
    obj = self._parse(stream, context, path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 2236, in _parse
    subobj = sc._parsereport(stream, context, path)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 428, in _parsereport
    obj = self._parse(stream, context, path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 2770, in _parse
    return self.subcon._parsereport(stream, context, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 428, in _parsereport
    obj = self._parse(stream, context, path)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 1157, in _parse
    data = stream_read(stream, self.length, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 178, in stream_read
    raise StreamError("stream read less than specified amount, expected %d, found %d" % (length, len(data)), path=path)
construct.core.StreamError: Error in path (parsing) -> payload -> accessory_battery_state
stream read less than specified amount, expected 1, found 0

Logger: pyNukiBT.nuki
Quelle: /usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py:350
Erstmals aufgetreten: 23:06:25 (3 Vorkommnisse)
Zuletzt protokolliert: 23:07:19

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py", line 346, in _send_command
    msg = await self._notify_future
          ^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py", line 345, in _send_command
    async with async_timeout.timeout(self.command_response_timeout):
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 141, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.12/site-packages/async_timeout/__init__.py", line 228, in _do_exit
    raise asyncio.TimeoutError
TimeoutError

Logger: homeassistant.config_entries
Quelle: config_entries.py:586
Erstmals aufgetreten: 23:07:37 (1 Vorkommnisse)
Zuletzt protokolliert: 23:07:37

Error setting up entry Nuki_11454A71 for hass_nuki_bt
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hass_nuki_bt/__init__.py", line 90, in async_setup_entry
    if not await coordinator.async_wait_ready():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/hass_nuki_bt/coordinator.py", line 155, in async_wait_ready
    await self._async_update()
  File "/config/custom_components/hass_nuki_bt/coordinator.py", line 112, in _async_update
    await self.device.update_state()
  File "/usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py", line 421, in update_state
    msg = await self._send_encrtypted_command(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py", line 184, in _send_encrtypted_command
    unencrypted = self._const.NukiMessage.build(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 452, in build
    self.build_stream(obj, stream, **contextkw)
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 464, in build_stream
    self._build(obj, stream, context, "(building)")
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 2260, in _build
    buildret = sc._build(subobj, stream, context, path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 2774, in _build
    return self.subcon._build(obj, stream, context, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 4559, in _build
    return self.subcon._build(obj, stream, context, path)
           ^^^^^^^^^^^^^^^^^^
AttributeError: 'tmpclass' object has no attribute '_build'

Diagnostics dump

No response

SlKlElT commented 1 month ago

Same problem here with nuki 2.0

Error setting up entry Garagentür for hass_nuki_bt Error setting up entry Garagentür for hass_nuki_bt Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hass_nuki_bt/__init__.py", line 90, in async_setup_entry if not await coordinator.async_wait_ready(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/hass_nuki_bt/coordinator.py", line 155, in async_wait_ready await self._async_update() File "/config/custom_components/hass_nuki_bt/coordinator.py", line 112, in _async_update await self.device.update_state() File "/usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py", line 421, in update_state msg = await self._send_encrtypted_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pyNukiBT/nuki.py", line 184, in _send_encrtypted_command unencrypted = self._const.NukiMessage.build( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 452, in build self.build_stream(obj, stream, **contextkw) File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 464, in build_stream self._build(obj, stream, context, "(building)") File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 2260, in _build buildret = sc._build(subobj, stream, context, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 2774, in _build return self.subcon._build(obj, stream, context, path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 4559, in _build return self.subcon._build(obj, stream, context, path) ^^^^^^^^^^^^^^^^^^ AttributeError: 'tmpclass' object has no attribute '_build'

SlKlElT commented 3 weeks ago

Is this repo also dead?