Bluetooth Lock API

Last Updated on : 2023-11-14 02:48:31download

Use TYSdk.apiRequest to make API requests.

Member management

Members are classified into home members and panel members. If a method’s name contains the word member, it indicates that the method applies to both the home member and panel member.

Get the list of home members

API name

tuya.m.device.member.list

Version

4.0

Request parameters

Name Type Description Required
devId String The device ID. Yes

Sample request

{
 "devId" : "25230882b4e62d61b52a",
}

Return parameters

Name Type Description
userId String The member ID.
lockUserId Integer The ID of the lock user. When the value is 0, request the parameter manually.
nickName String The username.
avatarUrl String The URL of the avatar.
userContact String The contact method.
userType String The type of user.
  • 10: Admin
  • 20: Common member
  • 30: Panel member
productAttribute Integer The permission attribute of the product. 1 indicates time-limited access.
supportOpenType supportOpenType[] The supported unlocking method.
userTimeSet String The validity period of the user. Base64-encoded data needs to be decoded.
status Integer Status
  • 0: Invalid
  • 1: Valid
  • 2: Pending join

The type of supportOpenType

  • Dynamic password
  • Unlock over Bluetooth
  • Unlock with fingerprint
  • Unlock with password
  • Unlock with card
  • Unlock with face recognition
  • Unlock with Bluetooth key

Sample response

{
  "result": [{
      "userId": "1",
      "lockUserId":0,
      "userContact":"86-13757150532",
      "nickName": "nicky",
      "avatarUrl": "",
      "userType" : "1",
      "supportOpenType":[],
      "productAttribute": 1,
      "userTimeSet":"base64",
      "status": 0
  }],
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Get the list of panel members

API name

tuya.m.device.member.panel.list

Version

5.0

Request parameters

Name Type Description Required
devId String The device ID. Yes

Return parameters

Name Type Description
userId String The member ID.
lockUserId Integer The ID of the lock user. When the value is 0, request the parameter manually.
nickName String The username.
avatarUrl String The URL of the avatar.
userContact String The contact method.
userType String The type of user.
  • 10: Admin
  • 20: Common member
  • 30: Panel member
shareUser String The shared user.
shareRelationId Integer The sharing-associated ID.
supportOpenType supportOpenType[] The supported unlocking method.
productAttribute Integer The permission attribute of the product. 1 indicates time-limited access.
userTimeSet String The validity period of the user. Base64-encoded data needs to be decoded.
status Integer Status
  • 0: Invalid
  • 1: Valid
  • 2: Pending join

The type of supportOpenType

  • Dynamic password
  • Unlock over Bluetooth
  • Unlock with fingerprint
  • Unlock with password
  • Unlock with card
  • Unlock with face recognition
  • Unlock with Bluetooth key

Sample response

{
    "result": [{
        "userId": "1",
        "lockUserId":0,
        "userContact":"86-13757150532",
        "nickName": "nicky",
        "avatarUrl": "",
        "userType" : "1",
        "shareUser": "Account - Phone number",
        "shareRelationId":0,
        "supportOpenType":[],
        "productAttribute": 1,
        "userTimeSet":"base64",
        "status":0
    }],
    "t": 1550562572623,
    "success": true,
    "status": "ok"
}

Get details of the logged-in user

API name

tuya.m.device.member.get

Version

2.0

Request parameters

Name Type Description Required
devId String The device ID. Yes

Sample request

{
 "devId" : "25230882b4e62d61b52a",
}

Return parameters

Name Type Description
userId String The member ID.
lockUserId Integer The ID of the lock user. When the value is 0, request the parameter manually.
nickName String The username.
avatarUrl String The URL of the avatar.
userType String The type of user.
  • 10: Admin
  • 20: Common member
  • 30: Panel member
supportOpenType supportOpenType[] The supported unlocking method.
allOpenType allOpenType[] All the permissions supported by the current lock.
productAttribute Integer The permission attribute of the product. 1 indicates time-limited access.
phase Integer The freeze status:
  • 0: Frozen
  • 1: Normal
status Integer Status
  • 0: Invalid
  • 1: Valid
  • 2: Pending join

The type of supportOpenType

  • Dynamic password
  • Unlock over Bluetooth
  • Unlock with fingerprint
  • Unlock with password
  • Unlock with card
  • Unlock with face recognition
  • Unlock with Bluetooth key

Sample response

{
  "result": {
      "userId": "1",
      "lockUserId":0,
      "nickName": "nicky",
      "avatarUrl": "",
      "userType" : "10",
      "supportOpenType":[],
      "allOpenType":[],
      "productAttribute": 1,
      "status":0
      "phase": 1
  },
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Add a panel member

API name

tuya.m.device.member.add

Version

3.0

Parameters

Name Type Description Required
devId String The device ID. Yes
userName String The username. Yes
avatar String The URL of the avatar. No
opMode String The unlocking method. No
timeSet String The access validity, in hexadecimal format. No
timeType Int The type of validity period.
  • 10: Permanent
  • 20: Timed
  • 30: Recurring
No

Sample request

{
 "devId" : "25230882b4e62d61b52a",
 "userName" : "tuya",
 "timeType" : 10
}

Sample response

{
    "result": true,
    "t": 1550562572623,
    "success": true,
    "status": "ok"
}

Delete a panel member

API name

tuya.m.device.member.remove

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. No
userId String The member ID. No

Sample request

{
 "devId" : "25230882b4e62d61b52a",
 "userId" : "3765529",
}

Sample response

{
    "result": true,
    "t": 1550562572623,
    "success": true,
    "status": "ok"
}

Edit a panel member

API name

tuya.m.device.member.update

Version

3.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userName String The username. Yes
avatar String The URL of the avatar. No
opMode String The supported unlocking method. No
timeSet String The access validity, in hexadecimal format. No
timeSetType String The type of validity period.
  • 10: Permanent
  • 20: Timed
  • 30: Recurring
Yes
timeZone String The time zone. No
userId String The user ID. Yes

Sample response

{
    "result": true,
    "t": 1550562572623,
    "success": true,
    "status": "ok"
}

Upgrade a panel member to home member

API name

tuya.m.device.member.upgrade

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userId String The member ID. Yes

Sample request

{
 "devId" : "25230882b4e62d61b52a",
 "userId" : "3765529",
}

Sample response

{
    "result": true,
    "t": 1550562572623,
    "success": true,
    "status": "ok"
}

Query the unlocking method for a member (permission and validity)

API name

tuya.m.device.member.opmode.get

Version

2.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userId String The user ID. Yes

Sample request

{
 "devId" : "25230882b4e62d61b52a",
 "userId" : "3765529",,
}

Sample response

{
  "result": {
      "dpSet": [{
          "dpId": 1,
          "status": 0
      }, {
          "dpId": 2,
          "status": 0
      }, {
          "dpId": 3,
          "status": 0
      },],
      "timeset": {
          "type": "1",
          "timeZone":"+8:00"
          "settings": ""
      }
  },
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Query the number of unlocking methods granted to a member

API name

tuya.m.device.member.opmode.preview

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userId String The user ID. Yes

Return parameters

Name Type Description
dpId String The DP ID.
count String The number of unlocking methods.

Sample response

{
  "result":[{
          "dpId": 1,
          "count": 0
      }, {
          "dpId": 2,
          "count": 0
      }, {
          "dpId": 3,
          "count": 0
      },],
  "t":1573024513335,
  "success": true,
  "status":"ok"
}

Query details of a specific member

API name

tuya.m.device.member.detail

Version

4.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userId String The user ID. Yes

Return parameters

Name Type Description
userId String The member ID.
avatarUrl String The URL of the avatar.
userContact String The user account.
unlockList String[] The list of unlocking methods assigned to the member.
userType String The type of user.
  • 10: Admin
  • 20: Common member
  • 30: Panel member
supportOpenType supportOpenType[] The supported unlocking method.
nickName String The nickname of the user.

The type of supportOpenType

  • Dynamic password
  • Unlock over Bluetooth
  • Unlock with fingerprint
  • Unlock with password
  • Unlock with card
  • Unlock with face recognition
  • Unlock with Bluetooth key

Sample response

{
  "result": {
      "userId":"0001a",
      "avatarUrl":"",
      "userContact":"86-xxxx",
      "unlockList":[
          "Fingerprint 1",
          "Fingerprint 2",
          "Password-1"
      ]
  },
  "t":1573024513335,
  "success": true,
  "status":"ok"
}

Add an unlocking method

API name

tuya.m.device.member.opmode.add

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userId String The ID of the device user. Yes
unlockId String The actual value of the unlocking method. This value is obtained by combining the unlocking method and the ID of the unlocking method. For example, 1-2 indicates that the unlocking method is 1 and the user is 2. No
unlockName String The name of the unlocking method, which can be empty. If the value is empty, the naming convention is opmode value + _ + current quantity. No

Sample response

{
  "result": null,
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Change the name of an unlocking method

API name

tuya.m.device.member.opmode.update

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
opmodeId Integer The actual value of the unlocking method, which is the opmodeId field in the list of unlocking methods. Yes
unlockName Integer The name of the unlocking method, which can be empty. If the value is empty, the naming convention is opmode value + _ + current quantity. Yes

Sample response

{
  "result": true,
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Change the property of an unlocking method

API name

tuya.m.device.member.opmode.phase

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userId String The user ID. Yes
operate Integer The operation.
  • 0: Freeze
  • 1: Unfreeze
Yes

Sample response

{
  "result": true,
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Get the list of unlocking methods

API name

tuya.m.device.member.opmode.list

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userId String The ID of the device user. Yes
opmode String The unlocking method. Yes
unlockName String The name of the unlocking method, which can be empty. If the value is empty, the naming convention is opmode value + _ + current quantity. Yes

Return parameters

Name Type Description
devId String The device ID.
userId String The ID of the device user.
opmodeId String The opmodeId field in the list of unlocking methods.
opmode String The unlocking method.
opmodeValue Integer The value of the unlocking method.
unlockName String The name of the unlocking method.
unlockStatus String The status of the unlocking method.
  • 10: To be valid.
  • 20: Valid.
  • 30: Creation failed.
phase Integer Status
  • 1: Normal
  • 3: Frozen

Sample response

{
  "result" : [{
    devId: 'xxx',
    userId: 'xxx',
    opmodeId: '',
    opmode: '',
    opmodeValue: '',
    unlockStatus: 10,
    phase: 1
}],
  "t" : 1550562572623,
  "success" : true,
  "status" : "ok"
}

Delete a single unlocking method

API name

tuya.m.device.member.opmode.remove

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userId String The ID of the device user. Yes
opmodeId Integer The actual value of the unlocking method, which is the opmodeId field in the list of unlocking methods. Yes

Sample response

{
  "result": null,
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Bind a shared panel user

API name

tuya.m.device.member.share.add

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
countryCode String The country code. Yes
userAccount String The user account, which can be a phone number or email address. Yes
shareUserId String The ID of the panel user to be bound. Yes

Sample response

{
  "result": true,
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Remove a shared panel user

API name

tuya.m.device.member.share.remove

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
shareUserId String The ID of the panel user. Yes

Sample response

{
  "result": true,
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Get the ID of a lock user

API name

tuya.m.device.member.lockid

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
userId String The user ID. Yes

Sample response

{
  "result": 12,
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Temporary password

  • An offline password can be generated even when the device is offline. Password generation uses the cloud method.
  • An online password is generated after the lock and mobile app exchange DP data.

Get a dynamic password

API name

tuya.m.device.lock.dynapwd.get

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes

Sample response

{
  "result": {
      "dynamicPassword": "73298526"
  },
  "t": 1556342684081,
  "success": true,
  "status": "ok"
}

Verify the availability of an offline temporary password

API name

tuya.m.device.lock.offlinepwd.available

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
pwdType String The type of the password.
  • 0: Time-limited password
  • 1: One-time password
  • 8: Code to clear a specific password
  • 9: Code to clear all passwords
Yes

Sample request

{
  "devId" : "vdevo158462399359867"
  "pwdType" : "0"
}

Sample response

{
  "result" : true,// Indicate whether the password is available.
  "t" : 1565874044056,
  "success" : true,
  "status" : "ok"
}

Get an offline temporary password

API name

tuya.m.device.lock.offlinepwd.get

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
pwdType String The type of the password.
  • 0: Time-limited password
  • 1: One-time password
  • 9: Code to clear all passwords
Yes
gmtStart Integer The start time. Set it to 0 if the password is not time-limited. No
gmtExpired Integer The end time. Set it to 0 if the password is not time-limited. No
pwdName String The name of the password. No

Sample request

{
  "devId" : "vdevo158462399359867"
  "pwdType" : "1"
  "gmtStart" : "1568001081"
  "gmtExpired" : "1578001081"
}

Sample response

{
  "result" : {
    "pwd":"1234567890",
    "pwdId": "3234"
  },// The offline temporary password
  "t" : 1565874044056,
  "success" : true,
  "status" : "ok"
}

Get the clearing code for time-limited passwords

API name

tuya.m.device.lock.offlinepwd.revoke

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
pwdId String The ID of the offline password. Yes

Sample request

{
  "devId" : "vdevo158462399359867"
  "pwdId" : "1"
}

Sample response

{
  "result" : {
    pwd: '', // The clearing code
    pwdId: '',
}
  "t" : 1565874044056,
  "success" : true,
  "status" : "ok"
}

Modify the name of an offline temporary password

API name

tuya.m.device.lock.offlinepwd.name.update

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
pwdId Integer The ID of the password. Yes
pwdName String The name of the password. Yes

Sample request

{
  "devId" : "vdevo158462399359867"
  "pwdId" : "1",
  "pwdName": "Password name 1",
}

Sample response

{
  "result" : null,
  "t" : 1565874044056,
  "success" : true,
  "status" : "ok"
}

Get the list of offline temporary passwords

API name

tuya.m.device.lock.offlinepwd.list

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
pwdType String The type of the password.
  • 0: Time-limited password
  • 1: One-time password
  • 9: Code to clear all passwords
Yes
status Integer Status
  • 0: Invalid
  • 1: Valid
No
offset Integer The number of the entry starting from which entries are returned. No
limit Integer The number of entries returned on each page. No

Sample request

{
  "devId" : "vdevo158462399359867"
  "pwdType" : "1"
  "status" : 1,
  "offset" : 0,
  "limit" : 50,
}

Return parameters

Name Type Description
pwdId Integer The ID of the password.
pwdType String The type of the password.
pwdName String The name of the password.
gmtStart Integer The start time.
gmtExpired Integer The end time.
hasClearPwd Boolean Indicates whether a clearing code has been set.
revokedPwdName String The name of the password to be cleared.
status Integer Status
  • 0: Issued
  • 1: Valid
  • 2: Issued successfully
  • 3: Expired

Sample response

{
  "result" : [{
    "pwdId": 123123,
    "pwdName": "Password name 1",
    "pwdType":0,
    "gmtStart":"1565874044",
    "gmtExpired":"1575874044",
    "hasClearPwd":false
  },{
    "pwdId": 23456,
    "pwdName": "The clearing code (delete single password)",
    "pwdType":8,
    "gmtStart":"1565874044",
    "gmtExpired":"1575874044",
    "revokedPwdName", "Password name 1"
  },
  {
    "pwdId": 23456,
    "pwdName": "The empty code (delete all passwords)",
    "pwdType":9,
    "gmtStart":"1565874044",
    "gmtExpired":"1575874044"
  }],
  "t" : 1565874044056,
  "success" : true,
  "status" : "ok"
}

Get the list of time-limited passwords that can be assigned a clearing code

API name

tuya.m.device.lock.offlinepwd.revocable

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. No

Sample request

{
  "devId" : "002000015ccf7f0f3c7d"
}

Sample response


{
  "result" : [{
    "pwdId": 012123123,
    "pwdName": "Password name 1",
    "gmtStart":"1565874044",
    "gmtExpired":"1575874044",
  },{
    "pwdId": 083232389,
    "pwdName": "Time-limited password 1",
    "gmtStart":"1565874044",
    "gmtExpired":"1575874044"
  }],
  "t" : 1565874044056,
  "success" : true,
  "status" : "ok"
}

Get the list of online temporary passwords

API name

tuya.m.device.lock.temppwd.list

Version

3.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
availTime Integer The number of times the password can be used.
  • 0: Permanent
  • 1: One-time
If this parameter is not passed, all available temporary passwords under the device will be displayed.
No

Sample request

{
  "devId" : "6cc1483v89yz1t8o",
}

Return parameters

Name Type Description
id Integer The ID.
name String The name of the password.
effective Integer Password status.
  • 1: To be valid
  • 2: To be issued
  • 3: In use
  • 4: To be deleted
  • 5: Expired
scheduleDetails String The schedule data in the JSON format.
phone String The phone number.
countryCode String The country code.
effectiveTime Long The start time.
invalidTime Long The end time.
availTime Integer The number of times the password can be used.
  • 0: Permanent
  • 1: One-time

Sample response

{

    "result": [{
        "id": 11,
        "effective": 3,
        "effectiveTime": 111,
        "invalidTime": 333,
        "name": "name",
        "phone": "phone",
        "scheduleDetails": [{
            "allDay": true,
            "effectiveTime": 720,
            "invalidTime": 1080,
            "workingDay": 8 // The days of the week are represented with one byte, with bit0 to bit6 for Sunday to Saturday.
        }],
    }],
     "t": 1550562572623,
     "success": true,
     "status": "ok"
}

Verify the availability of an online temporary password

API name

tuya.m.device.lock.temppwd.validate

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
password String The temporary password. Yes
schedule String The schedule data in the JSON format. No
phone String The phone number. No
countryCode String The country code. No
effectiveTime Long The start time. Yes
name String The name. No
invalidTime Long The end time. Yes

Sample response

{
  "result" : true,// Indicate whether the password is available.
  "t" : 1565874044056,
  "success" : true,
  "status" : "ok"
}

Add an online temporary password

API name

tuya.m.device.lock.temppwd.create

Version

5.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
password String The temporary password. Yes
schedule Integer The schedule data in the JSON format. No
phone String The phone number. No
countryCode String The country code. No
effectiveTime Long The start time. Yes
invalidTime Long The end time. Yes
name String The name of the password. Yes
availTime Integer The number of times the password can be used.
  • 0: Permanent
  • 1: One-time
No
sn Integer The ID of the temporary password, which is reported by the device. No

Sample request

{
  "devId" : "vdevo158313195425051"
  "countryCode" : "86",
  "availTime" : 1,
  "invalidTime" : 1588133004,
  "name" : "Time zone verification 4.0",
  "effectiveTime" : 1588132904,
  "schedule":"",
  "phone" : "15158064461",
  "password" : "2E478FEBBDBE029F9B091FDC9E5CB8F9",
}

Example of the schedule data

[{

    "allDay": true, // Valid all day or not.
    "effectiveTime": 720, // Start time.
    "invalidTime": 1080, // End time.
    "workingDay":   // The days of the week are represented with one byte, with bit0 to bit6 for Sunday to Saturday.
}, {

    "allDay": true,
    "effectiveTime": 720,
    "invalidTime": 1080,
    "workingDay": 3
}]

Sample response

{
  "result":true,
  "t":1589370119582,
  "success":true,
  "status":"ok"
}

Modify an online temporary password

API name

tuya.m.device.lock.temppwd.update

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
password String The temporary password. Yes
schedule String The schedule data in the JSON format. No
phone String The phone number. No
countryCode String The country code. No
effectiveTime Long The start time. Yes
availTime Integer The number of times the password can be used.
  • 0: Permanent
  • 1: One-time
No
name String The name. No
invalidTime Long The end time. Yes

Example of the schedule data

[{

    "allDay": true, // Valid all day or not.
    "effectiveTime": 720, // Start time.
    "invalidTime": 1080, // End time.
    "workingDay":   // The days of the week are represented with one byte, with bit0 to bit6 for Sunday to Saturday.
}, {

    "allDay": true,
    "effectiveTime": 720,
    "invalidTime": 1080,
    "workingDay": 3
}]

Delete an online temporary password

API name

tuya.m.device.lock.temppwd.remove

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
pwdId Integer The ID of the unlocking method. Yes

Sample request

{
  "devId" : "6cc1483v89yz1t8o",
  "pwdId" : 2,
}

Sample response

{
    "result":true,
    "t":1589370119582,
    "success":true,
    "status":"ok"
}

History

Query unlocking records

API name

tuya.m.device.lock.history.list

Version

2.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
dpIds String The DP to be queried. Multiple DPs are separated by commas (,). Yes
offset Integer The number of the entry starting from which entries are returned. Yes
limit Integer The number of entries returned on each page. Yes

Sample request

{
  "devId" : "vdevo158462399359867",
}

Sample response

{
  "result" :[]
  "t" : 1584625900575,
  "success" : true,
  "status" : "ok"
}

Query unlocking alerts

API name

tuya.m.device.lock.alarm.list

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
dpIds String The DP to be queried. Multiple DPs are separated by commas (,). Yes
offset Integer The number of the entry starting from which entries are returned. Yes
limit Integer The number of entries returned on each page. Yes

Sample request

{
  "devId" : "vdevo158462399359867",
}

Sample response

{
  "result" :[]
  "t" : 1584625900575,
  "success" : true,
  "status" : "ok"
}

Generic methods

Check if the speaker password is enabled

API name

tuya.m.device.lock.voice.pwd.flag

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes

Sample request

{
  "devId" : "vdevo158462399359867",
}

Sample response

{
  "result" : true, // Indicate whether to enable the feature. False is returned on error.
  "t" : 1584625900575,
  "success" : true,
  "status" : "ok"
}

Set or cancel a speaker password

API name

tuya.m.device.lock.voice.pwd.setting

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
open Boolean Specifies whether to enable the speaker password. Yes
pwd String The AES encrypted password. Yes

Sample request

{
  "devId" : "vdevo158462399359867",
  "open":true,
  "pwd":"13A63549D7B5272BAF871725219BE325"
}

Sample response

{
  "result" : true, // Indicate whether the password is added. True is returned on success.
  "t" : 1584625900575,
  "success" : true,
  "status" : "ok"
}

Enable/disable remote unlocking (device property)

API name

tuya.m.device.props.fetch

Version

2.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
props Integer The property. Set the remote unlocking property to UNLOCK_PHONE_REMOTE. Multiple properties are separated by commas (,). Yes

Sample request

{
  "devId":"6cc81b7b8fd97fe00fguh2",
  "props":"\"UNLOCK_PHONE_REMOTE\""
}

Sample response

{
  "UNLOCK_PHONE_REMOTE":"true"
}

Remote unlocking (via gateway)

API name

tuya.m.zigbee.lock.remotepwd.execute

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
open Boolean Specifies whether to unlock the door. Yes

Sample request

{
  "devId" : "6c55ebafjnvtwvrr"
  "open": true
}

Sample response

{
  "result" : "1586525839",
  "t" : 1586529530200,
  "success" : true,
  "status" : "ok"
}

Get the device activation time

API name

tuya.m.device.opmode.sync.rise

Version

2.0

Request parameters

Name Type Description Required
devId String The device ID. Yes
dpIds Integer[] The DP ID. Yes

Sample request

{
  "devId" : "6c55ebafjnvtwvrr",
  "dpId" : [12,13]
}

Sample response

{
  "result": {
      "ins": "010003fd02fd05fd040006fd08fd07fd09fd", // A string to verify the unlocking method.
      "distributed": true, // Only when this value is true can a synchronous command be initiated.
      "dpId":54, // The DP sent to the device.
  },
  "t": 1550562572623,
  "success": true,
  "status": "ok"
}

Get the device activation days

API name

tuya.m.device.active.date

Version

1.0

Request parameters

Name Type Description Required
devId String The device ID. Yes

Sample request

{
  "devId" : "6c55ebafjnvtwvrr"
}

Sample response

{
  "result" : "1586525839",
  "t" : 1586529530200,
  "success" : true,
  "status" : "ok"
}