exportStatisticsHour
该接口为云能力,需开通授权后使用,关于云能力可查看文档
小时 为时间间隔,导出设备日期区间的统计数据。
请求参数
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
devId | string | 设备 ID | 是 |
string | 邮箱地址 | 是 | |
title | string | 邮件标题 | 否 |
dpExcelQuery | array | string | 查询条件,DpExcelQuery 数组对象 或 转成 json 字符串,详见下文 | 是 |
date | string | 要查询的日期,yyyyMMdd 格式 | 是 |
type | string | 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum | 否 |
lang | string | 多语言格式 'cn' | 'en' | ... | 是 |
DpExcelQuery 对象
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
dpId | string | number | 要查询的数据点 ID | 是 |
title | string | Excel 数据列名 | 是 |
handler | string | 转化规则,目前支持 华氏度转摄氏度: 'temperatureF2C', 摄氏度转华氏度: 'temperatureC2F' | 否 |
请求示例
// @ray-js/ray^1.2.12
import { exportStatisticsHour } from '@ray-js/ray';
exportStatisticsHour({
devId: 'vdevo161733425146241',
email: 'xxx@gmail.com',
dpExcelQuery: [{ dpId: 18, name: 'excel数据列标题' }],
date: '20230511',
type: 'avg',
lang: 'cn',
title: '这是一个标题',
})
.then((response) => {
console.log(response);
})
.catch();
返回示例
true;
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。
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',
};
exportStatisticsDay
该接口为云能力,需开通授权后使用,关于云能力可查看文档
天 为时间间隔,导出设备日期区间的统计数据。
请求参数
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
devId | string | 设备 ID | 是 |
string | 邮箱地址 | 是 | |
title | string | 邮件标题 | 否 |
dpExcelQuery | array | string | 查询条件,DpExcelQuery 数组对象 或 转成 json 字符串,详见下文 | 是 |
startDay | string | 开始日期,yyyyMMdd 格式 | 是 |
endDay | string | 结束日期,yyyyMMdd 格式 | 是 |
type | string | 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum | 否 |
lang | string | 多语言格式 'cn' | 'en' | ... | 是 |
DpExcelQuery 对象
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
dpId | string | number | 要查询的数据点 ID | 是 |
title | string | Excel 数据列名 | 是 |
handler | string | 转化规则,目前支持 华氏度转摄氏度: 'temperatureF2C', 摄氏度转华氏度: 'temperatureC2F' | 否 |
请求示例
// @ray-js/ray^1.2.12
import { exportStatisticsDay } from '@ray-js/ray';
exportStatisticsDay({
devId: 'vdevo161733425146241',
email: 'xxx@gmail.com',
dpExcelQuery: [{ dpId: 18, name: 'excel数据列标题' }],
startDay: '20230510',
endDay: '20230511',
type: 'avg',
lang: 'cn',
title: '这是一个标题',
})
.then((response) => {
console.log(response);
})
.catch();
返回示例
true;
getStatisticsRangMonth
该接口为云能力,需开通授权后使用,关于云能力可查看文档
月 为时间间隔,获取设备日期区间的统计数据。
请求参数
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
devId | string | 设备 ID | 是 |
dpId | string | number | DP 点的 ID | 是 |
startMonth | string | 开始月份,yyyyMM 格式 | 是 |
endMonth | string | 结束月份, yyyyMM 格式 | 是 |
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',
};
exportStatisticsMonth
该接口为云能力,需开通授权后使用,关于云能力可查看文档
月 为时间间隔,导出设备日期区间的统计数据。
请求参数
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
devId | string | 设备 ID | 是 |
string | 邮箱地址 | 是 | |
title | string | 邮件标题 | 否 |
dpExcelQuery | array | string | 查询条件,DpExcelQuery 数组对象 或 转成 json 字符串,详见下文 | 是 |
startMonth | string | 开始月份,yyyyMM 格式 | 是 |
endMonth | string | 结束月份,yyyyMM 格式 | 是 |
type | string | 统计类型,'sum' | 'avg' | 'minux' | 'max' | 'min' | 'count';默认 sum | 否 |
lang | string | 多语言格式 'cn' | 'en' | ... | 是 |
DpExcelQuery 对象
参数 | 数据类型 | 说明 | 是否必填 |
---|---|---|---|
dpId | string | number | 要查询的数据点 ID | 是 |
title | string | Excel 数据列名 | 是 |
handler | string | 转化规则,目前支持 华氏度转摄氏度: 'temperatureF2C', 摄氏度转华氏度: 'temperatureC2F' | 否 |
请求示例
// @ray-js/ray^1.2.12
import { exportStatisticsMonth } from '@ray-js/ray';
exportStatisticsMonth({
devId: 'vdevo161733425146241',
email: 'xxx@gmail.com',
dpExcelQuery: [{ dpId: 18, name: 'excel数据列标题' }],
startMonth: '202304',
endMonth: '202305',
type: 'avg',
lang: 'cn',
title: '这是一个标题',
})
.then((response) => {
console.log(response);
})
.catch();
返回示例
true;
👉 立即免费领取开发资源,体验涂鸦 MiniApp 小程序开发。