kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
167 stars 32 forks source link

Custom component fails to load #154

Closed q20 closed 1 year ago

q20 commented 1 year ago

Hi there

Since restarting my Home Assistant Core installtion this morning, I can no longer control my Nuki devices via HA as the integration fails to load:

image

Here's a snippet from the debug log:

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/simplejson/__init__.py", line 514, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/simplejson/decoder.py", line 386, in decode
    obj, end = self.raw_decode(s)
               ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/simplejson/decoder.py", line 416, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
simplejson.errors.JSONDecodeError: Invalid control character '\x11' at: line 1 column 360 (char 359)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/nuki_ng/nuki.py", line 401, in _update
    device_list = await self.api.bridge_list()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nuki_ng/nuki.py", line 72, in bridge_list
    data = await self.async_json(lambda r: r.get(self.bridge_url("/list"), timeout=BRIDGE_TIMEOUT))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nuki_ng/nuki.py", line 44, in async_json
    json_resp = response.json()
                ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Invalid control character '\x11' at: line 1 column 360 (char 359)
q20 commented 1 year ago

FYI, I was running Home Assistant 2023.6.1. I have just updated my container to 2023.6.2 and the component still fails to load.

q20 commented 1 year ago

Case closed: this turned out to be a problem with the Nuki Opener - after a factory reset, this Custom Component was once more able to connect to the Bridge successfully. 👍