u_u_u
(Ulrich Winkler)
August 20, 2020, 11:50am
1
Hi,
I want to buzz a door open using a Nuki Opener.
Here is what I get
curl "http://192.168.188.56:8080/list?token=abc"
Response
[{"deviceType": 2, "nukiId": 508330330, "name": "Julie Opener", "firmwareVersion": "1.3.1", "lastKnownState": {"mode": 2, "state": 1, "stateName": "online", "batteryCritical": false, "timestamp": "2020-08-20T10:28:30+00:00"}}, {"deviceType": 0, "nukiId": 536197236, "name": "Julie", "firmwareVersion": "2.6.4", "lastKnownState": {"mode": 2, "state": 3, "stateName": "unlocked", "batteryCritical": false, "doorsensorState": 2, "doorsensorStateName": "door closed", "timestamp": "2020-08-20T11:37:49+00:00"}}]
Than
curl "http://192.168.188.56:8080/unlock?nukiId=508330330&token=abc"
But that fails with a HTTP 404 Not Found
Also
curl "http://192.168.188.56:8080/lockAction?nukiId=508330330&action=1&token=abc"
gives me a 404.
So what do i miss?
1 Like
pego
(Peter)
August 20, 2020, 8:22pm
2
is this the IP of your bridge or of your opener?
I’m controlling the opener with my bridge with this command:
Activate RTO:
http://<ip_of_bridge>/lockAction?nukiId=<id_of_opener>&deviceType=2&action=1&token=<secret_token>
Here is a list of possible smart lock actions (chapter 6. Smart Lock Actions)
https://developer.nuki.io/page/nuki-web-api-1-3-0/3/#heading--smart-lock-action
If you want to activate the electrict strike, then this request will help you:
http://<ip_of_bridge>/lockAction?nukiId=<id_of_opener>&deviceType=2&action=3&token=<secret_token>
u_u_u
(Ulrich Winkler)
August 20, 2020, 9:39pm
3
Thxs Peter.
But no. I was using the bridge IP. That’s why I included the list
call
Any other ideas?
pego
(Peter)
August 20, 2020, 9:46pm
4
yep…you have to include the device type in your request. Otherwise the bridge will respond with a 404. see my examples for further details.
u_u_u
(Ulrich Winkler)
August 20, 2020, 9:51pm
5
That did the trick! Thxs!
In the docu the deviceType
is marked as optional - maybe somebody can fix that
Stephan
(Stephan Lendl)
August 21, 2020, 2:38pm
7
Thanks for the notice. I already fixed it in the HTML version (https://developer.nuki.io/page/nuki-bridge-http-api/4 ) and it will be also fixed in the next PDF version.
Correct is that the parameter defaults to 0 (for backward compatibility reasons with previously existing Bridge API integrations) if not provided, i.e. it will work for Smart Locks (deviceType=0), but throw the error you saw for a Nuki Opener (deviceType=2).