HTTP lock device handler (Nuki)

you can use old phone or a android tv box for the bridge part
using the nuki app from play store:

Thanks @volski
I have been trying that. Unfornunately, I canā€™t manage the web API to work.
Everything looks fine to me on nukiā€™s web

And I have been trying with a local http request (bridgeip:8080/list?token=123456789) and with hurlit

05

with the same result

27

What am I missingā€¦

Did you press the button within 30 sec after you initiated the request? From the manual:

When issuing this API-call the bridge turns on its LED for 30 seconds.
The button of the bridge has to be pressed within this timeframe.
Otherwise the bridge returns a negative success and no token.

Iā€™ve tried to use that while waiting on my bridge to arrive but stability is spotty at best. I tried a galaxy S8, Nexus 5 and Pixel. Are you using it?

Ok ā€¦ I found itā€¦
First I needed to activate API HTTP on mobile app (bridge setup mode).
Then I managed to get the nukiID with the information provided by the mobile app through a request : http://bridgeIP:port/list?token=token
All the information are provided by the nuki app

1 Like

yes I am using this on my front door
describe the issues you have, will try to fix it.

one thing that I cant solve is the interval for lock state update - smartthings allows minimal interval of 1 minute - so if I send a command to lock or unlock the door - the status can take up to a minute to update - will try to find a work around to try update faster.

I have wrttien 2 version of the nuki handler
first version uses http api
in the device handler you need to input the local ip of the bridge the port it uses (8080 - by default),token created within the app, and the nukiId
second version - that I use in my door - is the web api version
in the device handler you have two fields - first is the deviceID and second is the auth token that nuki web generates - only why I found seeing it is with a get request

It works great for me using the hardware bridge. I did had 2 locks on the soft bridge. Perhaps that was a problem. 1 would never update status (never the same)

finally it works with on time update of lock mode

Hi Thank you for this DH - I am very new to smartthings - a quick question - I have implemented your DH for my Nuki lock - The app reports back the data fine - But when in smartthings I unlock and lock the device although the status shows that it is unlocked or locked for that matter - Nukis own app does not change the status and shows as locked - if I unlock it from smartthings - I have not checked this at home yet as I am in the office doing this.

Would appreciate your advice - Thanks,

Just its DH is not talking to my Nuki lock

hi for this to work you need to create api token In the web nuki site
and then get the nukiID with the method I showed above using hurl.it site
after you have this both basically you can test the call also in the hurl.it site - if all is good you will get the correct json response from nuki api.

anther method of getting the nukiID - logging to your nuki account at:
https://web.nuki.io
click on your lock and you will be redirected to the lock page:
url looks like:
https://web.nuki.io/en/#/admin/smartlocks/XXXXXXX
where the XXXXXXX - is the nukiID - put this is the smartthings handler

next create token key again in the https://web.nuki.io
click on the gear icon on the top and select API
you will be redirected to:
https://web.nuki.io/en/#/admin/web-api
click on generate api token
in the opened window write a name for this token - DHnuki (example)
make sure to copy the whole token - incorrect token will not work.
and paste it in the device handler in smartthings under api_token
save it
and you will have control of the selected lock.
hope this helps

Hi I have done this and in hurl.it I do get the response from my lock - I dont see nuki ID - I see ā€œsmartlockIdā€: is this what you are referring to?

If thats the case I am getting the json response but in reality its not working for me - lock does not lock or unlock via smartthings

Done exactly as you mentioned but to no avail.

will need to see your log
try clearing the log
sending few times lock and unlock command from the app
and paste here the log
will try to help you solve this

BTW
do you have a bridge app or use the bridge device from nuki?

Sorry can I ask where do I get the log from? I have a Nuki Bridge device.

log in to your graph smartthings account
(the same place you have added the device handler)
on the top you have Live Logging click on it
try click in the app on lock ulock and you will see in the log the status of those commands

also what would I add in Device Network Id? could this be anything?

in my account I just put there ā€œDoorā€ it does not really matter