core: Home Assistant 0.111 Nuki bridge parameter missing

The problem

In the new version of pynuki, there is a new parameter “secure” (default true) when the NukiBridge is initialized. If you are using a soft bridge, it works the old way sending the token not codified, so you need to initialize it with false.

Environment

  • Home Assistant Core release with the issue: 0.111
  • Last working Home Assistant Core release (if known): 0.110
  • Operating environment (Home Assistant/Supervised/Docker/venv): HassOS 3.13
  • Integration causing this issue: Nuki
  • Link to integration documentation on our website: https://www.home-assistant.io/integrations/nuki/

Problem-relevant configuration.yaml


Traceback/Error logs

2020-06-16 08:11:40 ERROR (MainThread) [homeassistant.components.lock] Error while setting up nuki platform for lock
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pynuki/bridge.py", line 78, in token
    self.info()
  File "/usr/local/lib/python3.7/site-packages/pynuki/bridge.py", line 158, in info
    data = self.__rq("info")
  File "/usr/local/lib/python3.7/site-packages/pynuki/bridge.py", line 106, in __rq
    result.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: http://192.168.0.85:8080/info?ts=2020-06-16T06:11:39Z&rnr=1706&hash=4235a2340c5e467956667f29e7689896cde00b03c144aa39723f1c2ec233423508jhdsfvsdfgvb9s

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/nuki/lock.py", line 54, in setup_platform
    config[CONF_HOST], config[CONF_TOKEN], config[CONF_PORT], DEFAULT_TIMEOUT,
  File "/usr/local/lib/python3.7/site-packages/pynuki/bridge.py", line 46, in __init__
    self.token = token
  File "/usr/local/lib/python3.7/site-packages/pynuki/bridge.py", line 84, in token
    "Login error. Provided token is invalid."
pynuki.bridge.InvalidCredentialsException: Login error. Provided token is invalid.

Additional information

I think the solution should be to create a new config parameter for nuki integration (secure), so the user can select which way its bridge is working

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 24 (11 by maintainers)

Commits related to this issue

Most upvoted comments

If you are running hassio, you have to follow these instructions to ssh access on 22222 port. https://developers.home-assistant.io/docs/operating-system/debugging/ After that, once in remote terminal, write “login”. In the new console, enter “docker exec -it homeassistant /bin/bash” And then you will find these files in /usr/local/lib/python3.7/site-packages/pynuki I followed jasebob instructions to achieve it here : https://community.home-assistant.io/t/where-is-home-assistant-source-in-hass-io/119070/10