Unified protocol for Bluetooth Mesh local timers

更新时间:
复制 MD 格式

This topic describes the time settings and timer specifications for Bluetooth Mesh devices that are based on the Vendor Model.

Version history

Version historyUpdate dateUpdate details
V1.0.02022-06-09Modified 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.12022-08-11Added a description for when the recurrence (schedule) is 0.
V1.0.22022-12-02The 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)
OpcodeDst AddrAttr TypeOpcodeAttr Type
Set time0xD101A8Device unicast address0xF01F0xD301A80xF01F
Query time0xD001A8Device unicast address0xD301A80xF01F
Set time zone0xD101A8Device unicast address0xF01E0xD301A80xF01E
Query time zone0xD001A8Device unicast address0xD301A80xF01E
Set time synchronization parameters0xD101A8Device unicast address0xF01D0xD301A80xF01D
Query time synchronization parameters0xD001A8Device unicast address0xD301A80xF01D
Uplink (Mesh device -> Tmall Genie speaker)Downlink (Tmall Genie speaker -> Mesh device)
OpcodeAttr TypeOpcodeDst AddrAttr Type
Request time update0xDE01A80xF01F0xDF01A8Device unicast address0xF01F

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)
OpcodeDst AddrAttr TypeOpcodeAttr Type
Set time0xD201A8Multicast address: 0xCFFF0xF01F--
Query time0xD001A8Device unicast address0xD301A80xF01F
Set time zone0xD201A8Multicast address: 0xCFFF0xF01E--
Query time zone0xD001A8Device unicast address0xD301A80xF01E
Set time synchronization parameters0xD201A8Multicast address: 0xCFFF0xF01D--
Query time synchronization parameters0xD001A8Device unicast address0xD301A80xF01D
Uplink (Mesh device -> Gateway/App)Downlink (Gateway/App -> Mesh device)
OpcodeAttr TypeOpcodeDst AddrAttr Type
Request time update0xDE01A80xF01F0xDF01A8Multicast address: 0xCFFF0xF01F

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

Note The Transaction IDs (TIDs) in all data examples are for reference only. The TID of each downlink message must be different from the previous one. In a device's reply, the TID must be the same as the TID in the downlink set or query instruction. If a device actively sends a message, the device generates and manages its own TID.

The following data examples demonstrate the time synchronization instructions for gateways and apps.

Set time (downlink)

0xD20xA80x010x010x1F0xF00x000x3D0x2A0x5C0x08
OpcodeTIDAttr Typeu32_times8_timezone
0xD201A80x01UNIX time: 0xF01FUNIX 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.

Note The s8_timezone field is optional. If the Attr Param data length is 4 bytes, it contains only the UNIX time. If the Attr Param data length is 5 bytes, the first 4 bytes represent the UNIX time and the fifth byte represents the time zone.

Query time (downlink)

0xD00xA80x010x020x1F0xF0
OpcodeTIDAttr Type
0xD001A802UNIX time: 0xF01F

Time information (uplink)

0xD30xA80x010x030x1F0xF00x000x3D0x2A0x5C
OpcodeTIDAttr Typeu32_time
0xD301A803UNIX time: 0xF01FUNIX time: 0x5C2A3D00

2019/1/1 00:00:00

Set time synchronization parameters (downlink)

0xD20xA80x010x010x1D0xF00xB40x000x050x03
OpcodeTIDAttr Typeuint16 period_timeuint8 retry_delayuint8 retry_times
0xD201A80x01Time synchronization parameters: 0xF01DTime synchronization request interval: 180 minutesMaximum retry interval after a failed request: 5 minutesNumber of retries after a failed request: 3

Query time synchronization parameters (downlink)

0xD00xA80x010x020x1D0xF0
OpcodeTIDAttr Type
0xD001A80x02Time synchronization parameters: 0xF01D

Time synchronization parameters (uplink)

0xD30xA80x010x030x1D0xF00xB40x000x050x03
OpcodeTIDAttr Typeuint16 period_timeuint8 retry_delayuint8 retry_times
0xD301A80x03Time synchronization parameters: 0xF01DTime synchronization request interval: 180 minutesMaximum retry interval after a failed request: 5 minutesNumber of retries after a failed request: 3

Set time zone (downlink)

0xD20xA80x010x010x1E0xF00x08
OpcodeTIDAttr Types8_timezone
0xD201A80x01Time zone: 0xF01ETime zone: -12 to 14

Query time zone (downlink)

0xD00xA80x010x020x1E0xF0
OpcodeTIDAttr Type
0xD001A802Time zone: 0xF01E

Time zone information (uplink)

0xD30xA80x010x030x1E0xF00x08
OpcodeTIDAttr Types8_timezone
0xD301A803Time zone: 0xF01ETime zone: -12 to 14

Request time update (uplink)

0xDE0xA80x010x040x1F0xF0
OpcodeTIDAttr Type
0xDE01A804UNIX time: 0xF01F
Note If a device determines that the time synchronization interval has been exceeded and it has not received a downlink time synchronization instruction, the device actively initiates a time synchronization request.

Update time (downlink)

0xDF0xA80x010x050x1F0xF00x000x3D0x2A0x5C0x08
OpcodeTIDAttr Typeu32_times8_timezone
0xDF01A805UNIX time: 0xF01FUNIX 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.

Note The s8_timezone field is optional. If the Attr Param data length is 4 bytes, it contains only the UNIX time. If the Attr Param data length is 5 bytes, the first 4 bytes represent the UNIX time and the fifth byte represents the time zone.

Mesh device timer protocol

AttrType and Opcode

Downlink (Tmall Genie speaker/Gateway/App -> Mesh device)Uplink (Mesh device -> Tmall Genie speaker/Gateway/App)
OpcodeAttr TypeOpcodeAttr Type
Set one-time timer0xD101A80xF0130xD301A80xF013
Set recurring timer0xD101A80xF0140xD301A80xF014
Set loop timer0xD101A80xF0150xD301A80xF015
Enable/Disable timer0xD101A80xF0160xD301A80xF016
Delete timer0xD101A80xF0170xD301A80xF017
Query timer0xD001A80xF0180xD301A80xF018
Query timer record0xD001A80xF0190xD301A80xF019
Scheduled full index reports--0xD301A80xF020
Report timer completion event--0xD301A80xF009

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

Note The Transaction IDs (TIDs) in all data examples are for reference only. The TID of each downlink message must be different from the previous one. In a device's reply, the TID must be the same as the TID in the downlink set or query instruction. If a device actively sends a message, the device generates and manages its own TID.

Set one-time timer (downlink)

0xD10xA80x010x800x130xF00x810x010x3D0x2A0x5C0x000x010x010x00
OpcodeTIDAttr Typeu8_indexu32_timeu16_attr_typeu8_attr_para_lenattr_para
0xD101A880One-time timer: 0xF013IndexUNIX time: 0x5C2A3D00

2019/1/1 00:00:00

Number of opcodes: 1 group

Switch: 0x0100attr_para data length: 0x01Off: 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)

0xD30xA80x010x800x130xF00x000x810x82
OpcodeTIDAttr TypeStatusu8_indexu8_index
0xD301A880One-time timer: 0xF013 0x00: SuccessIndex 1Index 2
0xD30xA80x010x800x130xF00x800x81
OpcodeTIDAttr TypeStatusu8_index
0xD301A880One-time timer: 0xF013 0x80: ErrorIndex 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):

0xD10xA80x010x800x140xF00x810xE00x110xE00x010x060x000x010x010x00
OpcodeTIDAttr Typeu8_indexu16_times16_timezoneu8_scheduleattr_typeu8_attr_para_lenattr_para
0xD101A880Recurring timer: 0xF014Index24-hour time: 0x01E0

8:00 AM

Number of opcodes: 1 group
Time zone bias: The difference from UTC is 480 minutesBits 0–6: Correspond to Monday–Sunday. In this case, Tuesday and Wednesday.Switch: 0x0100attr_para data length: 0x01Off: 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)

0xD30xA80x010x800x140xF00x000x810x82
OpcodeTIDAttr TypeStatusu8_indexu8_index
0xD301A880Recurring timer: 0xF014 0x00: SuccessIndex 1Index 2
0xD30xA80x010x800x140xF00x800x81
OpcodeTIDAttr TypeStatusu8_index
0xD301A880Recurring timer: 0xF014 0x80: ErrorIndex 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)

0xD10xA80x010x800x150xF00x810xE00x010xD00x020xE00x01
OpcodeTIDAttr Typeu8_indexu16_timeu16_times16_timezone
0xD101A880Loop timer: 0xF015IndexStart 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
Table 1. Continued from previous table
0x060x1E0x100x000x010x010x010x1E0x100x000x010x010x00
u8_scheduleu16_durationattr_typeu8_attr_para_lenattr_parau16_durationattr_typeu8_attr_para_lenattr_para
Bits 0–6: Correspond to Monday–Sunday. In this case, Tuesday and Wednesday.Runtime: 0x101e

30 minutes

Number of opcodes: 1 group
Switch: 0x0100attr_para data length: 0x01On: 0x01Sleep time: 0x101e

30 minutes

Number of opcodes: 1 group
Switch: 0x0100attr_para data length: 0x01Off: 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)

0xD30xA80x010x800x150xF00x000x810x02
OpcodeTIDAttr TypeStatusu8_indexu8_index
0xD301A880Loop timer: 0xF015 0x00: SuccessIndex 2Index 2
0xD30xA80x010x800x150xF00x800x81
OpcodeTIDAttr TypeStatusu8_index
0xD301A880Loop timer: 0xF015 0x80: ErrorIndex 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)

0xD10xA80x010x800x160xF00x810x02
OpcodeTIDAttr Typeu8_indexu8_index
0xD101A880Enable/Disable timer: 0xF016Index 1, enabledIndex 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)

0xD30xA80x010x800x160xF00x000x810x02
OpcodeTIDAttr TypeStatusu8_indexu8_index
0xD301A880Enable/Disable timer: 0xF016 0x00: SuccessIndex 2Index 2
0xD30xA80x010x800x160xF00x850x81
OpcodeTIDAttr TypeStatusu8_index
0xD301A880Enable/Disable timer: 0xF016 0x85: ErrorIndex 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)

0xD10xA80x010x800x170xF00x010x02
OpcodeTIDAttr Typeu8_indexu8_index
0xD101A880Delete timer: 0xF017Index 1Index 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)

0xD30xA80x010x800x170xF00x000x810x02
OpcodeTIDAttr TypeStatusu8_indexu8_index
0xD301A880Timer record: 0xF0170x00: SuccessIndex 1Index 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)

0xD00xA80x010x800x180xF00xFF
OpcodeTIDAttr Typeu8_type
0xD001A880Query timer: 0xF0180xFF: 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)

0xD30xA80x010x800x180xF00x000xFF0x810x02
OpcodeTIDAttr TypeStatusu8_typeu8_indexu8_index
0xD301A880Timer record: 0xF0180x00: Success 0xFF: Returns all timer indexesIndex 1Index 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)

0xD30xA80x010x800x180xF00x000x010x810x010x3D0x2A0x5C0x000x010x010x00
OpcodeTIDAttr TypeStatusu8_typeu8_indexu32_timeattr_typeu8_attr_para_lenattr_para
0xD301A880Query timer: 0xF018 0x00: Success 0x01: One-time timer typeIndexUNIX time: 0x5C2A3D00

2019/1/1 00:00:00

Number of opcodes: 1 group
Switch: 0x0100attr_para data length: 0x01Off: 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)

Note The following timer record instructions are not currently used by the cloud, and the app does not display timer records. However, you can implement these instructions on the device in advance for future use.
0xD00xA80x010x800x190xF00xFF
OpcodeTIDAttr Typeu8_index
0xD301A880Timer information: 0xF0190xFF: 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)

0xD30xA80x010x800x190xF00x000xFF0x010x020x030x04
OpcodeTIDAttr TypeStatusu8_typeu8_indexu8_indexu8_indexu8_index
0xD301A880Timer record: 0xF0190x00: Success 0xFF: Returns all timer record indexesCompleted timer index 1Completed timer index 2Completed timer index 3Completed 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)

0xD40xA80x010x800x190xF00x000x010x010x000x3D0x2A0x5C
OpcodeTIDAttr TypeStatusu8_typeu8_indexu32_time
0xD301A880Timer record: 0xF0190x00: Success0x01: One-time timer typeCompleted timer index 1UNIX 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)

0xD30xA80x010x800x200xF00x810x82
OpcodeTIDAttr Typeu8_indexu8_index
0xD301A880Timer information: 0xF020Index 1Index 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)

0xD40xA80x010x800x090xF00x110x810x82
OpcodeTIDAttr TypeEventu8_indexu8_index
0xD301A880Event report: (0xF009)Event ID 0x11 indicates timer completionScheduled indexing 1 completedScheduled 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 CodeDescription
0x00Operation successful.
0x01Operation successful, but the device time has drifted. It has not been re-synchronized for more than 180 minutes.
0x80UNIX time is not set. No local timers on the device.
0x81UNIX time is not set. Local timers exist on the device, but timers are abnormal.
0x82Unsupported property operation.
0x83Incorrect property operation parameter.
0x84Scheduled time is earlier than the current time.
0x85The specified timer index was not found.
0x86Timer limit reached. More than 13 timers.
0x87Incorrect 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.