getStatisticsRang15min(data: IGetStatisticsRang)

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

Description

With a 15-minute interval, retrieve the device's statistics for the date range.

Parameters

ParameterTypeRequiredDescription
YesRequest body

Return Value

Type: Promise<IStatisticsData>
IStatisticsData (keys are time slices, values are statistic strings; missing data may be `#`, etc.—see the response example in the docs)

Referenced Types

typeIStatisticsDataFlattened data from interval statistics APIs: keys are time slices (e.g., 15-min buckets, hour, day, month; format varies by API), values are statistical result strings; missing data may be placeholders such as `'#'` (see the response examples of each API).
Record<string, string>

Valid Values

ICommonGetStatisticsRang.type
ValueDescriptionSince
sum--
avg--
minux--
max--
min--
count--
recent--

Examples

Request example

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

getStatisticsRang15min({
  devId: 'vdevo161733425146241',
  dpId: '18',
  date: '20230511',
  type: 'avg',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

Response example

{
  "202105260000": "1312.02",
  "202105260015": "1249.49",
  "202105262345": "#",
  "...": "..."
}