I would like to add Nuki Smartlock into Smartthings. It is a bluetooth Smartlock that has a wifi bridge. Nuki have released the API to lock/unlock etc. They use REST api so it will be like http://192.168.0.2:8080/lockAction?nukiId=1&action=2&token=c8v7b6 to lock and http://192.168.0.2:8080/lockAction?nukiId=1&action=1&token=c8v7b6 to unlock. Is this possible to integrate to Smartthings? I would need a Device Handler and a SmartApp correct? Is there any example for device handler with REST api? I can only see zigbee and zwave examples.
Thanks for the links. But where do I enter the IP address and other details? I have copied device handler and smartapp and publish them for me. But when I run the SmartApp it doesn’t for IP, just asked for label name.
Have you created a button? Access the button, then click on the gear icon, then edit device. You will see the screen that allow you to enter the details.
The varCommand variable is the path correct? So the statement if (varCommand == “off”) will never be satisfied right?
And the actual HTTP POST command is executed in this loop or it is executed in the def hubAction = new physicalgraph.device.HubAction portion?
So can I remove the entire section from the code? It will not affect the on/off fuctionality right?
//sendEvent
if (varCommand == “off”){
sendEvent(name: “switch”, value: “off”)
log.debug “Executing OFF”
} else {
sendEvent(name: “switch”, value: “on”)
log.debug “Executing ON”
}
Ok, I am just trying to understand what that last part does, as it seems like it would always go to the else statement.
For me it doesn’t log either “Executing …” statement.
Hi, did you manage to integrate this and test it sucessfully in the end? I’m quite interested in this and would like to avoid having to buy the hub myself.
Many thanks
I have successfully integrated it to my Smartthings. However I am using the Nuki Bridge to talk to the Smartthings Hub. Without the Nuki Bridge the Nuki lock cannot talk to the Smartthings Hub as the Nuki Lock is using Bluetooth.
Hi @kaznad, I also have a Nuki Lock with bridge and am wondering if you could share your Device Handler code? Does it properly handle the lock/unlock status (displaying correctly locked or unlocked in smartthings) as well (in the event someone uses the physical button to lock/unlock, or the nuki app)?
Hi there…
I have 2 Nukis at home.
For now I have only been using IFTTT to connect Nuki and Smartthings, and a simulated switch on the ST side.
But a DH would be great !
Thanks @kaznad