Commands for Historical Data Query
The device can query historical data for a specified time point or range through downlink commands. The specified time point can use Unix Timestamp Converter to calculate. The prerequisites are that the device time is correct and the data storage function is enabled. The device uploads a maximum of 300 data records per range query.
When querying data for a specific time point, the device uploads the record closest to the requested time within the current reporting interval. For example, with a 10-minute reporting interval, a query for 17:00 will return the exact record if it exists. Otherwise, the device searches for data within a tolerance of ±10 minutes (16:50 to 17:10) and uploads the record closest to 17:00.
| Item | Byte | Command | Description |
|---|---|---|---|
| Query data for a specified time point | 1+4 | ba | Unix timestamp, UINT32, Unit: s |
| Query data for a specified time range | 1+8 | bb | Start Unix Timestamp (4B) + End Unix Timestamp (4B), UINT32, Unit: s |
| Stop data query report | 1 | bc | - |
| Query report interval | 1+3 | c5 | Byte 1:
03 Byte 2-3: UINT16, Unit:s, Range: 30-1200 s, Default: 60s |
| Command | Report Mode | Timestamp | Historical Data |
|---|---|---|---|
| ed | 01 | UINT32, Unit: s | Command + Data, see Data description |
| Item | Byte | Command | Description |
|---|---|---|---|
| Energy Level | 1+1 | 00 | UINT8, Unit: % |
| Ambient Temperature | 1+2 | 01 | INT16/100, Unit:
°C 8000=Disabled, 8001=Collection Failure, 8002=Over-range, 8003=Under-range |
| Current Valve Opening | 1+1 | 04 | UINT8, Unit: % |
| Target Temperature | 1+2 | 06 | INT16/100, Unit: °C |
| Target Valve Opening | 1+1 | 07 | UINT8, Unit: % |
- Example:
-
Enquire the historical data in a time range.
bb44605b699c625b69 Command Value bb Start time: 44 60 5b 69 => 69 5b 60 44 = 1767596100s End time: 9c 62 5b 69 => 69 5b 62 9c = 1767596700s
Reply:ed01fd605b69019b0a04000064063a07 Command Report Mode Timestamp Command Value ed 01 fd 60 5b 69 => 695b60fd =1767596285s 01 Ambient Temperature: 9b 0a=>0a 9b=2715/100=27.15°C 04 Current valve opening: 00>0% 00 Energy Level: 64=>100% 06 Target Temperature: 3a 07 => 07 3a = 1850/100=18.5 °C