Last Updated on : 2025-07-17 02:23:39download
The integration of the WeChat ecosystem is rather complex. Developers need to be familiar with the corresponding technologies and have relevant integration experience. Therefore, it’s suggested to contact Tuya for consultation and assessment before deciding whether to start the SDK development.
The @ray-js/wechat-ms-log
SDK integrates capabilities that enable users to get the latest log or all logs through the lock miniapp.
yarn add @ray-js/wechat-ms-log
// or
npm install @ray-js/wechat-ms-log
getLogList
Request parameters
Parameter | Type | Description | Required |
---|---|---|---|
device_id | string | The device ID. | true |
start_time | number | The start time. If there is no time limit, set it to 0. | true |
end_time | number | The end time. If there is no time limit, set it to 0. | true |
user_ids | string | The user ID of a home member. | false |
log_categories | string | The log category. Valid values:
|
false |
last_row_key | string | The key of the last record in the previous query. This parameter is returned for the previous query and is not required in the first query. | false |
page_size | number | The number of records to return per page. The maximum value is 100. | false |
only_show_media_record | boolean | Specifies whether to include images. Valid values:
|
false |
Response parameters
Parameter | Type | Description |
---|---|---|
has_more | boolean | Indicates whether more data exists. |
last_row_key | string | The key of the last record in the previous query. |
records | IResult[] |
The list of results. |
Description of IResult
Parameter | Type | Description |
---|---|---|
current_user | boolean | Indicates whether the record belongs to the current user. This parameter is returned when combined unlocking methods are not used. |
data | IData | The details of the alert record or operations log. |
dp_id | number | The ID of the data point (DP). |
log_category | string | The log category. Valid values:
|
log_id | number | The log ID. |
log_type | ILogType | The log type. |
media_info_list | IMediaInfo[] |
The information of images or videos taken when unlocking the door. |
member_bindable_flag | number | Indicates whether the unlocking method reported by this log can be bound to a contact. Valid values:
|
record_type | number | The record type. This parameter is returned only for unlocking records.
|
time | number | The log event time. It is a timestamp in milliseconds. |
unlock_name | string | The name of the unlocking method. It may be empty. |
user_id | string | The user ID. This parameter is returned only for unlocking records, duress alarms, and operation logs. |
user_name | string | The name of the user who unlocks the door or the name of the unlocking password. |
union_unlock_info | IUnlockInfo[] |
The information about combined unlocking methods. |
Description of IMediaInfo
Parameter | Type | Description |
---|---|---|
file_url | string | The full file URL. |
file_key | string | The encryption key. |
file_path | string | The file path. |
bucket | string | The bucket where the file resides. |
media_key | string | The key for pulling the stream of a live video. To navigate to the audio or video playback URL, this data must be carried. |
media_url | string | The URL for pulling the stream of a live video. To navigate to the audio or video playback URL, this data must be carried. |
Description of IUnlockInfo
Parameter | Type | Description |
---|---|---|
user_name | string | The name of the user who triggers combined unlocking methods. It may be empty. |
op_mode | string | The type of the unlocking method when combined unlocking methods are used. |
unlock_name | string | The name of the unlocking method when combined unlocking methods are used. It may be empty. |
current_user | boolean | Indicates whether it is the current user when combined unlocking methods are used. |
sn | number | The hardware serial number (SN) when combined unlocking methods are used. |
IData string
Example
Value | Meaning |
---|---|
wrong_password | Consecutive wrong passwords. |
wrong_finger | Consecutive wrong fingerprints. |
wrong_card | Consecutive wrong cards. |
wrong_face | Consecutive wrong faces. |
wrong_finger_vein | Consecutive wrong finger veins. |
wrong_unlock | Alert due to consecutive failed verification attempts. |
tongue_bad | Stuck bolt lock. |
too_hot | High-temperature alert. |
unclosed_time | Door left open beyond the expected time. |
tongue_not_out | Bolt lock not ejected. |
pry | Anti-pry alert. |
key_in | Notification of key insertion. |
low_battery | Alert due to low battery level. |
power_off | Out-of-battery alert. |
shock | Vibration alert. |
defense | Arming alert. |
doorbell | Doorbell alert. |
stay_alarm | Loitering alert. |
modi_pass | Notification of password modification. |
add_finger | Notification of fingerprint addition. |
del_finger | Notification of password initialization and fingerprint deletion. |
try_open | Alert due to an attempt to unlock the door after the door is locked remotely. |
ILogType string
Example (they can be defined based on DP names.)
Value | Meaning |
---|---|
dev_bind | Device binding. |
unlock_temporary | Custom temporary password. |
unlock_dynamic | Dynamic password. |
unlock_offline_pd | Local password. |
unlock_phone_remote | Remote unlocking. |
doorbell | Ringing doorbell. |
getlogLatest
Request parameters
Parameter | Type | Description | Required |
---|---|---|---|
device_id | string | The device ID. | true |
Response parameters
Parameter | Type | Description |
---|---|---|
current_user | boolean | Indicates whether the record belongs to the current user. This parameter is returned when combined unlocking methods are not used. |
data | string | The details of the alert record or operations log. |
dp_id | number | The DP ID. |
exist | boolean | Indicates whether the latest log exists. |
log_category | string | The log category. Valid values:
|
log_id | number | The log ID. |
log_type | string | The log type. |
record_type | number | The record type. This parameter is returned only for unlocking records.
|
time | number | The log event time. |
un_read_count | number | The number of unread records. |
unlock_name | string | The name of the unlocking method. It may be empty. |
user_id | string | The user ID. This parameter is returned only for unlocking records, duress alarms, and operation logs. |
user_name | string | The user name. |
union_unlock_info | IUnlockInfo[] |
The information about combined unlocking methods. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback