Nuki smart lock device handler

dth_locks

#1

I have created a device handler for the Nuki smart lock

controls the lock - and also updates the lock status if was changed from outside the Smartthings app - update interval is 1 minute.


(Ambres) #2

Volski,

sorry to bother you but i am a newbie!!!
How do i sync your handler with my smartthings???
sorry for my total ignorance
Ambres


#3

Basically you will copy the author’s code and paste it into your own account. The following FAQ describes the process (this is a clickable link)


(Rita El Khoury) #4

@volski I have a Nuki lock and I’m trying to set this up but I have no idea how to finish it. What I’ve done so far:

  1. Copied the text from github under the “nukiWebApiHandler.groovy” commit, which seemed to be the most recent.
  2. Created a new Device Handler for me in SmartThings with this code, but replaced “Enter you web API token here” with the API Token I generated here: https://web.nuki.io/en/#/admin/web-api (right column) and the “enter your NukiID” with my email for Nuki Web… seems like this is the ID to me.
  3. Published it for myself, so now I see it under My Device Handlers.
  4. Then I went to create a new Device in the dev interface, I gave it a name, Type simulated lock, version self published, location/hub/group done… but I have no idea what to put for the Device network ID.

Can you let me know if the steps I did were right and how I should continue?

Edit: well, that was easy. I just figured I’d try any Device Network ID, put in “nuki,” and it worked. I can see my lock’s state. I dare not unlock it now because I’m not home, but it’s cool to have it finally show up in SmartThings.


(Daniel Consuegra) #5

Out of all the files from your Github… which should we install? All of them?


(James Heath) #6

Hi,

I’ve followed Rita’s (guessed but really useful) instructions, which has got me some of the way…
I started with the ID set to my email, but I get “waiting” in grey where Rita gets “locked” in red.
(I waited till the net day)

Reading in here:


suggests that the NukiId should be a numeric, and it implies it starts at 1 and goes up with the number of locks.
I only have one, so I’ve set that to “1”…

but I still get "waiting"
Anyone got any pointers?

(when creating the API token, I only gave it read privileges - might that be an issue?)

Cheers,

James


#7

hi
first make sure you use the web api version:

second:

  1. log in to your account at web.nuki.io
    enable the api - and copy the token

  2. in the smartthings web console.
    click on the device name you have created
    and under Preferences click on edit
    you have two fields first is the api token you copied from nuki website
    and second is the device id the simplest way is this:
    go to https://www.hurl.it select the GET method copy to the Destination url: https://api.nuki.io/smartlock
    next add HEADERS - in the name field: Authorization and in the Value write: barer yourApiToken
    and click on the Launch Request
    if all is good you will get a json response with your locks
    if you have more then one you will need to create a device handler for each one.
    from the response json copy the value of smartlockId
    this is the needed value for the second filed from the device handler
    now click on save and you can control your lock!


#8

only this one:


(Daniel Consuegra) #9

Added! Just waiting for my Nuki to arrive to test it all out… Thanks!

Now… I feel like a newb with this Q but… what are the Owner, name and branch of the github for the integration? :blush:


#10

where are you trying to fill this fields?
on the device handler you just need you api token and the nuki lock id


(Daniel Consuegra) #11

in the github integration page in the api…

Here:


#12

you already have the repo there
in my console I dont have the repo option so when I added it i just copy paste the code
added detailed instructions:


(Daniel Consuegra) #13

I was refering to the automatic sync between the ST API and Github… just for reference, here are the 3 things needed… I think… correct me if I’m wrong…

Owner: volski
Name: Smartthing-nuki
Branch: master

as for the DH itself… I can’t wait to have the lock in my hands… Thanks for your work!!! Awesome!


#14

yes that is correct
:slight_smile:


(Rico Riedel) #15

Hey volski thanks for this incredible DH. But is there an way that the other states like lockngo i can see in the new ST app?? At the time i only see locked unlocked :slight_smile: