🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[TOC=2] ## 数据上报 ~~~[api] post:/index/flat_statistics/save <<< 数据上报格式 //上报的数据放到body里面格式如下 { "sn":"748000003170", "P":0, // 当前时间点前 60 分钟平均功率 "E":0, // 当前时间点前 60 分钟的累计电量 "time":1552270489, // 结束时间前一秒时间戳 08:59:59,代表这个时间点前 60 分钟的数据 "T_RUN":0, // 当前时间点前 60 分钟累计加热时长 单位秒 "T_agv":16, // 当前时间点前 60 分钟平均温度 "temp_status": 0, // 当前时间前 60 分钟设定温度 "address":1, // 温控器地址 } <<< success { "code": 0 } <<< error { "code": -1, "msg": "设备序列号格式不正确" } ~~~ ## 在线数上报 ~~~[api] post:/index/flat_statistics/device_number *string:sn=748000003170#设备序列号 *int:total=10#设备总数 *int:online=1#在线设备数 <<< success { "code": 0 } <<< error { "code": -1, "msg": "设备序列号格式不正确" } ~~~ ## 设备列表所有电量 ~~~[api] get:/index/flat_statistics/all_battery *int:device_type=53#设备类型 *string:filter_type=day#筛选类型 *string:filter_date=2020-09-19#筛选时间 <<< success { "code": 0, "data": { "list": [ { "peak_E": 0, "valley_E": 0, "flat_E": 0, "fees": 0, "time": 0, "P": 0, "E": 0, "detail_time": "2020-09-18 00:00:00", "label": "00" }, .... { "peak_E": 0, "valley_E": 0, "flat_E": 0, "fees": 0, "time": 23, "P": 0, "E": 0, "detail_time": "2020-09-18 23:00:00", "label": "23" } ], "total_e": 0, "total_fees": 0 } } <<< error ~~~ ## 设备列表数量统计 ~~~[api] post:/index/flat_statistics/get_device_number *array:sn_list=['748011111111']#设备序列号数组 <<< success { "code": 0, "data": { "total": 20, "online": 12 } } <<< error ~~~ ## 单个设备电量 ~~~[api] get:/index/flat_statistics/single_device_electricity_bill *string:sn=748000003170#设备序列号 *int:address=1#温控器地址 *string:filter_type=day#筛选类型 *string:filter_date=2020-09-19#筛选时间 <<< success { "code": 0, "data": { "list": [ { "peak_E": 0, "valley_E": 0, "flat_E": 0, "fees": 0, "time": 0, "P": 0, "E": 0, "detail_time": "2020-09-18 00:00:00", "label": "00" }, .... { "peak_E": 0, "valley_E": 0, "flat_E": 0, "fees": 0, "time": 23, "P": 0, "E": 0, "detail_time": "2020-09-18 23:00:00", "label": "23" } ], "total_e": 0, "total_fees": 0 } } <<< error ~~~ ## 单个设备温度 ~~~[api] get:/index/flat_statistics/get_device_temp *string:sn=748000003170#设备序列号 *int:address=1#温控器地址 *string:filter_date=2020-09-19#筛选时间 <<< success { "code": 0, "data": { "list": [ { "T_agv": 0, "temp_status": 0, "time": 0, "detail_time": "2020-09-16 00:00:00", "label": "00" }, { "T_agv": 0, "temp_status": 0, "time": 23, "detail_time": "2020-09-16 23:00:00", "label": "23" } ] } } <<< error ~~~ ## 单个设备电量 ~~~[api] get:/index/flat_statistics/single_thermostat_battery *string:sn=748000003170#设备序列号 *int:address=1#温控器地址 *string:filter_type=day#筛选类型 *string:filter_date=2020-09-19#筛选时间 <<< success { "code": 0, "data": { "list": [ { "P": 0, "E": 0, "T_RUN": 0, "T_agv": 0, "temp_status": 0, "time": 1, "detail_time": "2020-09-01", "label": "09-01" }, { "P": 0, "E": 0, "T_RUN": 0, "T_agv": 0, "temp_status": 0, "time": 30, "detail_time": "2020-09-30", "label": "09-30" } ] } } <<< error ~~~