Skip to content
简体中文
Tuya MiniApp
开发
Ray 开发
API
getStatisticsRangMonth

getStatisticsRangMonth

该接口为云能力,需开通授权后使用,关于云能力可查看文档
目前云能力在 开发者工具环境无法使用,需要打包后或真机调试使用。

月 为时间间隔,获取设备日期区间的统计数据。

请求参数

参数数据类型说明是否必填
devIdstring设备 ID
dpIdstring | numberDP 点的 ID
startMonthstring开始月份,yyyyMM 格式
endMonthstring结束月份, yyyyMM 格式
typestring统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum

请求示例

// @ray-js/ray^1.2.12
import { getStatisticsRangMonth } from '@ray-js/ray';
 
getStatisticsRangMonth({
  devId: 'vdevo161733425146241',
  dpId: '18',
  startMonth: '202304',
  endMonth: '202305',
  type: 'avg',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

var response = {
  202304: '0',
  202305: '24.00',
};
此页内容是否对您有帮助?
意见反馈
小程序机器人助手
需求提交
|
论坛反馈
|
问卷调查
|
官方群聊