kvj / hass_nuki_ng

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

Communication error with Nuki Bridge #98

Open domdal opened 1 year ago

domdal commented 1 year ago

I installed the integration with HACS and tried to add the integration "Nuki Lock" but i get a communication error. I have not found any logs or something to solve this error. Both IP addresses are prefilled and correct - so it auto detects the bridge The port in the Nuki http API is standard set to 8080 The API token is 10 digits long

When I try the normal "Nuki" Integration which is preinstalled in Home Assistant, I can add the bridge but my Nuki Lock appears as unavailable.

For this repo i have tried the version 3.8 3.9 and 3.10

My Home Assistant setup:

Home Assistant 2021.12.10 Python-Version | 3.9.7

Bildschirmfoto 2022-08-30 um 20 47 44
alexdelprete commented 1 year ago

The port in the Nuki http API is standard set to 8080 The API token is 10 digits long

you mean the Bridge API, right? Don't confuse the bridge token with the Web API token, double-check that. Are you sure HA and the bridge can communicate? Do you use proxies/vlans, etc.?

From the instructions:

image

domdal commented 1 year ago

you mean the Bridge API, right?

Yes, it is the Bridge API configured in the mobile app.

Are you sure HA and the bridge can communicate?

Yes, I can ping the Bridge from other devices and HA uses other Network devices. I also made a ping entity in HA to check if the Bridge is reachable - It is

Do you use proxies/vlans, etc.?

No, just a simple local network with IP range 192.168.178.0/24

If i type in http://192.168.178.xx:8080/auth and press the button on the Bridge I get {"success": true, "token": "xxxxxxx"}

domdal commented 1 year ago

I have found the error

in

https://github.com/kvj/hass_nuki_ng/blob/361ce9d0f1f6f36f60bcf5540eaee346fd53b241/custom_components/nuki_ng/config_flow.py#L39-L41

I added an opener a few days ago that does not have a name yet. Maybe add the ID as name if no name is provided. The error log message is also missleading.

The integration is now working, but I think an unconfigured device is not foreseen.

_Error setting up entry Opener for nuki_ng File "/config/custom_components/nuki_ng/nuki.py", line 343, in init webhook.async_register( TypeError: async_register() got an unexpected keyword argument 'localonly'

kvj commented 1 year ago

One thing:

Home Assistant 2021.12.10

Not sure that current nuki_ng should work on that version. It's heavily outdated

domdal commented 1 year ago

Yes you are right. I've updated HA to 2022.8.7 and now everything is working. Thanks everyone!

Nevertheless I would suggest this change -- https://github.com/kvj/hass_nuki_ng/issues/98#issuecomment-1232492370