core icon indicating copy to clipboard operation
core copied to clipboard

All entities of NUKI integration again and again not available

Open Friedi1970 opened this issue 2 years ago • 9 comments

The problem

The NUKI entities are not available. This happens again and again. Sometimes every 2 to 3 minutes. The NUKI lock itself works perfectly by using the NUKI app or NUKI devices for opening/closing, so I assume the problem lies with the integration. There is also no device of NUKI which was disconnected or anything else. I can't really say since when this issue occurred but I am sure everything worked well in core-2022.07.

What version of Home Assistant Core has the issue?

core-2022.8.7

What was the last working version of Home Assistant Core?

core-2022.7.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

NUKI

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nuki

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

One of the errors in the logs:
Logger: homeassistant.components.nuki
Source: components/nuki/__init__.py:60
Integration: Nuki (documentation, issues)
First occurred: 6. September 2022 um 20:34:28 (10 occurrences)
Last logged: 07:40:27

Unexpected error fetching nuki devices data: Failed to update data for Nuki device 483095306
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 205, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in _async_update_data
    return await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/nuki/__init__.py", line 110, in async_update_data
    events = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/nuki/__init__.py", line 60, in _update_devices
    device.update(level)
  File "/usr/local/lib/python3.10/site-packages/pynuki/device.py", line 81, in update
    raise NukiUpdateException(
pynuki.exceptions.NukiUpdateException: Failed to update data for Nuki device 483095306

Additional information

No response

Friedi1970 avatar Sep 07 '22 08:09 Friedi1970

nuki documentation nuki source (message by IssueLinks)

Hey there @pschmitt, @pvizeli, @pree, mind taking a look at this issue as it has been labeled with an integration (nuki) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

I'm having the same issue, although this error message only occurs maybe 5 times a day. I have the official integration and also the HACS Nuki NG custom intergration and both give the same errors at the same time so I think it's a problem in the API from NUKI itself.

Since i've been using the NUKI, about a year now, i'm seeing these errors. So for me the problem was always there.

Arn0uDz avatar Sep 20 '22 09:09 Arn0uDz

I'm having the same issue, although this error message only occurs maybe 5 times a day. I have the official integration and also the HACS Nuki NG custom intergration and both give the same errors at the same time so I think it's a problem in the API from NUKI itself.

Since i've been using the NUKI, about a year now, i'm seeing these errors. So for me the problem was always there.

Same Problem here.

I didnt have the unavailable problem with the official integration for 2 years. But when i switched to the 'HACS Nuki NG custom intergration' the bridge became unavailable a lot of times. That's why i switched back to the official integration and now the same problem shows up here too.

Webstijlen avatar Oct 05 '22 14:10 Webstijlen

It's possible that the custom integration configured some webhooks on your bridge and didn't clean it up again. You can check that with the API (https://developer.nuki.io/page/nuki-bridge-http-api-1-13/4#heading--callback-list).

You can check this from your browser by accessing the API directly (just replace the bridge-ip & token): http://<bridge-ip>:8080/callback/list?token=<token>

pree avatar Oct 07 '22 12:10 pree

It's possible that the custom integration configured some webhooks on your bridge and didn't clean it up again. You can check that with the API (https://developer.nuki.io/page/nuki-bridge-http-api-1-13/4#heading--callback-list).

You can check this from your browser by accessing the API directly (just replace the bridge-ip & token): http://<bridge-ip>:8080/callback/list?token=<token>

Thanks @pree

I did the following steps to remove the unused/removed Nuki NG integration callback

  1. Check the callbacks on the bridge http://<bridge-ip>:8080/callback/list?token=<token> Returned {"callbacks": [{"id": 1, "url": "http://homeassistant/api/webhook/nuki_ng_bridge_hook_00c53e26cbd79623662083fd3b18f292"}]} So the callback id = 1

  2. Checked this callback http://homeassistant/api/webhook/nuki_ng_bridge_hook_00c53e26cbd79623662083fd3b18f292 Returned 405: Method Not Allowed

  3. Remove left over callback from Nuki NG http://<nuki-bridge-ip or hostname>:8080/callback/remove?id=<callback ip at step 1>&token=<nuki-bridge-token> Returned {"success": true}

  4. Test if callback is removed from list http://<nuki-bridge-ip or hostname>:8080/callback/list?token=<token> Returned {"callbacks": []}

What do you suggest to do next if this didnt solve it? Soft / Hard reset?

Webstijlen avatar Oct 07 '22 14:10 Webstijlen

I also received the logs of the bridge http://<nuki-bridge-ip-or-hostname>:8080/log?token=<nuki-bridge-api-token>

This got me a lot of

{"timestamp": "2022-10-07T14:06:43+00:00", "type": "HTTP-Log"},
{"timestamp": "2022-10-07T14:06:43+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2022-10-07T14:06:33+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2022-10-07T14:06:33+00:00", "type": "HTTP-List"},
{"timestamp": "2022-10-07T14:06:33+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2022-10-07T14:06:33+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2022-10-07T14:06:33+00:00", "type": "HTTP-List"},
{"timestamp": "2022-10-07T14:06:33+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2022-10-07T14:06:03+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},
{"timestamp": "2022-10-07T14:06:03+00:00", "type": "HTTP-List"},
{"timestamp": "2022-10-07T14:06:03+00:00", "type": "WLAN-SocketConnected", "connection": 0},
{"timestamp": "2022-10-07T14:06:03+00:00", "type": "WLAN-SocketDisconnected", "connection": 0},

Does that have to do with this error? How can I investigate further on this disconnection error, any other logs available?

Thanks again!

Webstijlen avatar Oct 07 '22 14:10 Webstijlen

Same problem here??? Disconnect and Connect every minutes. Integratin: Nuki HA: 10.0 OS: 9.0

Nuki App works well. No Problem.

maijo366 avatar Oct 27 '22 07:10 maijo366

Not sure what else you can do to debug. Hard-resetting could be worth to test. This is a known issue in the nuki developer forum: https://developer.nuki.io/t/random-http-503-unavailable/909

I can reproduce this with two sequential api-requests happening quickly after each-other.

pree avatar Oct 27 '22 09:10 pree

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.