Log Management
Door lock records are divided into three categories: album records, alarm records, and log records.
Album Records
- Locks that support video and image capture will have such records, which contain images and videos, usually generated when someone rings the doorbell, someone stays, etc.;
- For security reasons, Tuya encrypts images and videos, and developers need to use specific capabilities and solutions to display them normally.
For image processing solutions, please refer to: Media Image Processing
For video processing solutions, please refer to: Media Video Processing
Alarm Records
Records generated when the door lock alarms, including alarms such as: anti-prying, password error attempts, fingerprint error attempts, loitering, hijacking, low battery, etc.
Log Records
Record types include
- close_record indicates lock closing log
- unlock_record indicates unlock log
- operation indicates operation log
- local_operation indicates device local operation log
- dev_bind indicates device binding log
Log Text Processing
Alarm Processing
Lock Closing Log
Local Operation Record
Operation Log
Unlock Log
API
Get Latest 2 Records
- Meaning: Get the latest 2 records, including alarms, unlocks, lock closings, operation logs, etc.
- Details: View Documentation
Get Log Records
- Meaning: Get log records, including unlock, lock closing, operation, local operation logs, etc.
- Details: View Documentation
Get Alarm List
- Meaning: Get alarm record list
- Details: View Documentation
Get Album Logs
- Meaning: Get album logs
- Details: View Documentation
Register Log Refresh Notification Event
- Meaning: This event is triggered when related record DP reports are received
- Details: View Documentation
Unregister Log Refresh Notification Event
- Meaning: Unregister the event registered through
onLogsRefresh - Details: View Documentation
FAQ
Q1: How to distinguish different types of logs?
A: Distinguish by the type field:
unlock_record: Unlock recordclose_record: Lock closing recordalarm_record: Alarm recorddev_bind: Device binding recordlocal_operation: Local operation record
Q2: How to determine if a log can be bound to a member?
A: Determine by the bindable field. If it is true, it means the unlock method in this log can be bound to a member.
Q3: How to get media files in logs?
A: The mediaInfo field in the log object contains media information. Use the getMediaUrl API to get the actual playback address:
Q4: What is union unlock information?
A: unionUnlockInfo represents information about multiple people unlocking together, including the users and unlock methods involved in the unlock.
Q5: How to implement real-time log updates?
A: Use onLogsRefresh to listen for log update events:
Q6: Which devices support album records?
A: Album records only support video intercom devices (door lock devices with cameras).
Q7: How to get the unread log count?
A: Use the getLatestLogs API. The unreadCount field in the returned result indicates the unread count.