Using Nuki Lock 3.0 Fully Local without Bridge

You are welcome! Enjoy!

So I got it finally working, but I did a few mistakes.
First of all I had the internal WLAN enabled in my SL3.0 Pro which isn’t supposed to work with the Nuki Bridge or the Raspi Nuki Bridge together. It has to be the one or the other.
Next problem was the Bluetooth dongle. I now use an extension cable. I think this was the reason for better bluetooth connection. Finally I should have read the initial post more carefully about restarting the bridge after pairing. I couldn’t get the integration nuki ng setup without this restart.
And I also needed the

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps --format '{{.Names}}' | grep nuki)

to find the IP of my host. So I used 172.30.33.10 without port. That’s it

Many Thanks @victorigualada for your help and your patience.

1 Like

That’s great! I’m glad you mamaged to solve it!

Hey. I would appreciate some help here please.

I want to use HA (HAOS in rpi 3b+) with Nuki 3.0 without Nuki Bridge and Without Nuki 3.0 pro

Add-on: Nuki Bridge
Virtual Nuki Bridge to use instead of the physical device

Add-on version: 0.0.23
You are running the latest version of this add-on.
System: Home Assistant OS 9.4 (aarch64 / raspberrypi3-64)
Home Assistant Core: 2023.1.1
Home Assistant Supervisor: 2022.12.1

I can get the Access Token but when i put the details on Nuki-ng it fails saying
“Error communicating with Nuki bridge”.

In the Nuki ip address i have tried:

127.0.0.1
127.0.0.1:8080
172.30.33.4 »»» that’s the output of the
docker inspect -f ‘{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ $(docker ps --format ‘{{.Names}}’ | grep nuki)
172.30.33.4:8080

In the HA url i am using http://192.168.1.xx:8123 (this is how i access my HA so it must be correct

And in the Bridge Api Token i am pasting the Access Token retireved from the Nuki Bridge addon seconds ago.

Any help would be great. thanks

Did you try @Daniel76 solutions in his last comment? Using Nuki Lock 3.0 Fully Local without Bridge - #42 by Daniel76

Seems the same problem. Restart the Raspberry, and, since you have HAOS, use 127.0.0.1 if you haven’t changed the port or 127.0.0.1:<port> if you changed it in the addon config.

Yes i did. That’s why i tried those 4 combinations of ip address, 2 ip each one with and whithout port. I didn’t change anything so my port shall be the default one.
Maybe the problem can be related to nginx ssl addon? (just guessing)

It shouldn’t be related to nginx since it has nothing to do with communication between the HA instance and the containers running in it.

Unless you run rhe bridge in a different system than HA is running? In thay case you should use the local IP of the bridge (192.168.1.xxx)

Also did you restart the bridge? Did you disabled WiFi in the Lock if you use the 3.0 Pro version?

I don’t have a Nuki Bridge. I want to use HA (HAOS) as the bridge so i can use my Nuki 3.0 without having to buy the Nuki bridge.
Did i understood all wrong and i must have a Nuki Bridge?
It is Nuki 3.0 non-pro, so no wifi

Sorry when I said the bridge I meant the raspberry running the addon.

You don’t need the Nuki Bridge at all. You got right the purpose of the guide.

I would suggest to go through the guide again and see if you skipped a step. Also check the addon logs for errors and come back and post them if any.

I did several times with reboots and still no way to undertsand what is happening.
The only strange thin i have is afterit gets the token and after i try to use it on nuki-ng and fails, the log shows

2023-01-06 17:31:12.471|I|nuki.py:254|Waiting for more tasks with timeout
======== Running on http://0.0.0.0:8080 ========

Like an user post it before. Is that 0.0.0.0 expected?

Thanks

Did you see on the first start during the pairing process pairing completed?

********************************************************************
*                                                                  *
*                         Pairing completed!                       *
*                            Access Token                          *
* abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca *
*                                                                  *
********************************************************************

This is very important, because you will see it only once. I needed to do the pairing several times to be successful. If it is successful it takes only a few seconds, if not a minute or so.

Nope, never ever it shows Pairing completed. Only the token like this:

[services.d] starting services
[services.d] done.
2023-01-06 23:33:11.989|I|config.py:72|********************************************************************
2023-01-06 23:33:11.990|I|config.py:73|* *
2023-01-06 23:33:11.990|I|config.py:74|* Access Token *
2023-01-06 23:33:11.991|I|config.py:75|* [ 64 char token ] *
2023-01-06 23:33:11.992|I|config.py:76|* *
2023-01-06 23:33:11.992|I|config.py:77|********************************************************************
2023-01-06 23:33:12.026|I|nuki.py:254|Waiting for more tasks with timeout

The [64 char token] is like abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca

So I think the pairing wasn’t successful. I had to try it also several times. You can always see an access token. I had also to try several times before I could really pair the lock. I started with installing the add-on again and started again.

Tried several times with no success. Also tried the manual way, runing the python and i found out it can’t install all the dependencies, specificly pynacl that looks impossible to install. Don’t know if can be related or not.
The error is “ModuleNotFoundError: No module named ‘nacl’”

ciao, bella guida, pensavo di comprare il nuki lock quello bluetooth e collegarlo direttamente a home assistant, solo che nel mio server debian non ho la scheda bluetooth, mi consigliate una chiavetta bluetooth da aggiungerci specifica o ne va bene una qualsiasi?

That’s probably because the RPi is too far away from the lock. Remember that it works through Bluetooth and that its range is limited.

mine is less than 2m from the locker, with no obstacles between them.

Did you pair the lock first with your phone through thr Nuki app?

Yes i did.
One thing i notice is that only at the first attempt after install the addon it shows paired. All the next times it doesn’t show paired, only the token. So to get the paired message i must uninstall and install again every time

On the first try after installing the addon:

2023-01-07 20:18:51.893|I|nuki.py:254|Waiting for more tasks with timeout
2023-01-07 20:18:51.896|I|nuki.py:598|Last action: {‘status’: <StatusCode.COMPLETED: 0>}
2023-01-07 20:18:51.897|I|config.py:119|Pairing completed, auth_id: 0200ae03
2023-01-07 20:18:51.897|I|config.py:120|nuki_public_key: blablabla
2023-01-07 20:18:51.898|I|config.py:121|********************************************************************
2023-01-07 20:18:51.899|I|config.py:122|* *
2023-01-07 20:18:51.900|I|config.py:123|* Pairing completed! *
2023-01-07 20:18:51.900|I|config.py:124|* Access Token *
2023-01-07 20:18:51.901|I|config.py:125|* blablabla *
2023-01-07 20:18:51.902|I|config.py:126|* *
2023-01-07 20:18:51.903|I|config.py:127|********************************************************************

On the every next try:

[services.d] starting services
[services.d] done.
2023-01-07 20:20:25.905|I|config.py:72|********************************************************************
2023-01-07 20:20:25.906|I|config.py:73|* *
2023-01-07 20:20:25.906|I|config.py:74|* Access Token *
2023-01-07 20:20:25.907|I|config.py:75|* blablabla*
2023-01-07 20:20:25.907|I|config.py:76|* *
2023-01-07 20:20:25.908|I|config.py:77|********************************************************************
2023-01-07 20:20:25.967|I|nuki.py:254|Waiting for more tasks with timeout