home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.5k stars 30.7k forks source link

Home assistant 0.111.1 Nuki update problem #36719

Closed Ciqsky closed 4 years ago

Ciqsky commented 4 years ago

The problem

After update to 0.111.1 my nuki lock do not update status.

Environment

host_os | HassOS 4.10 os_version | 4.19.126-v7 python_version | 3.7.7 supervisor | 227 version | 0.111.1

Problem-relevant configuration.yaml

Traceback/Error logs

logs: Logger: homeassistant.helpers.entity Source: components/nuki/lock.py:124 First occurred: 11:40:21 (377 occurrences) Last logged: 14:56:51

Update for lock.porta fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update await self.hass.async_add_executor_job(self.update) 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 124, in update self._nuki_device.update(aggressive=level) File "/usr/local/lib/python3.7/site-packages/pynuki/device.py", line 90, in update "Failed to update data for lock. " AssertionError: Failed to update data for lock. Nuki ID None volatized.

Additional information

found also https://github.com/pschmitt/pynuki/issues/54 but my problem is not with netgear

probot-home-assistant[bot] commented 4 years ago

Hey there @pvizeli, mind taking a look at this issue as its been labeled with a integration (nuki) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

pvizeli commented 4 years ago

AssertionError: Failed to update data for lock. Nuki ID None volatized

Yeah, I see that also in my logs. The question is what changed on lib... @pschmitt ?

pschmitt commented 4 years ago

That depends. Are you using a software bridge, @Ciqsky ?

Ciqsky commented 4 years ago

No, with nuki lock i use only its bridge (nuki) with hassio on raspberry

Il Ven 12 Giu 2020, 19:30 Philipp Schmitt notifications@github.com ha scritto:

That depends. Are you using a software bridge, @Ciqsky https://github.com/Ciqsky ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/36719#issuecomment-643397285, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN7AGOU3JDWK2RCHFRXCCPTRWJQ33ANCNFSM4N4KPGFA .

rafuz commented 4 years ago

Same error here, starting from 111.1 I have a Nuki Bridge Firmware 2.5.2 (2.1.17 WiFi Firmware) I have a Nuki Opener associated to the same bridge and it works correctly.

What seems strange is that the Nuki ID disappears from the entity:

image

After a restart the ID appears again and the integration works.

Logger: homeassistant.helpers.entity Source: components/nuki/lock.py:124 First occurred: 20:06:31 (266 occurrences) Last logged: 22:23:07

Update for lock.porta_d_ingresso fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  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 124, in update
    self._nuki_device.update(aggressive=level)
  File "/usr/local/lib/python3.7/site-packages/pynuki/device.py", line 90, in update
    "Failed to update data for lock. "
AssertionError: Failed to update data for lock. Nuki ID None volatized.

HASS Info:

arch | x86_64
-- | --
chassis | vm
dev | false
docker | true
docker_version | 19.03.8
hassio | true
host_os | HassOS 4.10
installation_type | Home Assistant
os_name | Linux
os_version | 5.4.44
python_version | 3.7.7
supervisor | 227
timezone | Europe/Rome
version | 0.111.2
virtualenv | false
pschmitt commented 4 years ago

hm. That's odd behavior. I see these in my logs as well. I don't get why this is happening though. I'm tempted to add a check to for data validity in the update call at the hass or pynuki level (EDIT: or request throttling). The bridges are really sensible to parallel REST calls and do return garbage from time to time it seems.

pynuki isn't quite perfect yet. Ref: https://github.com/pschmitt/pynuki/pull/31

joydashy commented 4 years ago

Glad it's not just me! Same problem here.

mecrip commented 4 years ago

+1 same problem here, started with latest 0.111

SeraphimSerapis commented 4 years ago

Joining the group of people that encounters this issue.

Logger: homeassistant.helpers.entity
Source: components/nuki/lock.py:124
First occurred: 9:36:53 AM (38 occurrences)
Last logged: 9:56:29 AM

Update for lock.haustur fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  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 124, in update
    self._nuki_device.update(aggressive=level)
  File "/usr/local/lib/python3.7/site-packages/pynuki/device.py", line 90, in update
    "Failed to update data for lock. "
AssertionError: Failed to update data for lock. Nuki ID None volatized.
kachalex commented 4 years ago

same problem here, started with latest 0.111

juanrferia commented 4 years ago

+1. I also wanted to share some other information: While my nuki lock is locked, from time to time I see status change in HA to unlocked when unexpected (actually nuki is still locked), firing the automations I have for that lock status. When it happened, I checked the nuki id is gone in HA. If I restart HA then the nuki id is set again and status is correct (locked). But after a while (aprox a day) the issue comes again.

stiltjack commented 4 years ago

Same issue here. Factory reset of the nuki bridge (and hence a new token in configuration.yaml) resolves it, but it returns after a couple of days. I'm rebooting the Pi after editing, of course.

marcobag commented 4 years ago

+1 here, please fix

swissmaster1 commented 4 years ago

+1, same problem

CptKalibak commented 4 years ago

+1, same. Nuki lock is unavailable and a bunch of Timeout errors in my logs like: "socket.timeout: timed out"

Edit: I've renamed my lock in Nuki web and restarted Home Assistant and the Lock is back. will watch how long this works.

bigboban commented 4 years ago

After some update (Nuki fw?) i have many problems with Nuki. Sometimes Nuki component is not available (ok after restart again for few hours). For example right now component IS available but LOCK command fail with this error in log:

2020-06-22 21:54:03 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: name=homeassistant.helpers.entity, message=['Update for lock.muj_nuki_zamek fails'], level=ERROR, source=['components/nuki/lock.py', 124], timestamp=1592855643.219114, exception=Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 472, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  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 124, in update
    self._nuki_device.update(aggressive=level)
  File "/usr/local/lib/python3.7/site-packages/pynuki/device.py", line 90, in update
    "Failed to update data for lock. "
AssertionError: Failed to update data for lock. Nuki ID None volatized.
, count=1, first_occurred=1592855643.219114>
Ra72xx commented 4 years ago

This issue? https://github.com/pschmitt/pynuki/issues/56 Currently Nuki is pretty much unusable in HA :-( ...

loadamasta commented 4 years ago

I have exactly the same problem. Both of my locks become unavailable and do not update the status until a restart of HA. Before 0.111, the service nuki.check_connection did bring back the locks to HA, but now hass does not even find the service any more. The nuki integration cannot be used in reliable automations until this bug is not resolved.

Update: I went back to 0.110.7 and Nuki integration works as usual. So, there is a problem with HA 0.111. and not on the Nuki side.

dominik-doll commented 4 years ago

Same here. Going back to 0.110 helps - 0.111 Not working.

mokusnz commented 4 years ago

Same problems. 0.110 working - 0.111 Not working. In my opinion, this is a problem with HA, something has been forgotten. We are waiting for an update.

cassianyoung commented 4 years ago

+1 Note: that the link via IFTTT still works and can be used as a workaround.

Ciqsky commented 4 years ago

Works It now on 112.0 release?

stiltjack commented 4 years ago

Haven't had the new release yet, but there's no mention of Nuki in the release notes.

stiltjack commented 4 years ago

Just upgraded. Lock seems to be working normally so far - no errors. Fingers crossed.

chpego commented 4 years ago

Problem still exist on on 112.0 release

marcobag commented 4 years ago

Confirm, still exist!

Inviato da iPhone

Il giorno 2 lug 2020, alle ore 11:23, chpego notifications@github.com ha scritto:

 Problem still exist on on 112.0 release

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

bigboban commented 4 years ago

+1. Problem still on 112.0. 👎

Ciqsky commented 4 years ago

What can we do to help @pvizeli and @pschmitt solve this problem? Guys, what are the changes in the code made between version 110.7 and 111.0 that impact the NUKI component? The problem is there ...

bigboban commented 4 years ago

@Ciqsky Maybe problem is in HA maybe NOT. What about Nuki lock/gw firmware update? Maybe Nuki changed something.. I did lock fw update maybe day before i discover this problem.. Coincidence?

chpego commented 4 years ago

@Ciqsky Maybe problem is in HA maybe NOT. What about Nuki lock/gw firmware update? Maybe Nuki changed something.. I did lock fw update maybe day before i discover this problem.. Coincidence?

I've already the latest firmware on my Nuki lock/gw before install HA 111.1

Ra72xx commented 4 years ago

In my case there was no change in Nuki firnware. The only thing I updated was HA. So it's pretty safe to say that some change on HA broke Nuki. Please also note that a downgrade of HA solves the issue.

stiltjack commented 4 years ago

Mine is still working perfectly after 24 hours (nearly).

There are so many different versions of Home Assistant maybe we should compare our set-ups? Mine is:

image

I'm running HA on a Pi4.

As far as Nuki is concerned, I have:

Lock firmware version: 2.7.20 Bridge firmware version: 2.5.2 Door sensor not enabled

stiltjack commented 4 years ago

But... after rebooting the Nuki bridge the HA errors return. No change, then. Seems clear where the problem is, though:

image

image

stiltjack commented 4 years ago

Come on - really?

image

Ra72xx commented 4 years ago

At least for me, 0.112 didn't change anything. It only made me lose my HarmonyHub in addition to Nuki, but that's another bug. Anything which can be done from user side to help devs fix this problem?

kachalex commented 4 years ago

HA 112.1 ERROR Logger: homeassistant.helpers.entity Source: components/nuki/lock.py:124 First occurred: 15:13:13 (3 occurrences) Last logged: 15:14:15

Update for lock.alexanna fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update self.update # type: ignore 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 124, in update self._nuki_device.update(aggressive=level) File "/usr/local/lib/python3.7/site-packages/pynuki/device.py", line 90, in update "Failed to update data for lock. " AssertionError: Failed to update data for lock. Nuki ID None volatized.

cassianyoung commented 4 years ago

I see that the NA Nuki integration uses the pynuki library.

Did HA picked up a new version of the pynuki python library that it should not have done?

pynuki seems to have had quite a few changes in May.

https://github.com/pschmitt/pynuki/commits?author=pschmitt

Do we need to roll back thomkaufmann's update of the pynuki version in the HA integration on May 16th ???

mamoel666 commented 4 years ago

Same problem here. Started wit HA 111.1 (I think):

`Logger: homeassistant.helpers.entity Source: components/nuki/lock.py:124 First occurred: 3. Juli 2020, 20:20:15 (2353 occurrences) Last logged: 16:57:40

Update for lock.haustur fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 272, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update self.update # type: ignore 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 124, in update self._nuki_device.update(aggressive=level) File "/usr/local/lib/python3.7/site-packages/pynuki/device.py", line 90, in update "Failed to update data for lock. " AssertionError: Failed to update data for lock. Nuki ID None volatized. `

joydashy commented 4 years ago

At least for me, 0.112 didn't change anything. It only made me lose my HarmonyHub in addition to Nuki, but that's another bug. Anything which can be done from user side to help devs fix this problem?

Same here, note that the Harmony issue has a workaround (disable XMPP).

wmnl25 commented 4 years ago

+1: AssertionError: Failed to update data for lock. Nuki ID None volatized. & Network issues detect with None

Ciqsky commented 4 years ago

Someone has tried if last Nuki firmware version 2.7.30 change anything with home assistant >= 111.0 ? I have 110.7.

chpego commented 4 years ago

Someone has tried if last Nuki firmware version 2.7.30 change anything with home assistant >= 111.0 ? I have 110.7.

I will try with Nuki 2.7.30 // HA 0.112.4 ;)

joydashy commented 4 years ago

I have also just updated both Opener and Lock firmware as well as HA, now running that combo. We'll see!

Ciqsky commented 4 years ago

Feedback?

Ra72xx commented 4 years ago

New Nuki firmware now working for about 12h. However, the previous firnware sometimes also stayed online in HA for some time, so it`s too early draw conclusions.

mamoel666 commented 4 years ago

Yesterday I updated my Nuki (v2) to 2.7.30 and HA to 0.112.4. My Nuki went 'offline' after ~14h. In the Nuki App everything is still working fine.

Ciqsky commented 4 years ago

@pvizeli, @pschmitt , have you feedback for us? Most of us cannot upgrade to lastest home assistant release because nuki not work after 110.7. You can help us? Nuki is one of the few smart locks that work really well and supported by the home assistant. If you need testing or feedback from us, ask us, but please answer us! Thank you.

mamoel666 commented 4 years ago

Nuki is one of the few smart locks that work really well

worked really well

joydashy commented 4 years ago

I currently have an uptime of 28hrs with working Lock and Opener on latest HASS + latest Nuki firmware. Not sure if that's long enough to make any statements, but I feel I didn't manage this long on the older firmware.

ReneHezser commented 4 years ago

After reactivation of the Nuki integration this morning, the errors are still in the logs with HA 112.4 and Nuki 2.7.30 on my setup.