This topic describes the time settings and timer specifications for Bluetooth Mesh devices that are based on the Vendor Model.
Version history
| Version history | Update date | Update details |
| V1.0.0 | 2022-06-09 | Modified based on the v1 timer protocol from 2019. Added multicast time synchronization, time zones, loop timers, multi-property operations, and full timer index ACK. |
| V1.0.1 | 2022-08-11 | Added a description for when the recurrence (schedule) is 0. |
| V1.0.2 | 2022-12-02 | The unified protocol for Mesh device timers (V2) is now supported by the Cloud Intelligence App for private label projects and the Tmall Genie App (Genie speakers) for Tmall Genie projects. |
Differentiating devices that support the unified protocol for Mesh local timers
To indicate that a device supports the unified protocol for Mesh local timers, you can set bit 5 of the FeatureFlag2 field in the device's UUID to 1. For more information about the Mesh device UUID format, see Mesh device UUID format definition.
Mesh device time synchronization protocol
AttrType and Opcode
Mesh devices must support the following two time synchronization instructions.
Tmall Genie speaker time synchronization instructions
Currently, Tmall Genie speakers use legacy instructions for time synchronization. These instructions use unicast, as shown in the following table:
| Downlink (Tmall Genie speaker -> Mesh device) | Uplink (Mesh device -> Tmall Genie speaker) | ||||
| Opcode | Dst Addr | Attr Type | Opcode | Attr Type | |
| Set time | 0xD101A8 | Device unicast address | 0xF01F | 0xD301A8 | 0xF01F |
| Query time | 0xD001A8 | Device unicast address | 0xD301A8 | 0xF01F | |
| Set time zone | 0xD101A8 | Device unicast address | 0xF01E | 0xD301A8 | 0xF01E |
| Query time zone | 0xD001A8 | Device unicast address | 0xD301A8 | 0xF01E | |
| Set time synchronization parameters | 0xD101A8 | Device unicast address | 0xF01D | 0xD301A8 | 0xF01D |
| Query time synchronization parameters | 0xD001A8 | Device unicast address | 0xD301A8 | 0xF01D | |
| Uplink (Mesh device -> Tmall Genie speaker) | Downlink (Tmall Genie speaker -> Mesh device) | ||||
| Opcode | Attr Type | Opcode | Dst Addr | Attr Type | |
| Request time update | 0xDE01A8 | 0xF01F | 0xDF01A8 | Device unicast address | 0xF01F |
Gateway and app time synchronization instructions
Gateways and apps use new instructions for time synchronization. These instructions use multicast with the address 0xCFFF for all categories, as shown in the following table:
| Downlink (Gateway/App -> Mesh device) | Uplink (Mesh device -> Gateway/App) | ||||
| Opcode | Dst Addr | Attr Type | Opcode | Attr Type | |
| Set time | 0xD201A8 | Multicast address: 0xCFFF | 0xF01F | - | - |
| Query time | 0xD001A8 | Device unicast address | 0xD301A8 | 0xF01F | |
| Set time zone | 0xD201A8 | Multicast address: 0xCFFF | 0xF01E | - | - |
| Query time zone | 0xD001A8 | Device unicast address | 0xD301A8 | 0xF01E | |
| Set time synchronization parameters | 0xD201A8 | Multicast address: 0xCFFF | 0xF01D | - | - |
| Query time synchronization parameters | 0xD001A8 | Device unicast address | 0xD301A8 | 0xF01D | |
| Uplink (Mesh device -> Gateway/App) | Downlink (Gateway/App -> Mesh device) | ||||
| Opcode | Attr Type | Opcode | Dst Addr | Attr Type | |
| Request time update | 0xDE01A8 | 0xF01F | 0xDF01A8 | Multicast address: 0xCFFF | 0xF01F |
Default time synchronization parameters
The device has the following default time synchronization parameters. To change these parameters, you can send an instruction to the device.
- Device time synchronization request interval: 180 minutes.
- Maximum retry interval after a failed request: 5 minutes. The device uses a discrete time interval for retries. The interval is 1 minute after the first failure, 3 minutes after the second, and 5 minutes after the third.
- Number of retries after a failed request: 3.
Notes
- If no Tmall Genie speaker or gateway is online, you can use an app to connect to the Mesh network to synchronize the time and set timers for a device. However, if the app disconnects, the device's periodic time synchronization requests will fail. This causes the local time on the device to drift and results in inaccurate timer operations.
- If no Tmall Genie speaker or gateway is online and the app does not reconnect to the Mesh network after the device restarts, the device's time will not be synchronized. This causes timer operations to fail.
Data examples
The following data examples demonstrate the time synchronization instructions for gateways and apps.
Set time (downlink)
| 0xD2 | 0xA8 | 0x01 | 0x01 | 0x1F | 0xF0 | 0x00 | 0x3D | 0x2A | 0x5C | 0x08 |
| Opcode | TID | Attr Type | u32_time | s8_timezone | ||||||
| 0xD201A8 | 0x01 | UNIX time: 0xF01F | UNIX time: 0x5C2A3D00 2019/1/1 00:00:00 | Time zone: -12 to 14 | ||||||
s8_timezone: 1 byte. The time zone value. The parameter range is -12 to 14.
Query time (downlink)
| 0xD0 | 0xA8 | 0x01 | 0x02 | 0x1F | 0xF0 |
| Opcode | TID | Attr Type | |||
| 0xD001A8 | 02 | UNIX time: 0xF01F | |||
Time information (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x03 | 0x1F | 0xF0 | 0x00 | 0x3D | 0x2A | 0x5C |
| Opcode | TID | Attr Type | u32_time | ||||||
| 0xD301A8 | 03 | UNIX time: 0xF01F | UNIX time: 0x5C2A3D00 2019/1/1 00:00:00 | ||||||
Set time synchronization parameters (downlink)
| 0xD2 | 0xA8 | 0x01 | 0x01 | 0x1D | 0xF0 | 0xB4 | 0x00 | 0x05 | 0x03 |
| Opcode | TID | Attr Type | uint16 period_time | uint8 retry_delay | uint8 retry_times | ||||
| 0xD201A8 | 0x01 | Time synchronization parameters: 0xF01D | Time synchronization request interval: 180 minutes | Maximum retry interval after a failed request: 5 minutes | Number of retries after a failed request: 3 | ||||
Query time synchronization parameters (downlink)
| 0xD0 | 0xA8 | 0x01 | 0x02 | 0x1D | 0xF0 |
| Opcode | TID | Attr Type | |||
| 0xD001A8 | 0x02 | Time synchronization parameters: 0xF01D | |||
Time synchronization parameters (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x03 | 0x1D | 0xF0 | 0xB4 | 0x00 | 0x05 | 0x03 |
| Opcode | TID | Attr Type | uint16 period_time | uint8 retry_delay | uint8 retry_times | ||||
| 0xD301A8 | 0x03 | Time synchronization parameters: 0xF01D | Time synchronization request interval: 180 minutes | Maximum retry interval after a failed request: 5 minutes | Number of retries after a failed request: 3 | ||||
Set time zone (downlink)
| 0xD2 | 0xA8 | 0x01 | 0x01 | 0x1E | 0xF0 | 0x08 |
| Opcode | TID | Attr Type | s8_timezone | |||
| 0xD201A8 | 0x01 | Time zone: 0xF01E | Time zone: -12 to 14 | |||
Query time zone (downlink)
| 0xD0 | 0xA8 | 0x01 | 0x02 | 0x1E | 0xF0 |
| Opcode | TID | Attr Type | |||
| 0xD001A8 | 02 | Time zone: 0xF01E | |||
Time zone information (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x03 | 0x1E | 0xF0 | 0x08 |
| Opcode | TID | Attr Type | s8_timezone | |||
| 0xD301A8 | 03 | Time zone: 0xF01E | Time zone: -12 to 14 | |||
Request time update (uplink)
| 0xDE | 0xA8 | 0x01 | 0x04 | 0x1F | 0xF0 |
| Opcode | TID | Attr Type | |||
| 0xDE01A8 | 04 | UNIX time: 0xF01F | |||
Update time (downlink)
| 0xDF | 0xA8 | 0x01 | 0x05 | 0x1F | 0xF0 | 0x00 | 0x3D | 0x2A | 0x5C | 0x08 |
| Opcode | TID | Attr Type | u32_time | s8_timezone | ||||||
| 0xDF01A8 | 05 | UNIX time: 0xF01F | UNIX time: 0x5C2A3D00 2019/1/1 00:00:00 | Time zone: -12 to 14 | ||||||
s8_timezone: 1 byte. The time zone value. The parameter range is -12 to 14.
Mesh device timer protocol
AttrType and Opcode
| Downlink (Tmall Genie speaker/Gateway/App -> Mesh device) | Uplink (Mesh device -> Tmall Genie speaker/Gateway/App) | |||
| Opcode | Attr Type | Opcode | Attr Type | |
| Set one-time timer | 0xD101A8 | 0xF013 | 0xD301A8 | 0xF013 |
| Set recurring timer | 0xD101A8 | 0xF014 | 0xD301A8 | 0xF014 |
| Set loop timer | 0xD101A8 | 0xF015 | 0xD301A8 | 0xF015 |
| Enable/Disable timer | 0xD101A8 | 0xF016 | 0xD301A8 | 0xF016 |
| Delete timer | 0xD101A8 | 0xF017 | 0xD301A8 | 0xF017 |
| Query timer | 0xD001A8 | 0xF018 | 0xD301A8 | 0xF018 |
| Query timer record | 0xD001A8 | 0xF019 | 0xD301A8 | 0xF019 |
| Scheduled full index reports | - | - | 0xD301A8 | 0xF020 |
| Report timer completion event | - | - | 0xD301A8 | 0xF009 |
Notes
- The device supports a maximum of 13 timers. For multi-element protocol devices, all elements share this limit. If the limit is exceeded, an error code is reported to indicate that the maximum number of timers has been reached.
- The device buffers a maximum of 4 timer execution records. When more than 4 records are generated, the oldest record is overwritten.
- Each timer setting instruction can contain only one timer index.
- Each timer setting instruction can contain a maximum of 4 opcodes.
- After the device receives a timer setting instruction, the device stores the instruction in flash memory. After a restart, the device must reload the instruction and actively report all current valid timer indexes.
- For a one-time timer, after the timer completes, the device must automatically delete the local timer and actively report all current valid timer indexes.
Data examples
Set one-time timer (downlink)
| 0xD1 | 0xA8 | 0x01 | 0x80 | 0x13 | 0xF0 | 0x81 | 0x01 | 0x3D | 0x2A | 0x5C | 0x00 | 0x01 | 0x01 | 0x00 |
| Opcode | TID | Attr Type | u8_index | u32_time | u16_attr_type | u8_attr_para_len | attr_para | |||||||
| 0xD101A8 | 80 | One-time timer: 0xF013 | Index | UNIX time: 0x5C2A3D00 2019/1/1 00:00:00 Number of opcodes: 1 group | Switch: 0x0100 | attr_para data length: 0x01 | Off: 0x00 | |||||||
| Timer | ||||||||||||||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- u32_time:
The timer precision is one minute. Therefore, the seconds value of this data (a value less than 60) represents the number of opcodes that the timer will execute.
For example, the data 0x5C2A3D01 corresponds to the decimal value 1546272001. Calculate 1546272001 / 60 and round down to get 25771200. Then, 25771200 × 60 = 1546272000, which corresponds to the time 2019/1/1 00:00:00.
1546272001 mod 60 = 1, which indicates that there is only one operation group (switch). The maximum number of opcodes allowed is 4.
- u8_attr_para_len:
1 byte. The length of attr_para. This value indicates the length of the following attr_para data. The maximum length is 8 bytes.
Note For a one-time timer, after the timer executes, the device must automatically delete the local timer and actively report all current valid timer indexes.
Set one-time timer ACK (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x13 | 0xF0 | 0x00 | 0x81 | 0x82 |
| Opcode | TID | Attr Type | Status | u8_index | u8_index | |||
| 0xD301A8 | 80 | One-time timer: 0xF013 | 0x00: Success | Index 1 | Index 2 | |||
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x13 | 0xF0 | 0x80 | 0x81 |
| Opcode | TID | Attr Type | Status | u8_index | |||
| 0xD301A8 | 80 | One-time timer: 0xF013 | 0x80: Error | Index of the timer that caused the error | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- Status:
For the status code table, see Status code table.
If the status is 0x00 or 0x01, the device's ACK reply includes all current timer indexes on the device.
If the status is any other error code, the ACK reply from the device includes only the index of the timer that caused the error.
Note Each timer setting instruction can contain only one timer setting.
Set recurring timer (downlink)
Recurring timer (only weekly recurrence is supported):
| 0xD1 | 0xA8 | 0x01 | 0x80 | 0x14 | 0xF0 | 0x81 | 0xE0 | 0x11 | 0xE0 | 0x01 | 0x06 | 0x00 | 0x01 | 0x01 | 0x00 |
| Opcode | TID | Attr Type | u8_index | u16_time | s16_timezone | u8_schedule | attr_type | u8_attr_para_len | attr_para | ||||||
| 0xD101A8 | 80 | Recurring timer: 0xF014 | Index | 24-hour time: 0x01E0 8:00 AM Number of opcodes: 1 group | Time zone bias: The difference from UTC is 480 minutes | Bits 0–6: Correspond to Monday–Sunday. In this case, Tuesday and Wednesday. | Switch: 0x0100 | attr_para data length: 0x01 | Off: 0x00 | ||||||
| Timer | |||||||||||||||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- u16_time:
Bits 0–11: Represent the minute of the day in a 24-hour format. For example, in the data 0x11E0, the lower 12 bits are 0x01E0, which corresponds to the decimal value 480. This represents the time 8:00 AM.
Bits 12–15: Represent the number of opcodes that the timer will execute. For example, in the data 0x11E0, the higher 4 bits are 0x01, which indicates that there is only one operation group (switch). The maximum number of opcodes allowed is 4.
- s16_timezone:
2 bytes. Represents the difference from UTC in minutes. The value ranges from -720 to 840.
This accounts for countries or regions with time zones that are not full-hour offsets, such as Australia: UTC+08:45.
For a list of time zones, see https://en.wikipedia.org/wiki/Time_zone.
- u8_schedule:
Bits 0–6: Correspond to Monday–Sunday.
If schedule is 0, it indicates a one-time timer. If the scheduled time is earlier than the current time, the timer executes the next day. Otherwise, it executes on the same day.
After a one-time timer executes, the device must delete the local timer and actively report all current valid timer indexes.
- u8_attr_para_len:
1 byte. The length of attr_para. This value indicates the length of the following attr_para data. The maximum length is 8 bytes.
Note Each timer setting instruction can contain only one timer setting.
Set recurring timer ACK (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x14 | 0xF0 | 0x00 | 0x81 | 0x82 |
| Opcode | TID | Attr Type | Status | u8_index | u8_index | |||
| 0xD301A8 | 80 | Recurring timer: 0xF014 | 0x00: Success | Index 1 | Index 2 | |||
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x14 | 0xF0 | 0x80 | 0x81 |
| Opcode | TID | Attr Type | Status | u8_index | |||
| 0xD301A8 | 80 | Recurring timer: 0xF014 | 0x80: Error | Index of the timer that caused the error | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- Status:
For the status code table, see Status code table.
If the status is 0x00 or 0x01, the device's ACK reply includes all current timer indexes on the device.
If the status is any other error code, the ACK reply from the device includes only the index of the timer that caused the error.
Set loop timer (downlink)
| 0xD1 | 0xA8 | 0x01 | 0x80 | 0x15 | 0xF0 | 0x81 | 0xE0 | 0x01 | 0xD0 | 0x02 | 0xE0 | 0x01 |
| Opcode | TID | Attr Type | u8_index | u16_time | u16_time | s16_timezone | ||||||
| 0xD101A8 | 80 | Loop timer: 0xF015 | Index | Start time 24-hour time: 0x01E0 8:00 AM | End time 24-hour time: 0x02D0 12:00 PM | Time zone bias: The difference from UTC is 480 minutes | ||||||
| Timer | ||||||||||||
| 0x06 | 0x1E | 0x10 | 0x00 | 0x01 | 0x01 | 0x01 | 0x1E | 0x10 | 0x00 | 0x01 | 0x01 | 0x00 |
| u8_schedule | u16_duration | attr_type | u8_attr_para_len | attr_para | u16_duration | attr_type | u8_attr_para_len | attr_para | ||||
| Bits 0–6: Correspond to Monday–Sunday. In this case, Tuesday and Wednesday. | Runtime: 0x101e 30 minutes Number of opcodes: 1 group | Switch: 0x0100 | attr_para data length: 0x01 | On: 0x01 | Sleep time: 0x101e 30 minutes Number of opcodes: 1 group | Switch: 0x0100 | attr_para data length: 0x01 | Off: 0x00 | ||||
| Timer | ||||||||||||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- u16_time:
Bits 0–11: Represent the minute of the day in a 24-hour format. For example, in the data 0x11E0, the lower 12 bits are 0x01E0, which corresponds to the decimal value 480. This represents the time 8:00 AM.
Bits 12–15: Represent the number of opcodes that the timer will execute. For example, in the data 0x11E0, the higher 4 bits are 0x01, which indicates that there is only one operation group (switch). The maximum number of opcodes allowed is 4.
- s16_timezone:
2 bytes. Represents the difference from UTC in minutes. The value ranges from -720 to 840.
- u8_schedule:
Bits 0–6: Correspond to Monday–Sunday.
If schedule is 0, it indicates a one-time loop timer:
- If the timer's start time is earlier than the current time but the end time is later, the loop timer will execute from the current time until the end time.
- If both the start and end times are earlier than the current time, the loop timer will start executing at the scheduled start time the next day.
After a one-time loop timer completes, the device must delete the local timer and actively report all current valid timer indexes.
- u16_duration:
Bits 0–11: Represent the duration in minutes. For example, in the data 0x101e, the lower 12 bits are 0x01e, which corresponds to the decimal value 30. This indicates a duration of 30 minutes.
Bits 12–15: Represent the number of opcodes to be executed during this duration. For example, in the data 0x101e, the higher 4 bits are 0x01, which indicates that there is only one operation group (switch). The maximum number of opcodes allowed is 2.
- u8_attr_para_len:
1 byte. The length of attr_para. This value indicates the length of the following attr_para data. The maximum length is 8 bytes.
Note Each timer setting instruction can contain only one timer setting.
Set loop timer ACK (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x15 | 0xF0 | 0x00 | 0x81 | 0x02 |
| Opcode | TID | Attr Type | Status | u8_index | u8_index | |||
| 0xD301A8 | 80 | Loop timer: 0xF015 | 0x00: Success | Index 2 | Index 2 | |||
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x15 | 0xF0 | 0x80 | 0x81 |
| Opcode | TID | Attr Type | Status | u8_index | |||
| 0xD301A8 | 80 | Loop timer: 0xF015 | 0x80: Error | Index 2 | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- Status:
For the status code table, see Status code table.
If the status is 0x00 or 0x01, the device's ACK reply includes all current timer indexes on the device.
If the status is any other error code, the ACK reply from the device includes only the index of the timer that caused the error.
Note Each timer setting instruction can contain only one timer setting.
Enable/Disable timer (downlink)
| 0xD1 | 0xA8 | 0x01 | 0x80 | 0x16 | 0xF0 | 0x81 | 0x02 |
| Opcode | TID | Attr Type | u8_index | u8_index | |||
| 0xD101A8 | 80 | Enable/Disable timer: 0xF016 | Index 1, enabled | Index 2, disabled | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
Note Each enable/disable timer message can contain one or more timer indexes. You can set the enabled/disabled status for each timer index individually.
Enable/Disable timer ACK (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x16 | 0xF0 | 0x00 | 0x81 | 0x02 |
| Opcode | TID | Attr Type | Status | u8_index | u8_index | |||
| 0xD301A8 | 80 | Enable/Disable timer: 0xF016 | 0x00: Success | Index 2 | Index 2 | |||
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x16 | 0xF0 | 0x85 | 0x81 |
| Opcode | TID | Attr Type | Status | u8_index | |||
| 0xD301A8 | 80 | Enable/Disable timer: 0xF016 | 0x85: Error | Index 1 | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- Status:
For the status code table, see Status code table.
If the status is 0x00 or 0x01, the device's ACK reply includes all current timer indexes on the device.
If the status is any other error code, the ACK reply from the device includes only the index of the timer that caused the error.
Delete timer (downlink)
| 0xD1 | 0xA8 | 0x01 | 0x80 | 0x17 | 0xF0 | 0x01 | 0x02 |
| Opcode | TID | Attr Type | u8_index | u8_index | |||
| 0xD101A8 | 80 | Delete timer: 0xF017 | Index 1 | Index 2 | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
0xFF: Deletes all timers. Other values specify the index of the timer to be deleted.
Note Each delete timer message can contain one or more timer indexes. An index of 0xFF deletes all timers.
Delete timer ACK (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x17 | 0xF0 | 0x00 | 0x81 | 0x02 |
| Opcode | TID | Attr Type | Status | u8_index | u8_index | |||
| 0xD301A8 | 80 | Timer record: 0xF017 | 0x00: Success | Index 1 | Index 2 | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- Status:
If the timer index exists on the device, the timer is deleted. If the timer index does not exist, no action is performed. In both cases, the status code 0x00 (Success) is returned. For more information, see Status code table.
If the status is 0x00 or 0x01, the device's ACK reply includes all current timer indexes on the device. If the index field is NULL, this indicates that no local timers exist.
If the status is any other error code, the ACK reply from the device includes only the index of the timer that caused the error.
Query timer (downlink)
| 0xD0 | 0xA8 | 0x01 | 0x80 | 0x18 | 0xF0 | 0xFF | ||
| Opcode | TID | Attr Type | u8_type | |||||
| 0xD001A8 | 80 | Query timer: 0xF018 | 0xFF: Queries the indexes of all timers. Other values: Query the specific parameters of the corresponding timer index. | |||||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
0xFF: Queries the indexes of all timers. The device replies with an ACK that contains all timer indexes.
Other values: Query specific timer information for the corresponding index. The device replies with an ACK for that single timer. Only single-index timer queries are supported.
Query timer ACK (uplink)
Query all timer indexes ACK (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x18 | 0xF0 | 0x00 | 0xFF | 0x81 | 0x02 |
| Opcode | TID | Attr Type | Status | u8_type | u8_index | u8_index | |||
| 0xD301A8 | 80 | Timer record: 0xF018 | 0x00: Success | 0xFF: Returns all timer indexes | Index 1 | Index 2 | |||
- u8_type:
0xFF: Returns all timer indexes.
0x01: One-time timer type.
0x02: Recurring timer type.
0x03: Loop timer type.
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- Status:
For the status code table, see Status code table.
If the status is 0x00 or 0x01, the device's ACK reply includes all current timer indexes on the device.
If the status is any other error code, the ACK reply from the device includes only the index of the timer that caused the error.
Query single timer ACK (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x18 | 0xF0 | 0x00 | 0x01 | 0x81 | 0x01 | 0x3D | 0x2A | 0x5C | 0x00 | 0x01 | 0x01 | 0x00 |
| Opcode | TID | Attr Type | Status | u8_type | u8_index | u32_time | attr_type | u8_attr_para_len | attr_para | |||||||
| 0xD301A8 | 80 | Query timer: 0xF018 | 0x00: Success | 0x01: One-time timer type | Index | UNIX time: 0x5C2A3D00 2019/1/1 00:00:00 Number of opcodes: 1 group | Switch: 0x0100 | attr_para data length: 0x01 | Off: 0x00 | |||||||
- u8_type:
0xFF: Returns all timer indexes.
0x01: One-time timer type.
0x02: Recurring timer type.
0x03: Loop timer type.
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- Status:
For the status code table, see Status code table.
Query timer record (downlink)
| 0xD0 | 0xA8 | 0x01 | 0x80 | 0x19 | 0xF0 | 0xFF |
| Opcode | TID | Attr Type | u8_index | |||
| 0xD301A8 | 80 | Timer information: 0xF019 | 0xFF: Queries the indexes of all timer records. Other values: Query the completion time and type of the timer record with the corresponding index. | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
0xFF: Queries the indexes of all timers. The device replies with an ACK that contains all timer indexes.
Other values: Query specific timer information for the corresponding index. The device replies with an ACK for that single timer. Only single-index timer queries are supported.
Note The device stores only the last 4 timer records. When more than 4 records are generated, the oldest record is overwritten based on the completion time.
Device timer record ACK (uplink)
Query all timer record indexes ACK (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x19 | 0xF0 | 0x00 | 0xFF | 0x01 | 0x02 | 0x03 | 0x04 |
| Opcode | TID | Attr Type | Status | u8_type | u8_index | u8_index | u8_index | u8_index | |||
| 0xD301A8 | 80 | Timer record: 0xF019 | 0x00: Success | 0xFF: Returns all timer record indexes | Completed timer index 1 | Completed timer index 2 | Completed timer index 3 | Completed timer index 4 | |||
- u8_type:
0xFF: Returns all timer indexes.
0x01: One-time timer type.
0x02: Recurring timer type.
0x03: Loop timer type.
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- Status:
For the status code table, see Status code table.
Note The device stores only the last 4 timer records. When more than 4 records are generated, the oldest record is overwritten based on the completion time.
Query single timer record ACK (uplink)
| 0xD4 | 0xA8 | 0x01 | 0x80 | 0x19 | 0xF0 | 0x00 | 0x01 | 0x01 | 0x00 | 0x3D | 0x2A | 0x5C |
| Opcode | TID | Attr Type | Status | u8_type | u8_index | u32_time | ||||||
| 0xD301A8 | 80 | Timer record: 0xF019 | 0x00: Success | 0x01: One-time timer type | Completed timer index 1 | UNIX time of timer completion: 0x5C2A3D01 2019/1/1 00:00:00 | ||||||
- u8_type:
0xFF: Returns all timer indexes.
0x01: One-time timer type.
0x02: Recurring timer type.
0x03: Loop timer type.
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
- u32_time:
The UNIX time when the timer completed, in seconds.
- Status:
For the status code table, see Status code table.
Report all timer indexes (uplink)
| 0xD3 | 0xA8 | 0x01 | 0x80 | 0x20 | 0xF0 | 0x81 | 0x82 |
| Opcode | TID | Attr Type | u8_index | u8_index | |||
| 0xD301A8 | 80 | Timer information: 0xF020 | Index 1 | Index 2 | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
Note- The device must include all its timer indexes. If the index field is NULL, this indicates that no local timers exist.
- The device must actively report this full timer information after it is successfully provisioned, after a restart, or when a timer completes (if it involves deleting a local timer).
Report timer completion (uplink)
| 0xD4 | 0xA8 | 0x01 | 0x80 | 0x09 | 0xF0 | 0x11 | 0x81 | 0x82 |
| Opcode | TID | Attr Type | Event | u8_index | u8_index | |||
| 0xD301A8 | 80 | Event report: (0xF009) | Event ID 0x11 indicates timer completion | Scheduled indexing 1 completed | Scheduled indexing 2 completed | |||
- u8_index:
Bits 0–6: Represent the timer index. The value ranges from 0x01 to 0x7F. For example, in the data 0x81, the lower 7 bits are 0x01, which indicates that the timer index is 1.
Bit 7: Represents the timer status. 0 indicates disabled, and 1 indicates enabled. For example, in the data 0x81, the highest bit is 1, which indicates that the timer is enabled.
Note- When a timer is triggered on the device, the device must report this timer completion message. The message includes the index of the completed timer. If multiple timers are completed at the same time, they are reported together.
- If it is a one-time timer, the device automatically deletes the local timer after it completes and must actively report the full current timer information.
Status code table
| Status Code | Description |
| 0x00 | Operation successful. |
| 0x01 | Operation successful, but the device time has drifted. It has not been re-synchronized for more than 180 minutes. |
| 0x80 | UNIX time is not set. No local timers on the device. |
| 0x81 | UNIX time is not set. Local timers exist on the device, but timers are abnormal. |
| 0x82 | Unsupported property operation. |
| 0x83 | Incorrect property operation parameter. |
| 0x84 | Scheduled time is earlier than the current time. |
| 0x85 | The specified timer index was not found. |
| 0x86 | Timer limit reached. More than 13 timers. |
| 0x87 | Incorrect timer format. |
- Status codes 0x00 and 0x01 both indicate a successful operation. However, if the status code is 0x01, a notification is pushed to the user: "The device time has drifted because it has not been re-synchronized for more than 180 minutes. Timers may be inaccurate."
- Status code 0x80 indicates that the device's UNIX time is not set and has never been successfully synchronized. There are no local timers on the device.
- Status code 0x81 indicates that the device's UNIX time is not set, but local timers exist. The timers will not function correctly.