Nuki Smart Lock 2.0 - support all available API actions (i.e. add lock/unlock)

Good catch, there was an error when batteries where in charging state. Are you using the new rechargable pack by Nuki?

I released v2.0 of the Nuki Card, with many changes that need to be tested (callback/webhook, and more sensors), let me know if it works for you. :slight_smile:

2 Likes

Hi Allessandro,

nope, I use Energizer Litium batteries.

Just configured it, it looks good and most does work, except for the door status.


Callback is defined and there is no entry in the log.
The door sensor (last entry) from the integration is working.

Sorry Joerge, I should have specified in the instructions that the first time you restart, the sensor is not initialized, so you have to trigger it opening/closing the door, so you have the first callback. I updated the instructions with a quick note about it. :slight_smile:

Regarding the recharging state of the batteries, I have code in place that changes the icon of the battery (strike symbol) if the batteryCharging flag reported by Nuki is true. I see your battery like this:

image

That means batteryCharging is true, and Nuki docs say this about it:

image

So when that flag is true, I use a battery icon with the strike symbol, otherwise, a plain battery icon with the charging level.

Let me know if the door sensor works when you open it the first time.

Guess its my fault. I assumed I had to open/close it at least once, but I had trouble in the beginning, because I registered two different callback and the second callback two times. :frowning:
So while testing I opened/closed door severall times, but after figuring out how to remove all callbacks and after starting from scratch, I forgot to do so.
It shows the door status now, thank you.

Regarding the batteries: yes, the api told they were charging, but as said, this are normal, but high capacity and long lasting, non-rechargeable batteries. I have no experience with them in the lock, but in a Blink cam they last one year.

I understand that the battery pack is only charged, when it falls under 75%.
Anyway, I changed the battery recognition settings in the app to Off and On again and now the charging state is false and the icon normal.

All good so far. Thanks again for your effort.

Hi,
Thank you for the nice work (and all others who worked on it).

All is running fine, including Battery Level, except door status. It is because I created a callback with a wrong IP, something as http://192.168.0.10:8123 when my HA server is reachable as https://ha.mydomain (redirected by my router to https//192.168.0.10:8123). If I try to create (re-create ?) a callback with this last https address, I get a “HTTP 400 Bad Request”. May be I have to delete (how ?) the existing callback ?

I tried to configure http://192.168.0.10:8123 as an internal URL in HA but I cannot reach my HA server this way.

1 Like

First, list command to show what you’ve done on the bridge:

http://192.168.1.50:8080/callback/list?token=123456

Second, delete all entries (id=0, id=1, etc.) with command delete:

http://192.168.1.50:8080/callback/remove?id=0&token=123456

Then add the correct callback:

curl -X GET -H "Content-Type: application/json" 'http://your_nuki_bridge_IP:8080/callback/add?token=your_NUKI_API_token&url=http://your_HA_IP:8123/api/webhook/your_long-term_webhook_id'

Glad it’s working also for you, enjoy it. :slight_smile:

Did you have the setting “rechargable” forced on? That would explain it. If I’m not mistaken, there’s an Auto setting, so the Nuki detects if the batteries are normal or rechargable.

Anyway, good that is working too. You’re all set now. :slight_smile:

Thank for the help !
The first command run fine and shows one entry (id=0) but something is wrong with the second command, I get “HTTP 401 Unauthorized”. By the way, this “%26” seems a little bit strange to me.

%26 means &

http://192.168.1.50:8080/callback/remove?id=0&token=123456

If you follow instructions of the original post, you can add the callback again.

The problem is that Nuki Bridge doesn’t support HTTPS, only HTTP. You need to use the INTERNAL IP on HTTP. If you hardened HA’s config to only accept HTTPS, you can’t use callbacks from Nuki Bridge. It only works on HTTP.

If you hardened HA’s config to only accept HTTPS […]

I configured an internal URL (http://192.168.0.10:8123) via the UI but I cannot connect to my HA server this way. What I have to do to “dis-hardened” my config ?

How di

How did you harden the configuration? Check those instructions and reverse them. It’s OT in this thread.

I will specify in the instructions for the card that it only works with HTTP because of Nuki Bridge limitation.

You are right !
Thank you for the help, I deleted the existing callback and I will check this http problem.

I thought so too, but it says

Automatisch (automatically)
Nuki Power Pack / Akkus (<- means rechargeables)

which I read as it will automatically been recognized and distinct between normal batteries and rechargeables.
But it seems its only good when using with rechargeables.

No problem, sorry if I answered so briefly, I was on the phone. :slight_smile:

Let me know when you solved it.

It should work like this:

  • Automatic detection enabled: you check the result, and see if it detects the batteries correctly, if not, you can disable it.

  • Automatic detection disabled: you have the option to specify what kind of batteries you’re using

Hm, this is somehow strange. I can’t uncheck either choice. When I have checked Lithium Batteries and enable “Automatically” it chows what I had checked before, even when it was Alkali but Lithium batteries are in.
Seems the detection is not really working.

So autodetection doesn’t detect lithium batt. but you can choose them manually, I would do that. Disable automatic detection and choose lithium.

image

1 Like

I have this problem (i try register 2 callback)

Any idea ?

Let me know when you solved it.

Solved setting a reverse-proxy (nginx).
Now I have status door ok.
Thanks !