diff --git a/NUKI-DEVELOPER-%7C-Nuki-Bridge-HTTP-API.md b/NUKI-DEVELOPER-%7C-Nuki-Bridge-HTTP-API.md index 6fda592..d59c871 100644 --- a/NUKI-DEVELOPER-%7C-Nuki-Bridge-HTTP-API.md +++ b/NUKI-DEVELOPER-%7C-Nuki-Bridge-HTTP-API.md @@ -1,5 +1,7 @@ # Nuki Bridge HTTP API V1.13.0 ### 30.11.2021 + + ## 1. Introduction The REST API on the Nuki Bridge offers simple endpoints to list all available Nuki Smart Locks and Nuki Openers, retrieve their current lock state and perform lock operations. ### 1.1 Abbreviations used @@ -11,6 +13,7 @@ The REST API on the Nuki Bridge offers simple endpoints to list all available Nu | lng | Lock 'n' Go | Unlock and lock again automatically | | rto | Ring to Open | Nuki Opener State in which ringing the bell activates the electric strike actuation | + ## 2. Calling URL This is the address used to call the available services of the internal webserver. @@ -77,4 +80,49 @@ http://192.168.1.50:8080/info?token=123456 http://192.168.1.50:8080/info?ts=2019-03-05T01:06:53Z&rnr=4711&hash=f52eb5ce382e356c4239f8fb4d0a87402bb95b7b3124f0762b806ad7d0d01cb6 A hashed token will only be valid with a sufficiently current timestamp and can not be reused, to prevent replay attacks. So making two calls with the exact same timestamp will only work with different random numbers. -To debug problems with non synchronous times you can check the current time on the bridge via bridge discovery \ No newline at end of file +To debug problems with non synchronous times you can check the current time on the bridge via bridge discovery + + +## 4 States and Actions +### 4.1 Device Types +Nuki device connected to the bridge. + +0 ... smartlock - Nuki Smart Lock 1.0/2.0 +2 ... opener - Nuki Opener +3 ... smartdoor - Nuki Smart Door +4 ... smartlock3 - Nuki Smart Lock 3.0 (Pro) + +### 4.2 Modes +| mode | smartlock | opener | Description | +| ---- | --------- | --------------- | ----------------------------------- | +| 2 | door mode | door mode | Operation mode after complete setup | +| 3 | - | continuous mode | Ring to Open permanently active | + +**Note:** Only modes 2 and 3 can appear in JSON elements, as the HTTP API is not available in the other modes. + +### 4.3 Lock States +Possible lock states (used in Endpoints below). +| ID | smartlock | opener | +| --- | ---------------------- | ---------- | +| 0 | uncalibrated | untrained | +| 1 | locked | online | +| 2 | unlocking | - | +| 3 | unlocked | rto active | +| 4 | locking | - | +| 5 | unlatched | open | +| 6 | unlocked (lock ‘n’ go) | - | +| 7 | unlatching | opening | +| 253 | - | boot run | +| 254 | motor blocked | - | +| 255 | undefined | undefined | + +### 4.4 Lock Actions +Possible lock actions (used in Endpoints below): +| ID | smartlock | opener | +| --- | ------------------------ | -------------------------- | +| 1 | unlock | activate rto | +| 2 | lock | deactivate rto | +| 3 | unlatch | electric strike actuation | +| 4 | lock ‘n’ go | activate continuous mode | +| 5 | lock ‘n’ go with unlatch | deactivate continuous mode | +