dauden1184 / RaspiNukiBridge

Simple Nuki Bridge implementation using asyncio
GNU General Public License v3.0
48 stars 19 forks source link

Home Assistant: Failed to update data for Nuki device #7

Closed LeChuck2909 closed 1 year ago

LeChuck2909 commented 2 years ago

Hi, i have running the server from this project on a rb4 4gb with rpi os 32 bit lite. the server is working perfectly fine, but home assistant can not communicate somehow anymore (it communicated a couple of days ago). i know this is not HA, but as the "bridge" is also custom i assume if i create a issue in HA project they state, they only support official bridge, so i thought i try to ask here.

i have home assistant on rpi 4 8gb running with latest HA os and latest HA core (2022.04) as my main smart home server since quiet a while. in the last coupe of days i tried to manage to get this project running, and on one point i successfully was able to lock/unlock doors from home assistant, but failed on stuff like proper booting of rp4 bluetooth/hci service.

now as i reduced my approach to rpi os 32 bit lite, the server of the project runs smoothly and i can lock/unlock with direct http calls, but HA can not communicate anymore.

this is the error from home assinstan:

Logger: homeassistant.components.nuki
Source: components/nuki/__init__.py:45
Integration: Nuki (documentation, issues)
First occurred: 17:47:43 (6 occurrences)
Last logged: 17:50:13

Unexpected error fetching nuki devices data: Failed to update data for Nuki device 1d935134
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 190, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data
    return await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/nuki/__init__.py", line 88, in async_update_data
    await hass.async_add_executor_job(_update_devices, locks + openers)
  File "/usr/local/lib/python3.9/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 45, in _update_devices
    device.update(level)
  File "/usr/local/lib/python3.9/site-packages/pynuki/device.py", line 81, in update
    raise NukiUpdateException(
pynuki.exceptions.NukiUpdateException: Failed to update data for Nuki device 1d935134

do you have an idea what could be the reason for this ? thank you.

dauden1184 commented 2 years ago

Did you have any logs on the bridge side? Try to remove the nuki integration from homeassistant and set it up again please.

LeChuck2909 commented 2 years ago

thats what i did already ... actually i manage to unlock/lock via manually entering the http call into e.g. chrome successfully, most of the time ... so i would assume this is rather a HA issue ... i also opnened a ticket:

https://github.com/home-assistant/core/issues/69920

but no repy so far ...

dauden1184 commented 2 years ago

Please try to update the software and try again

LeChuck2909 commented 2 years ago

updated the py file ... was able to lock/unlock the lock with manual http command in the browser right away ... reloaded the home assistant integration -> a the lock entity have been created, but it is still "not avaliable"

dauden1184 commented 2 years ago

Is the error in the logs still the same?

LeChuck2909 commented 2 years ago

no, i havent seen any nuki related error log so far ...

LeChuck2909 commented 2 years ago

so i took once again some time to this issue and there is really no other notice than the entity being not available ...

LeChuck2909 commented 2 years ago

we can make an appointment for remote control if you are interested. so you can check by yourself ?

dauden1184 commented 2 years ago

Yes, we can do that. but before I would like to see the logs of the software bridge to check what is sending to the homeassistant integration

LeChuck2909 commented 2 years ago

ok, where do i find the logs of the software bridge ?

dauden1184 commented 2 years ago

if you are running it as a service (using the nukibridge.service described in the README) you can see the logs with

sudo journalctl -fu nukibridge.service

Please restart the service and the homeassistant before check the logs, and give them some time to start the communication Also hide any sensitive information shown in the logs

LeChuck2909 commented 2 years ago
pi@raspberrypi:~/RaspiNukiBridge $ sudo journalctl -fu nukibridge.service
-- Journal begins at Mon 2022-04-04 14:05:58 CEST. --
May 26 11:53:14 raspberrypi python[957]: 2022-05-26 11:53:14.225|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -41 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])
May 26 11:53:58 raspberrypi python[957]: 2022-05-26 11:53:58.660|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -41 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])
May 26 11:55:15 raspberrypi python[957]: 2022-05-26 11:55:15.423|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -41 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])
May 26 11:56:36 raspberrypi python[957]: 2022-05-26 11:56:36.217|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -41 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])
May 26 11:57:16 raspberrypi python[957]: 2022-05-26 11:57:16.621|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -52 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])
May 26 11:57:50 raspberrypi python[957]: 2022-05-26 11:57:50.106|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -31 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])
May 26 11:58:33 raspberrypi python[957]: 2022-05-26 11:58:33.882|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -31 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])
May 26 11:59:50 raspberrypi python[957]: 2022-05-26 11:59:50.865|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -33 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])
May 26 12:00:34 raspberrypi python[957]: 2022-05-26 12:00:34.905|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -35 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])
May 26 12:01:51 raspberrypi python[957]: 2022-05-26 12:01:51.305|I|nuki.py:185|Nuki: 54:D2:72:93:51:34, RSSI: -44 AdvertisementData(local_name='Nuki_1D935134', manufacturer_data={76: b'\x02\x15\xa9.\xe2\x00U\x01\x11\xe4\x91l\x08\x00 \x0c\x9af\x1d\x93Q4\xc4'}, service_uuids=['0000003e-0000-1000-8000-0026bb765291', '00000044-0000-1000-8000-0026bb765291', '00000045-0000-1000-8000-0026bb765291', '00000055-0000-1000-8000-0026bb765291', '00000096-0000-1000-8000-0026bb765291', '000000a2-0000-1000-8000-0026bb765291', '00001800-0000-1000-8000-00805f9b34fb', '0000180a-0000-1000-8000-00805f9b34fb', 'a92ee100-5501-11e4-916c-0800200c9a66', 'a92ee200-5501-11e4-916c-0800200c9a66'])