[OBSOLETE] Nuki smart lock device handler

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.

9 Likes

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

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)

@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.

Out of all the files from your Githubā€¦ which should we install? All of them?

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

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!

only this one:

1 Like

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:

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

1 Like

in the github integration page in the apiā€¦

Here:

Github%20integration

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:

1 Like

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!

yes that is correct
:slight_smile:

1 Like

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:

Hello, thanks for explanation but I canā€™t find a place to input the API Token generated?

do we have to input it in the code given by Volksi?
here ?
preferences {

    input("api_token","string",title:"Api Web Token",description:"Enter your web API token",required:true ,displayDuringSetup: true)

    input("nukiId","string",title:"nukiId",description:"Enter your nukiId",required:true ,displayDuringSetup: true)

Or is this something that appears afterwards?

hello, athanks for this but I canā€™t find any ā€œpreferencesā€ for the device name that I have created? Is this normal.
The Web Token API you have to input, is this a long string or the name you gave when creating the token?
where is this information to be filled in? re place the string indicated in bold in your code?

input(ā€œapi_tokenā€,ā€œstringā€,title:ā€œApi Web Tokenā€,description:ā€œEnter your web API tokenā€,required:true ,displayDuringSetup: true)

    input("nukiId","string",title:"nukiId",description:"Enter your nukiId",required:true ,displayDuringSetup: true)

Hi I got the same problem

There is no where this ā€œpreferencesā€ to add the API informationā€¦ any solution you found?

Thanks!

okay i solved it - copy the code NOT from the Browser but download the git code first before pasting, then it works (syntax/ copy issue otherwise)!!

I think the support of this DTH is dead!!!