智能小程序开发 —— meature API 汇总(一)

getStatisticsConfig

获取统计配置,获取开通智能计量的 dp 点及配置。

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID

返回值

复制代码
Array<{
  algorithmType: 'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';
  dpId: number;
  productId: string;
  statisticInterval: number;
  storageDuration: number;
}>
参数 数据类型 说明
algorithmType string 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum
dpId number dp id
productId string 产品 id
statisticInterval number 统计间隔,数据保存天数,1(天)、2(小时)、4(月)、16(15 分钟)
storageDuration number 数据保存天数

请求示例

复制代码
// @ray-js/ray^1.2.12
import { getStatisticsConfig } from '@ray-js/ray';
 
getStatisticsConfig({
  devId: 'vdevo166789063330437',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

复制代码
var response = [
  {
    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',
  },
];

👉 立即开发

getStatisticsRang15min

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

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID
dpId string | number DP 点的 ID
date string 要查询的日期,yyyyMMdd 格式
type string 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum

请求示例

复制代码
// @ray-js/ray^1.2.12
import { getStatisticsRang15min } from '@ray-js/ray';
 
getStatisticsRang15min({
  devId: 'vdevo161733425146241',
  dpId: '18',
  date: '20230511',
  type: 'avg',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

复制代码
var response = {
  202105260000: '1312.02',
  202105260015: '1249.49',
  202105262345: '#',
  '...': '...',
};

getStatisticsRangHour

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

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID
dpId string | number DP 点的 ID
date string 要查询的日期,yyyyMMdd 格式
type string 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum

请求示例

复制代码
// @ray-js/ray^1.2.12
import { getStatisticsRangHour } from '@ray-js/ray';
 
getStatisticsRangHour({
  devId: 'vdevo161733425146241',
  dpId: '18',
  date: '20230511',
  type: 'avg',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

复制代码
var response = {
  2023051117: '0.00',
  2023051118: '24.00',
  2023051119: '0.00',
  '...': '...',
};

getStatisticsRangDay

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

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID
dpId string | number DP 点的 ID
startDay string 开始日期,yyyyMMdd 格式
endDay string 结束日期, yyyyMMdd 格式
type string 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum

请求示例

复制代码
// @ray-js/ray^1.2.12
import { getStatisticsRangDay } from '@ray-js/ray';
 
getStatisticsRangDay({
  devId: 'vdevo161733425146241',
  dpId: '18',
  startDay: '20230510',
  endDay: '20230511',
  type: 'avg',
})
  .then((response) => {
    console.log(response);
  })
  .catch();

返回示例

复制代码
var response = {
  20230501: '0',
  20230502: '0',
  20230503: '0',
  20230504: '0',
  20230505: '0',
  20230506: '0',
  20230507: '0',
  20230508: '0',
  20230509: '0',
  20230510: '26.00',
  20230511: '24.00',
};

getStatisticsRangMonth

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

请求参数

参数 数据类型 说明 是否必填
devId string 设备 ID
dpId string | number DP 点的 ID
startMonth string 开始月份,yyyyMMdd 格式
endMonth string 结束月份, yyyyMMdd 格式
type string 统计类型,'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',
};

👉 立即开发

相关推荐
站在风口的猪11088 分钟前
《前端面试题:CSS预处理器(Sass、Less等)》
前端·css·html·less·css3·sass·html5
程序员的世界你不懂33 分钟前
(9)-Fiddler抓包-Fiddler如何设置捕获Https会话
前端·https·fiddler
MoFe138 分钟前
【.net core】天地图坐标转换为高德地图坐标(WGS84 坐标转 GCJ02 坐标)
java·前端·.netcore
去旅行、在路上1 小时前
chrome使用手机调试触屏web
前端·chrome
Fanxt_Ja1 小时前
【JVM】三色标记法原理
java·开发语言·jvm·算法
蓝婷儿1 小时前
6个月Python学习计划 Day 15 - 函数式编程、高阶函数、生成器/迭代器
开发语言·python·学习
love530love2 小时前
【笔记】在 MSYS2(MINGW64)中正确安装 Rust
运维·开发语言·人工智能·windows·笔记·python·rust
Aphasia3112 小时前
模式验证库——zod
前端·react.js
slandarer2 小时前
MATLAB | 绘图复刻(十九)| 轻松拿捏 Nature Communications 绘图
开发语言·matlab
狐凄2 小时前
Python实例题:Python计算二元二次方程组
开发语言·python