getStatisticsConfig(data: IDevId)

Requires:
@tuya-miniapp/cloud-api≥1.0.5

Description

Retrieve the statistics configuration and the DPs enabled for Smart Metering, along with their settings.

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<IStatisticsConfig[]>
IStatisticsConfig[] (see type definitions and the minituya return value table for field meanings)

Examples

Request example

import { getStatisticsConfig } from '@tuya-miniapp/cloud-api';

getStatisticsConfig({
  devId: 'vdevo166789063330437',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

Response example

[
  {
    "storageDuration": 365,
    "productId": "lcrxzqjqojafatrv",
    "dpId": 18,
    "statisticInterval": 1,
    "algorithmType": "avg"
  },
  {
    "storageDuration": 365,
    "productId": "lcrxzqjqojafatrv",
    "dpId": 1,
    "statisticInterval": 1,
    "algorithmType": "count"
  },
  {
    "storageDuration": 7,
    "productId": "lcrxzqjqojafatrv",
    "dpId": 1,
    "statisticInterval": 2,
    "algorithmType": "count"
  }
]