LockV2
1.LockV2.fetchState
Fetch current status of device (Fetch the newest status of the device in the cache)
| Param | Value | Desc |
|---|---|---|
| method | LockV2.fetchState | Fetch newest status |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use |
| token | <String,Necessary> | Net token of the Lock you use |
| Param | Value | Desc |
|---|---|---|
| data.state.state.lock | <String,Necessary> | State of lock,["locked","unlocked"] |
| data.state.attributes.autoLock | <Integer,Necessary> | Auto lock duration in seconds, 0 is disable |
| data.state.attributes.enableSetButton | <Boolean,Necessary> | Enable set button |
| data.state.attributes.rlSet | <String,Necessary> | Left/Right open door["left","right"] |
| data.state.attributes.soundLevel | <Integer,Necessary> | Volume mute,low,medium,high [0-3] |
| data.state.battery | <Integer,Necessary> | Level of device's battery, 0 to 4 means empty to full |
| data.hwVersion | <String,Necessary> | Hardware Version of device |
| data.version | <String,Necessary> | Firmware Version of device |
| data.tz | <Integer,Necessary> | Timezone of device. -12 ~ 12 |
2.LockV2.getState
Get current status of device (Get the newest status from the device)
| Param | Value | Desc |
|---|---|---|
| method | LockV2.getState | Get current status |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use; |
| token | <String,Necessary> | Net token of the Lock you use; |
| Param | Value | Desc |
|---|---|---|
| data.state.lock | <String,Necessary> | State of lock,["locked","unlocked"]; |
| data.attributes.autoLock | <Integer,Necessary> | Auto lock duration in seconds, 0 is disable |
| data.attributes.enableSetButton | <Boolean,Necessary> | Enable set button |
| data.attributes.rlSet | <String,Necessary> | Left/Right open door["left","right"] |
| data.attributes.soundLevel | <Integer,Necessary> | Volume mute,low,medium,high [0-3] |
| data.battery | <Integer,Necessary> | Level of device's battery, 0 to 4 means empty to full |
| data.hwVersion | <String,Necessary> | Hardware Version of device |
| data.version | <String,Necessary> | Firmware Version of device |
| data.tz | <Integer,Necessary> | Timezone of device. -12 ~ 12 |
3.LockV2.setState
Lock\Unlock
| Param | Value | Desc |
|---|---|---|
| method | LockV2.setState | Lock/UnLock the door |
| targetDevice | <String,Necessary> | DeviceId of the device you use |
| token | <String,Necessary> | Net token of the device you use |
| params.state.lock | <String,Necessary> | Lock\Unlock state["locked","unlocked"] |
| Param | Value | Desc |
|---|---|---|
| data.state.lock | <String,Necessary> | State of lock,["locked","unlocked"] |
4.LockV2.setAttributes
Set lock attributes
| Param | Value | Desc |
|---|---|---|
| method | LockV2.setAttributes | Lock/UnLock the door |
| targetDevice | <String,Necessary> | DeviceId of the device you use |
| token | <String,Necessary> | Net token of the device you use |
| params.autoLock | <Integer,Optional> | Auto lock duration in seconds,0 is disable |
| params.rlSet | <String,Optional> | Left/Right open door["left","right"] |
| params.soundLevel | <Integer,Optional> | Volume mute,low,medium,high [0-3] |
| params.enableSetButton | <Boolean,Optional> | Enable set button |
| Param | Value | Desc |
|---|---|---|
| method | LockV2.setAttributes | Lock/UnLock the door |
| targetDevice | <String,Necessary> | DeviceId of the device you use |
| token | <String,Necessary> | Net token of the device you use |
| params.autoLock | <Integer,Necessary> | Auto lock duration in seconds,0 is disable |
| params.rlSet | <String,Necessary> | Left/Right open door ["left","right"] |
| params.soundLevel | <Integer,Necessary> | Volume mute,low,medium,high [0-3] |
| params.enableSetButton | <Boolean,Necessary> | Enable set button |
5.LockV2.userManagement
getTemporaryCredentials
| Param | Value | Desc |
|---|---|---|
| method | LockV2.userManagement | User management |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use |
| token | <String,Necessary> | Net token of the Lock you use |
| params.command | <String,Necessary> | User management command: getTemporaryCredentials |
| params.type | <String,Necessary> | Temporary credential type ["OneTime","RangeTime","PeriodTime"] |
| Param | Value | Desc |
|---|---|---|
| data.command | <String,Necessary> | User management command: getTemporaryCredentials |
| data.credentials[index].id | <Integer,Necessary> | CredentialId |
| data.credentials[index].cipher.type | <String,Necessary> | Credential cipher type ["password"] |
| data.credentials[index].cipher.secret | <String,Necessary> | Credential cipher secret, encoded with base64 |
| data.credentials[index].startAt | <Long,Optional> | Effective time timestamp in milliseconds, Available when type is "RangeTime" or "PeriodTime" |
| data.credentials[index].endAt | <Long,Optional> | Expiration time timestamp in milliseconds, Available when type is "RangeTime" or "PeriodTime" |
| data.credentials[index].effectivePeriod.type | <String,Necessary> | Effective period type ["disable","weekly","monthly"] |
| data.credentials[index].effectivePeriod.value | <String[],Optional> | Effective period value, if effective period type is "weekly" [0-6](Sunday to Saturday), if effective period type is "monthly" [1-31], Available when type is "PeriodTime" |
addTemporaryCredential
| Param | Value | Desc |
|---|---|---|
| method | LockV2.userManagement | User management |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use |
| token | <String,Necessary> | Net token of the Lock you use |
| params.command | <String,Necessary> | User management command: addTemporaryCredential |
| params.type | <String,Necessary> | Temporary credential type ["OneTime","RangeTime","PeriodTime"] |
| params.cipher.type | <String,Necessary> | Cipher type ["Password"] |
| params.cipher.secret | <Optional,Necessary> | Secret is required if cipher type is Password,encode with base64 |
| params.startAt | <Long,Optional> | Effective timestamp in milliseconds, Available when type is "RangeTime" or "PeriodTime" |
| params.endAt | <Long,Optional> | Expiration timestamp in milliseconds, Available when type is "RangeTime" or "PeriodTime" |
| params.effectivePeriod.type | <String,Necessary> | Effective period type ["disable","weekly","monthly"] |
| params.effectivePeriod.value | <String[],Optional> | Effective period value, if effective period type is "weekly" [0-6](Sunday to Saturday), if effective period type is "monthly" [1-31], Available when type is "PeriodTime" |
| params.effectiveStartTime | <String,Optional> | Effective start time is required if credential type is "PeriodTime", format with "H:m", Available when type is "PeriodTime" |
| params.effectiveEndTime | <String,Optional> | Effective end time is required if credential type is "PeriodTime", format with "H:m", Available when type is "PeriodTime" |
A maximum of 3 temporary passwords per type
| Param | Value | Desc |
|---|---|---|
| data.command | <String,Necessary> | User management command: addTemporaryCredential |
delTemporaryCredential
| Param | Value | Desc |
|---|---|---|
| method | LockV2.userManagement | User management |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use |
| token | <String,Necessary> | Net token of the Lock you use |
| params.command | <String,Necessary> | User management command: delTemporaryCredential |
| params.credentialId | <Integer,Necessary> | credentialId |
| Param | Value | Desc |
|---|---|---|
| data.command | <String,Necessary> | User management command: delTemporaryCredential |
getUserList
| Param | Value | Desc |
|---|---|---|
| method | LockV2.userManagement | User management |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use |
| token | <String,Necessary> | Net token of the Lock you use |
| params.command | <String,Necessary> | User management command: getUserList |
| Param | Value | Desc |
|---|---|---|
| data.command | <String,Necessary> | User management command: getUserList |
| data.users[index].id | <Integer,Necessary> | UserId |
index from "0" to "11"
delUser
| Param | Value | Desc |
|---|---|---|
| method | LockV2.userManagement | User management |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use |
| token | <String,Necessary> | Net token of the Lock you use |
| params.command | <String,Necessary> | User management command: delUser |
| params.userId | <Integer,Necessary> | UserId |
| Param | Value | Desc |
|---|---|---|
| data.command | <String,Necessary> | User management command: delUser |
getUserCredentials
| Param | Value | Desc |
|---|---|---|
| method | LockV2.userManagement | User management |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use |
| token | <String,Necessary> | Net token of the Lock you use |
| params.command | <String,Necessary> | User management command: getUserCredentials |
| params.userId | <Integer,Necessary> | UserId |
| Param | Value | Desc |
|---|---|---|
| data.command | <String,Necessary> | User management command: getUserCredentials |
| data.credentials[index].id | <Integer,Necessary> | CredentialId |
| data.credentials[index].cipher.type | <String,Necessary> | Cipher type ["Fingerprint","Card","Fob","Code"] |
| data.credentials[index].cipher.secret | <Optional,Necessary> | Secret is required if cipher type is Code |
| data.credentials[index].startAt | <Long,Necessary> | Effective timestamp milliseconds |
| data.credentials[index].endAt | <Long,Necessary> | Expiration timestamp milliseconds |
| data.credentials[index].effectivePeriod.type | <String,Necessary> | Effective period ["disable","weekly","monthly"] |
| data.credentials[index].effectiveStartTime | <String,Necessary> | Effective start time; H:m |
| data.credentials[index].effectiveEndTime | <String,Necessary> | Effective end time ; H:m |
| data.credentials[index].effectiveTimes | <Integer,Necessary> | Effective times |
addUserCredential
| Param | Value | Desc |
|---|---|---|
| method | LockV2.userManagement | User management |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use |
| token | <String,Necessary> | Net token of the Lock you use |
| params.command | <String,Necessary> | User management command: addUserCredential |
| params.userId | <Integer,Necessary> | UserId |
| params.cipher.type | <Optional,Necessary> | Cipher type ["Fingerprint","Card","Fob","Code"] |
| params.cipher.secret | <String,Necessary> | Secret is required if cipher type is Code, length[4-8] encode with base64 |
| params.effectivePeriod.type | <String,Necessary> | Effective period ["disable","weekly","monthly"] |
| params.effectiveStartTime | <String,Necessary> | Effective start time, H:m |
| params.effectiveEndTime | <String,Necessary> | Effective end time, H:m |
| params.effectiveTimes | <Integer,Necessary> | Effective times, 0 is no limits |
| Param | Value | Desc |
|---|---|---|
| data.command | <String,Necessary> | User management command: addUserCredential |
| data.credentials[index].id | <Integer,Necessary> | CredentialId |
| data.credentials[index].cipher.type | <String,Necessary> | cipher type ["Fingerprint","Card","Fob","Code"] |
delUserCredential
| Param | Value | Desc |
|---|---|---|
| method | LockV2.userManagement | User management |
| targetDevice | <String,Necessary> | DeviceId of the Lock you use |
| token | <String,Necessary> | Net token of the Lock you use |
| params.command | <String,Necessary> | User management command: delUserCredential |
| params.userId | <Integer,Necessary> | UserId |
| params.credentialId | <Integer,Necessary> | User credentialId |
| params.cipherType | <Optional,Necessary> | Cipher type ["Fingerprint","Card","Fob","Code"] |
| Param | Value | Desc |
|---|---|---|
| data.command | <String,Necessary> | User management command: delUserCredential |