With Nuki I found I can operate the lock by using fakeurl.com/action1 = close and fakeurl.com/action2 = open. I also can poll the lock status with faceurl.com/statuslockID1 etc. Is there a device handler that I can use with this info to operate the lock in ST?
hi
the handler is working
first make sure you have the latest version from GitHub - https://github.com/volski/Smartthing-nuki
next make sure you have enable http within the nuki bridge
to test that http works from your browser while being in the same lan as your bridge test the url: http://ipAdressOfBridge:8080/lockState?nukiId=YourNukiID&token=YourToken
a successful result will return a json as here:
{âstateâ: 3, âstateNameâ: âunlockedâ, âbatteryCriticalâ: false, âsuccessâ: true}
after this all works in the device handler make sure the the fields in the settings are correct.
Server IP Address - bridge ip
Server Port - bridge port (default is 8080)
URL Path for Lock - /lockAction?nukiId=YourNukiID&token=YourToken&action=1
URL Path for UnLock - /lockAction?nukiId=YourNukiID&token=YourToken&action=2
URL Path for LockNgo - /lockAction?nukiId=YourNukiID&token=YourToken&action=4
URL Path for Status - /lockState?nukiId=YourNukiID&token=YourToken
if all is correct and lock still not responding - time for looking at the log from the Smartthings
share your log I will try to help
*try deleting the working lock from the smartthings and check if the second lock is working (I think that I need to implement multiple locks within the same device handler otherwise each lock needs a separate device handler)
Thank you for looking into this. Deleting the working lock does not change the waiting state on the other. I deleted both locks then added the lock who had waiting state. This now works. As expected, when adding the seconds previous working lock this now remains in working state.
When looking at the live log when I refresh the state I get this error:
2:07:23 PM: error grails.validation.ValidationException: Validation Error(s) occurred during save():
Field error in object âphysicalgraph.device.Deviceâ on field âdeviceNetworkIdâ: rejected value [C0A85631:1F90]; codes [physicalgraph.device.Device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.error.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique.error,device.deviceNetworkId.unique.error.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.error.deviceNetworkId,device.deviceNetworkId.unique.error.java.lang.String,device.deviceNetworkId.unique.error,physicalgraph.device.Device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.deviceNetworkId,physicalgraph.device.Device.deviceNetworkId.unique.java.lang.String,physicalgraph.device.Device.deviceNetworkId.unique,device.deviceNetworkId.unique.physicalgraph.device.Device.deviceNetworkId,device.deviceNetworkId.unique.deviceNetworkId,device.deviceNetworkId.unique.java.lang.String,device.deviceNetworkId.unique,unique.physicalgraph.device.Device.deviceNetworkId,unique.deviceNetworkId,unique.java.lang.String,unique]; arguments [deviceNetworkId,class physicalgraph.device.Device,C0A85631:1F90]; default message [{0} must be unique]
Thanks @volski thatâs awesome
Thing is ⌠I canât figure out how to setup the parameters and moreover my 2 bridges have a local ip address
Can you please provide instructions in "newbie mode"
Thanks a lot
Greg
Thanks, I updated to the latest version but still had trouble until I figured out the ip needs to be numbers only xxx.xxx.xxx.xxx, I was using the DynDns version allowing access outside the home network.
Is there a way to allow web address for the server instead of only IP?
Also there seems to be a limit for the bridge on the frequency of GET request, and at some point it freezes. Have to pull it out and restart.
in the device handler you need to put the local address of your bridge .
as the communication goes from the smartthings to the nuki bridge, and they are normally both on the local network(same subnet).
so while using the smartthings app from the external network the lock will work normally as from within the local network.
while nuki lock is locking or unlocking the web server does not respond to status command, it can take up to 30 seconds to update the current lock status.
also can be done by press on the refresh button.
I am working on a new device handler that will work with nuki web api - but it is still not finished.
Hi @volski, I tried to install but get an error. Previous device handler and devices are removed.
Org.springframework.dao.DuplicateKeyException: a different object with the same identifier value was already associated with the session: [physicalgraph.device.CapabilityDeviceType#physicalgraph.device.CapabilityDeviceType : (unsaved)]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [physicalgraph.device.CapabilityDeviceType#physicalgraph.device.CapabilityDeviceType : (unsaved)]
Locks work great!! perhaps mention your handler to the nuki people so they can update the site that Smartthings is now supported? Thnx man! No more IFTTT madness
after that you need to create a device in the âmy devicesâ section in the smartthings web console.
once you have it 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!