可视化接口文档
1.项目说明
Section titled “1.项目说明”标题: ATU-CLOUD 后台服务API接口文档
联系人:苏州新森智能科技有限公司
Version:1.0
Group:atu
2.接口列表
Section titled “2.接口列表”2.1 说明
Section titled “2.1 说明”- 对外接口使用统一的url前缀
- 访问接口前,需要获取访问密钥。由管理员授权
2.1.1 接口url
Section titled “2.1.1 接口url”2.1.2 统一状态码
Section titled “2.1.2 统一状态码”| 状态码 | 说明 | schema |
|---|---|---|
| 200 | OK | 调用成功 |
| 401 | Unauthorized | 未授权 |
| 403 | Forbidden | 权限不足 |
| 404 | Not Found | 接口不存在 |
| 500 | failed | 访问失败 |
2.2 获取访问令牌 (第一步)
Section titled “2.2 获取访问令牌 (第一步)”2.2.1 密钥 account_key
Section titled “2.2.1 密钥 account_key”由管理员提供,格式如下:
{ account_key:"6041ce8fb7a719301481e24419b816f7" //参考用,不作为实际用例}2.2.2 获取token
Section titled “2.2.2 获取token”接口地址:/atu/sys/getToken
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*
接口描述:
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| account_key | account_key | query | true | string |
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | object | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例:
{ "code": 0, "message": "", "result": { "token":"xxx" }, "success": true, "timestamp": 0}2.2.3 token使用
Section titled “2.2.3 token使用”每次请求时,请求头中添加
header:{ "X-Access-Token":"xxx"}注意:token 有效期为2小时,过期响应如下:
{"success":true,"message":"Token失效,请重新登录!","code":401,"result":null,"timestamp":1713300864997}2.3 项目管理
Section titled “2.3 项目管理”2.3.1 项目列表
Section titled “2.3.1 项目列表”接口地址:/atu/api/project/list
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:*/*
接口描述:
通过访问令牌获取权限范围内的所有项目列表
请求参数:
无
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | array | project对象 |
| area | 建筑面积 | number(double) | |
| buildingPersonsNum | 建筑人数 | string | |
| buildingPowerUsage | 建筑用电 | number(double) | |
| buildingType | 建筑类型 | string | |
| co2reduced | 碳节约 | number(double) | |
| code | 编码 | string | |
| createId | 创建人 | string | |
| createTime | 创建时间 | string(date-time) | |
| createdBy | 创建人 | string | |
| createdTime | 创建时间 | string(date-time) | |
| dbType | 数据库类型 | string | |
| dbUrl | 数据库url | string | |
| departs | 租户 | string | |
| devicePowerUsage | 设备用电 | number(double) | |
| fullPowerSaved | 总节约用电 | number(double) | |
| fullYearDevicePowerUsage | 全年设备用电 | number(double) | |
| fullYearPowerUsage | 全年建筑用电 | number(double) | |
| generateReady | 生成就绪 | integer(int32) | |
| greenCo | 碳排放指标 | number(double) | |
| greenPower | 能耗指标 | number(double) | |
| id | 项目id | string | |
| level | 等级 | string | |
| location | 位置 | string | |
| logo | Logo | string | |
| miniProgramDevices | array | 小程序对象 | |
| name | 名称 | string | |
| normalCo | 常规碳排放 | number(double) | |
| normalPower | 常规能耗 | number(double) | |
| privateKey | 私钥 | string | |
| projectConfigs | array | ProjectConfig | |
| projectLogo | 项目logo | string | |
| publicKey | 公钥 | string | |
| reference65 | 参数65 | number(double) | |
| supportChartChange | 支持图标更改 | integer(int32) | |
| tech | 技术指标 | string | |
| title | 平台名称 | string | |
| titleEnglish | 看板标题英文 | string | |
| titleOfPlatform | 平台标题 | string | |
| updatedBy | 修改人 | string | |
| updatedTime | 修改时间 | string(date-time) | |
| version | 版本 | integer(int32) | |
| visualBgType | 可视化背景类型 | string | |
| visualPic | 视觉图片 | string | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例:
{ "code": 0, "message": "", "result": [ { "area": 0, "buildingPersonsNum": "", "buildingPowerUsage": 0, "buildingType": "", "co2reduced": 0, "code": "", // 项目编码 "createId": "", "createTime": "", "createdBy": "", "createdTime": "", "dbType": "", "dbUrl": "", "departs": "", "devicePowerUsage": 0, "fullPowerSaved": 0, "fullYearDevicePowerUsage": 0, "fullYearPowerUsage": 0, "generateReady": 0, "greenCo": 0, "greenPower": 0, "id": "", "level": "", "location": "", "logo": "", "miniProgramDevices": [], "name": "", // 项目名称 "normalCo": 0, "normalPower": 0, "privateKey": "", "projectConfigs": [], "projectLogo": "", "publicKey": "", "reference65": 0, "supportChartChange": 0, "tech": "", "title": "", "titleEnglish": "", "titleOfPlatform": "", "updatedBy": "", "updatedTime": "", "version": 0, "visualBgType": "", "visualPic": "" } ], "success": true, "timestamp": 0}2.3.2 项目基本信息
Section titled “2.3.2 项目基本信息”接口地址:/atu/api/project/queryById
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:*/*
接口描述:
项目基本信息
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数:
2.3.3 项目配置信息
Section titled “2.3.3 项目配置信息”接口地址:/atu/api/project/config
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:*/*
接口描述:
项目配置列表
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | array | ProjectConfig |
| configCode | string | ||
| configItems | array | ProjectConfigItem | |
| configName | string | ||
| id | string | ||
| operateType | string | ||
| projectId | string | ||
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例:
{ "code": 0, "message": "", "result": [ { "configCode": "power_lift", //配置一 "configName": "分项-电梯", "operateType": "sum", "configItems": [ //指定的设备(多个) { "deviceId":"DTSU01", //设备1 "weight": { "effiency": 1, "Efficiency": 1, "power": "1" //计算权重 }, "device": { "name": "1层照明", "type": "电表", "prodModel": "ADL", "location": "1层", ... } }, { "deviceId": "DTSU02", //设备2 ... } ] ], }, { "configCode": "power_hvac", //配置二 "configName": "分项-暖通空调", "operateType": "sum", "configItems": [], }, ... ], "success": true, "timestamp": 0}2.4 设备管理
Section titled “2.4 设备管理”2.4.1 设备列表
Section titled “2.4.1 设备列表”接口地址:/atu/api/device/list
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:*/*
接口描述:
项目所有设备
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | array | device对象 |
| alarms | 告警列表 | array | alarm对象 |
| coordXY | 3d坐标xyz | string | |
| createTime | 创建时间 | string(date-time) | |
| deleteFlag | 删除标记 | integer(int32) | |
| groupId | string | ||
| groupIds | array | string | |
| id | uuid | string | |
| isOnline | string | ||
| lastTime | integer(int64) | ||
| location | 楼层位置 | string | |
| name | 名称 | string | |
| position | 经纬度 | string | |
| prodModel | 型号 | string | |
| projectId | string | ||
| properties | object | ||
| type | 类型 | string | |
| usageComment | 用途说明 | string | |
| val | number(double) | ||
| weight | 权重 | string | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例:
{ "code": 0, "message": "", "result": [ { "alarms": [], "coordXY": "", "createTime": "", "deleteFlag": 0, "groupId": "", "groupIds": [], "id": "", "isOnline": "", "lastTime": 0, "location": "", "name": "", "position": "", "prodModel": "", "projectId": "", "properties": {}, "type": "", "usageComment": "", "val": 0, "weight": "" } ], "success": true, "timestamp": 0}2.4.2 设备基本信息
Section titled “2.4.2 设备基本信息”接口地址:/atu/api/device/queryById
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:*/*
接口描述:
设备基本信息
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| deviceId | deviceId | query | true | string |
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | device对象 | device对象 |
| alarms | 报警列表 | array | alarm对象 |
| coordXY | 坐标xyz | string | |
| createTime | 创建时间 | string(date-time) | |
| deleteFlag | 删除标记 | integer(int32) | |
| groupId | string | ||
| groupIds | array | string | |
| id | uuid | string | |
| isOnline | string | ||
| lastTime | integer(int64) | ||
| location | 楼层位置 | string | |
| name | 名称 | string | |
| position | 经纬度 | string | |
| prodModel | 型号 | string | |
| projectId | string | ||
| properties | object | ||
| type | 类型 | string | |
| usageComment | 用途说明 | string | |
| val | number(double) | ||
| weight | 权重 | string | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例:
{ "code": 0, "message": "", "result": { "alarms": [], "coordXY": "", "createTime": "", "deleteFlag": 0, "groupId": "", "groupIds": [], "id": "", "isOnline": "", "lastTime": 0, "location": "", "name": "", "position": "", "prodModel": "", "projectId": "", "properties": {}, "type": "", "usageComment": "", "val": 0, "weight": "" }, "success": true, "timestamp": 0}2.4.3 设备日志
Section titled “2.4.3 设备日志”接口地址:/atu/api/device/log
请求方式:POST
请求数据类型:application/json
响应数据类型:*/*
接口描述:
设备日志
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| queryLogDto | 查询日志对象 | body | true | QueryLogDto对象 | QueryLogDto对象 |
| configId | 不同分项,如环境,用电(电梯、暖通、照明) | false | string | ||
| deviceId | 设备id | false | string | ||
| endTime | 结束时间 | false | string | ||
| endTime2 | 同比结束时间 | false | string | ||
| projectId | 项目id | false | string | ||
| startTime | 开始时间 | false | string | ||
| startTime2 | 同比开始时间 | false | string | ||
| timeType | 时间类型,year month day hour second | false | string |
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | RangeData | RangeData |
| data | 一维数据 | array | object |
| key | string | ||
| mdData | 多维数据 | array | array |
| mdRange | 同比 多维 | array | array |
| range | 时间范围 | array | string |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
2.5.3.1 设备日志(单个)
Section titled “2.5.3.1 设备日志(单个)”请求示例:
{ "deviceId": "SL5060801", //指定设备id "projectId": "AIRTOU", "timeType": "day", // year month day hour second "startTime": "2024-01-01 00:00:00", "endTime": "2024-01-03 00:00:00", "configId": "", "startTime2": "", "endTime2": "",}响应示例:
{ "success": true, "message": "", "code": 200, "result": { "key": null, "range": [ //时间列表 "2024-01-01", "2024-01-02", ], "mdRange": [], "data": [ //一维数组 { "tvoc": 0.38, "temp": 30.03, "pm25": 38.0, "co2": 1409.02, "humi": 28.8, "ch2o": 0.01, "ts": "2024-01-01 00:00:00" //2024-01-01 }, { "tvoc": 0.34, "temp": 31, "pm25": 36.0, "co2": 1411, "humi": 28.5, "ch2o": 0.04, "ts": "2024-01-02 00:00:00" //2024-01-01 } ], "mdData": [] }, "timestamp": 1714757513021}2.5.3.2 设备日志(多个-分项汇总)
Section titled “2.5.3.2 设备日志(多个-分项汇总)”请求示例:
{ "deviceId": "", "projectId": "AIRTOU", "timeType": "day", // year month day hour second "startTime": "2024-01-01 00:00:00", "endTime": "2024-01-03 00:00:00", "configId": "env", //配置项 "startTime2": "", "endTime2": "",}响应示例:
{ "code": 0, "message": "", "result": { "range": [ "2024-01-01", "2024-01-02", ... ] "data": [ //项目配置(如环境: 指定多个传感器) { "id": "SL5060801", "name": "传感器", "prodModel": "S506-1", ... }, { "id": "SL5060802", "name": "传感器", "prodModel": "S506-1", ... },... ], "mdData": [ //多维数组 [ // 2024-01-01 { tvoc": 0.51, temp": 23, //SL5060801 ... }, { tvoc": 0.27, temp": 25, //SL5060802 .. }, ... { "tvoc": 0.39, "temp": 24, //数组最后一个元素为统计数据 --> 求和(或求和平均) ... }, ], [ // 2024-01-02 { "tvoc": 0.51, "temp": 22, //SL5060801 ... }, { "tvoc": 0.27, "temp": 24, //SL5060802 ... }, ] ], "mdRange": [], }, "success": true, "timestamp": 0}2.4.4 设备实时数据
Section titled “2.4.4 设备实时数据”2.4.4.1 方式一:http
Section titled “2.4.4.1 方式一:http”接口地址:/atu/api/device/realData
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:*/*
接口描述:
设备实时数据
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| deviceId | deviceId | query | true | string |
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | object | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例:
{ "success": true, "message": "", "code": 200, "result": { "lastTime": 1714596905402, //上报时间 "deviceId": "SL5060801", "properties": { "tvoc": 0.685, "temp": 27.99, "pm25": 51, "co2": 480, "humi": 42.09, "ch2o": 0.039 } }, "timestamp": 1714607172562}2.5.4.2 方式二:websocket
Section titled “2.5.4.2 方式二:websocket”接口地址:wss://biot.airtoall.com/atu/websoket/${channelId}
接口描述:
设备实时数据
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| channelId | 频道ID(由管理员提供) | query | true | string |
响应示例:
{ "body":{ "lastTime":1714565761915, //上报时间 "deviceId":"S5030147", "properties":{ "tvoc":0.38, "temp":22.99, "pm25":0.00, "co2":0.00, "humi":46.85, "ch2o":0.00, } }, "type":"device_realtime_data"}2.4.5 设备物模型
Section titled “2.4.5 设备物模型”接口地址:/atu/api/product/queryByCode
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:*/*
接口描述:
产品物模型
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| prodCode | prodCode | query | true | string |
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | object | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例:
{ "success": true, "message": "", "code": 200, "result": { "success": true, "message": "", "code": 200, "result": { "iotProductEntity": {}, //产品基本信息 "iotProfileInfoDTO": { "iotProfileEntity":{}, //物模型基本信息 "iotAttrList":[ { "name": "tvoc", //属性名称 "tag": "tvoc", "valueType": "Float32", //数据类型 "units": "mg/m³", //属性单位 ... }, ... ], "iotCmdList":{}, //指令 "iotEventList":{} //事件 } }}2.4.6 设备组信息
Section titled “2.4.6 设备组信息”接口地址:/atu/api/device/group/queryById
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:*/*
接口描述:
设备组信息
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| groupId | groupId | query | true | string |
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | group对象 | group对象 |
| comment | 备注 | string | |
| createTime | 创建时间 | string(date-time) | |
| devices | array | device对象 | |
| id | uuid | string | |
| name | 设备组名 | string | |
| parentId | 项目id | string | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例:
{ "code": 0, "message": "", "result": { "comment": "", "createTime": "", "devices": [], "id": "", "name": "", "parentId": "" }, "success": true, "timestamp": 0}2.4.7 设备报警日志
Section titled “2.4.7 设备报警日志”接口地址:/atu/api/device/alarm/log
请求方式:GET
请求数据类型:application/x-www-form-urlencoded
响应数据类型:*/*
接口描述:
设备报警日志
请求参数:
| 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectIds | 项目(多个项目逗号隔开) | query | true | array | string |
| alarmId | 规则id | query | false | string | |
| alarmName | 告警名称 | query | false | string | |
| alarmRank | 告警等级 | query | false | string | |
| alarmType | 告警类型 | query | false | string | |
| annoSuccess | 是否已通知 | query | false | string | |
| annotation | 通知方式 | query | false | string | |
| annoTo | 通知方式 | query | false | string | |
| createdBy | 创建人 | query | false | string | |
| createdTime | 创建时间 | query | false | string(date-time) | |
| deviceId | 设备Id | query | false | string | |
| deviceIds | 设备ids | query | false | array | string |
| endTime | 查询结束时间 | query | false | string | |
| id | 报警id | query | false | string | |
| isHandle | 是否已处理 | query | false | string | |
| pageNo | 分页 pageNo | query | false | integer(int32) | |
| pageSize | 分页 pageSize | query | false | integer(int32) | |
| projectId | 项目Id | query | false | string | |
| realValue | 实际值 | query | false | string | |
| rule | 规则描述 | query | false | string | |
| startTime | 查询开始时间 | query | false | string | |
| updatedBy | 修改人 | query | false | string | |
| updatedTime | 修改时间 | query | false | string(date-time) |
响应参数:
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | IPage«alarm_log对象» | IPage«alarm_log对象» |
| current | integer(int64) | ||
| pages | integer(int64) | ||
| records | array | alarm_log对象 | |
| alarmId | 规则id | string | |
| alarmName | 告警名称 | string | |
| alarmRank | 告警等级 | string | |
| alarmType | 告警类型 | string | |
| annoSuccess | 是否已通知 | string | |
| annoTo | 通知方式 | string | |
| annotation | 通知方式 | string | |
| createdBy | 创建人 | string | |
| createdTime | 创建时间 | string | |
| deviceId | 设备Id | string | |
| deviceIds | 设备ids | array | string |
| endTime | 查询结束时间 | string | |
| id | 报警id | string | |
| isHandle | 是否已处理 | string | |
| projectId | 项目Id | string | |
| projectIds | 项目 | array | string |
| realValue | 实际值 | string | |
| rule | 规则描述 | string | |
| startTime | 查询开始时间 | string | |
| updatedBy | 修改人 | string | |
| updatedTime | 修改时间 | string | |
| size | integer(int64) | ||
| total | integer(int64) | ||
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例:
{ "code": 0, "message": "", "result": { "current": 0, "pages": 0, "records": [ { "alarmId": "", "alarmName": "", "alarmRank": "", "alarmType": "", "annoSuccess": "", "annoTo": "", "annotation": "", "createdBy": "", "createdTime": "", "deviceId": "", "deviceIds": [], "endTime": "", "id": "", "isHandle": "", "projectId": "", "projectIds": [], "realValue": "", "rule": "", "startTime": "", "updatedBy": "", "updatedTime": "" } ], "size": 0, "total": 0 }, "success": true, "timestamp": 0}2.5 可视化-综合分析
Section titled “2.5 可视化-综合分析”2.5.1 建筑总能耗(当月、上月30天对比)
Section titled “2.5.1 建筑总能耗(当月、上月30天对比)”接口地址
GET /atu/api/visual/overall/energy30days
接口描述
建筑总能耗(当月、上月30天对比)
请求数据类型
application/x-www-form-urlencoded
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | RangeData | RangeData |
| data | 一维数据 | array | object |
| key | string | ||
| mdData | 多维数据 | array | array |
| mdRange | 同比 多维 | array | array |
| range | 时间范围 | array | string |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success": true, "message": "", "code": 200, "result": { "key": null, "range": null, "mdRange": [ [ "2024-05-01", "2024-05-02", ... ], [ "2024-04-01", "2024-04-02", ... ] ], "data": [], "mdData": [ [ { "AQI": 0, "power": 172.68 //2024-05-01 }, { "AQI": 0, "power": 729.03 //2024-04-01 } ], [ { "AQI": 0, "power": 170.23 //2024-05-02 }, { "AQI": 0, "power": 882.17 //2024-04-02 } ], ... ] }, "timestamp": 1714773918774}2.5.2环境实时数据
Section titled “2.5.2环境实时数据”接口地址
GET /atu/api/visual/overall/env
接口描述
环境实时数据
请求数据类型
application/x-www-form-urlencoded
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | array | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success": true, "message": "", "code": 200, "result": [ { "lastTime": 1714771217346, //上报时间 "deviceId": "SL5060801", "properties": { "tvoc": 0.56, "temp": 20.59, "pm25": 0, "co2": 499, "humi": 46.42, "ch2o": 0, } }, { "lastTime": 1714771197614, //上报时间 "deviceId": "SL5060801", "properties": { "tvoc": 0.64, "temp": 21.26, "pm25": 1, "co2": 470, "humi": 48.19, "ch2o": 0, } }, ... ],}2.5.3建筑总耗电与总碳排
Section titled “2.5.3建筑总耗电与总碳排”接口地址
GET /atu/api/visual/overall/sumEnergyAndCout
接口描述
建筑总耗电与总碳排
请求数据类型
application/x-www-form-urlencoded
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | object | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success": true, "message": "", "code": 200, "result": { "subCarbon": 62485, //减碳量 (Kg) "nomarl": 458168, //常规建筑用电 (kWh) "nearZero": 173279, //超低能耗建筑用电 (kWh) "totalPower": 66645, //总用电 (kWh) "totalCarbon": 74420, //总碳排 (Kg) "ratio": 0.54358 //减碳占比 (54%) }, "timestamp": 1714771402901}2.6 可视化-能耗分析
Section titled “2.6 可视化-能耗分析”2.6.1 能耗统计-获取分项定义
Section titled “2.6.1 能耗统计-获取分项定义”接口地址
GET /atu/api/visual/energy/branchDefine
接口描述
请求数据类型
application/x-www-form-urlencoded
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | array | ProjectConfig |
| configCode | 配置代码 | string | |
| configName | 配置名称 | string | |
| configItems | array | ProjectConfigItem | |
| -----configId | string | ||
| -----device | device对象 | device对象 | |
| -----weight | json对象 | ||
| -----weight2 | string | ||
| operateType | string | ||
| projectId | string | ||
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success": true, "message": "", "code": 200, "result": [ { "id": "ef6ba585ff5d414795e33c1d7652e96a3", "configCode": "power_lighting", //分项定义代码一:照明 "configName": "照明", "operateType": "sum", //计算方式:求和 "configItems": [ //指定的设备(多个) { "deviceId":"DTSU01", //设备1 "weight": { "effiency": 1, "Efficiency": 1, "power": "1" //计算权重 }, "device": { "name": "1层照明", "type": "电表", "prodModel": "ADL", "location": "1层", ... } }, { "deviceId": "DTSU02", //设备2 ... } ] ...
} ] }, { "id": "ef6baf89sdsf912df2k12j21aa52e96a3", "configCode": "power_lift", //分项定义代码二:电梯 "configName": "电梯", "operateType": "sum", //计算方式:求和 "configItems": [ //指定的设备(多个) { "deviceId": "DTSU03", //设备1 "weight": { "effiency": 1, "Efficiency": 1, "power": "1" //计算权重 }, "device": { "name": "1层照明", "type": "电表", "prodModel": "ADL", "location": "1层", ... } }, { "deviceId": "DTSU04", //设备2 ... } ] ...
} ] } ],}2.6.2统计-电表数量
Section titled “2.6.2统计-电表数量”接口地址
GET /atu/api/visual/energy/deviceNum
接口描述
请求数据类型
application/x-www-form-urlencoded
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | object | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success": true, "message": "", "code": 200, "result": { "offline": 1, //离线 "total": 26, //总数 "online": 25 //在线 },}2.6.3能耗统计-数据日志
Section titled “2.6.3能耗统计-数据日志”2.6.4能耗统计-当天各分项数据
Section titled “2.6.4能耗统计-当天各分项数据”接口地址
POST /atu/api/visual/energy/todayData
接口描述
请求数据类型
application/json
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | object | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success": true, "message": "", "code": 200, "result": { "总表": 342.48, //kWh "新风": 96.66, "电梯": 2.52, "暖通": 7.99, "照明": 33.71, "插座": 8.1 },}2.7 可视化-环境分析
Section titled “2.7 可视化-环境分析”2.7.1 环境统计-传感器统计 在线 离线
Section titled “2.7.1 环境统计-传感器统计 在线 离线”接口地址
GET /atu/api/visual/env/deviceNum
接口描述
请求数据类型
application/x-www-form-urlencoded
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | object | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success": true, "message": "", "code": 200, "result": { "offline": 1,//离线 "total": 216, //总数 "online": 215 //在线 }, "timestamp": 1714607425748}2.7.2环境统计-数据日志
Section titled “2.7.2环境统计-数据日志”2.8 可视化-碳排放
Section titled “2.8 可视化-碳排放”2.8.1 年碳排放统计(与上年12个月对比)
Section titled “2.8.1 年碳排放统计(与上年12个月对比)”接口地址
GET /atu/api/visual/cout/cout12months
接口描述
请求数据类型
application/x-www-form-urlencoded
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | RangeData | RangeData |
| data | 一维数据 | array | object |
| key | string | ||
| mdData | 多维数据 | array | array |
| mdRange | 同比 多维 | array | array |
| range | 时间范围 | array | string |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success": true, "message": "", "code": 200, "result": { "key": null, "range": null, "mdRange": [ [ "2024-01", "2024-02", ... ], [ "2023-01", "2023-02", ... ] ], "data": [], "mdData": [ [ { "effiency": 0, "cout": 8086.91, "AQI": 0, "power": 10318 //2024-01 }, { "effiency": 0, "cout": 0, "AQI": 0, "power": 0 //2023-01 } ], [ { "effiency": 0, "cout": 6442.43, "AQI": 0, "power": 82692 //2024-02 }, { "effiency": 0, "cout": 0, "AQI": 0, "power": 0 //2023-01 } ], ... ] }}2.8.2建筑总耗电与总碳排
Section titled “2.8.2建筑总耗电与总碳排”接口地址
GET /atu/api/visual/cout/data
接口描述
建筑总耗电与总碳排
请求数据类型
application/x-www-form-urlencoded
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| projectId | 项目编码 (code属性 ) | query | true | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | object | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success": true, "message": "", "code": 200, "result": { "totalPower": 0, //总用电 "savePower": 0, //累计节电量 "totalCarbon": 0, //总碳排 "subCarbon": 0, //累计减碳量
"subcarbon_building": 0, //减排量 - 建筑 "subcarbon_renewable": 0, //减排量 - 可再生能源 "subcarbon_greenCarbonSum": 6.468 //减排量 - 绿色碳汇
"tree": 0, //碳减量相当于,树 "coal": 0, //碳减量相当于,煤炭 }, "timestamp": 1714769632484}2.8.3碳交易曲线
Section titled “2.8.3碳交易曲线”接口地址
GET /atu/api/visual/cout/tradeList
接口描述
请求数据类型
application/x-www-form-urlencoded
响应数据类型
*/*
请求参数
| 参数名称 | 参数说明 | 请求类型 | 必须 | 数据类型 | schema |
|---|---|---|---|---|---|
| endTime | endTime | query | false | string | |
| startTime | startTime | query | false | string |
响应参数
| 参数名称 | 参数说明 | 类型 | schema |
|---|---|---|---|
| code | 返回代码 | integer(int32) | integer(int32) |
| message | 返回处理消息 | string | |
| result | 返回数据对象 | object | |
| success | 成功标志 | boolean | |
| timestamp | 时间戳 | integer(int64) | integer(int64) |
响应示例
{ "success":true, "message":"", "code":200, "result":{ "date":[ //时间 {"t_date":"2022-01-04"}, {"t_date":"2022-01-05"}, ... ], "area":[ //交易地点 {"t_area":"广州"}, {"t_area":"北京"}, ... ], "data":{ //交易额 "广州":[ {"t_turnover":25000.0,"t_area":"广州","t_date":"2022-01-04","t_price_average":54.54}, {"t_turnover":90460,"t_area":"广州","t_date":"2022-01-05","t_price_average":55.92}, ... ], "上海":[], ... }, "timestamp":1714769974211}