exportDeviceData(params: ExportDeviceDataParams)
Additional notesRead the full notes
Description
Export the device's energy data for a specified time range and send it to the designated email address. Multiple indicators are supported in a single export. The export task is asynchronous: a successful response only means the task was submitted; the email will be sent after background processing.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Yes | Request parameters |
Return Value
Referenced Types
DateType| Value | Actual Value | Description |
|---|---|---|
DateType.Hour | hour | Hour-level granularity; date format is `YYYYMMDDHH`, e.g., `2026010108` |
DateType.Day | day | Daily granularity, date format `YYYYMMDD`, e.g., `20260101` |
DateType.Month | month | Monthly granularity, date format `YYYYMM`, e.g., `202601` |
IndicatorCode| Value | Actual Value | Description |
|---|---|---|
IndicatorCode.EleUsage | ele_usage | Electricity consumption |
IndicatorCode.EleCost | ele_cost | Electricity bill |
Valid Values
DateType
| Value | Description | Since |
|---|---|---|
hour | Hour-level granularity; date format is `YYYYMMDDHH`, e.g., `2026010108` | - |
day | Daily granularity, date format `YYYYMMDD`, e.g., `20260101` | - |
month | Monthly granularity, date format `YYYYMM`, e.g., `202601` | - |
IndicatorCode
| Value | Description | Since |
|---|---|---|
ele_usage | Electricity consumption | - |
ele_cost | Electricity bill | - |
Examples
Request example
Response example
FAQ
Why does the call to cloud capabilities fail?
Before using this API, please ensure that the product to which the device belongs has enabled the Electricity Statistics advanced capability on the Tuya IoT Development Platform. Products without this capability enabled cannot collect electricity consumption/cost data, and the API will return empty data or an error. If you need to use it, please create a product with electricity consumption/cost statistics functions and enable the corresponding advanced capabilities in the product details. At the same time, the API depends on cloud capabilities, and authorization configuration is required in Development Settings - Cloud Capabilities on the Mini Program Developer Platform.