DGIOT是一个面向物联网的开源数据分析平台,它为用户提供了快速、高效采集、管理和分析物联网设备数据的能力,并具备多种数据处理和可视化展示方式。
DGIOT的安装实例数已经超过 35.2k,用户遍布全球。拿下多个物联网产品的领域赛道冠军。
已承建多个重大国际赛事场馆数字驾驶舱、平安校园数据中台、电信级设备监管平台、千亿级产业大脑等。
全开放源码,全流程低代码。
强大开源社区,集成和兼容各种开源工具。
商业级物联网基座,快速承接物联网项目。
面向工业物联网的轻量级开源平台,致力于平台的标准化和工具化。打造全面、丰富、专业的开源生态产品及服务。
首页 › 博客, 实战教程, 技术文章
点击对应的设备,进行一个数据的订阅,mqtt发送的数据
[ { "devicetype": "换算值", "identifier": "conversion_flow", "imgurl": "", "name": "换算流量", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "m³/h" }, { "devicetype": "换算值", "identifier": "conversion_head", "imgurl": "", "name": "换算扬程", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "" }, { "devicetype": "换算值", "identifier": "conversion_power", "imgurl": "", "name": "换算功率", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "kW" }, { "devicetype": "计算值", "identifier": "effect", "imgurl": "", "name": "机组效率", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "%" }, { "devicetype": "计算值", "identifier": "head", "imgurl": "", "name": "扬程", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "m" }, { "devicetype": "仪表数据", "identifier": "power", "imgurl": "", "name": "功率", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "kW" }, { "devicetype": "仪表数据", "identifier": "factor", "imgurl": "", "name": "功率因数", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "" }, { "devicetype": "仪表数据", "identifier": "current_c", "imgurl": "", "name": "电流_c", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "A" }, { "devicetype": "仪表数据", "identifier": "current_b", "imgurl": "", "name": "电流_b", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "A" }, { "devicetype": "仪表数据", "identifier": "current_a", "imgurl": "", "name": "电流_a", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "A" }, { "devicetype": "仪表数据", "identifier": "vol", "imgurl": "", "name": "电压", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "V" }, { "devicetype": "仪表数据", "identifier": "motorspeed", "imgurl": "", "name": "转速", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "r/min" }, { "devicetype": "仪表数据", "identifier": "pressure_in", "imgurl": "", "name": "进口压力", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "KPa" }, { "devicetype": "仪表数据", "identifier": "pressure_out", "imgurl": "", "name": "出口压力", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "KPa" }, { "devicetype": "仪表数据", "identifier": "flow", "imgurl": "/dgiot_file/devicething/ico/fa82a59201.flow.png?timestamp=1640852770146", "name": "流量", "number": "--", "time": "2022-12-02 15:00:22", "type": "float", "unit": "m³/h" } ]
替换发送数据 ```javascript //conversion_flow:该数值为物模型的变量名 document.getElementsByClassName('conversion_flow')[1].getElementsByClassName('antd-PlainField')[0].innerHTML</p> <pre><code>采集数据amis样例 ```json { "type": "crud", "id": "u:e609cd7a9561", "api": { "url": "/iotapi/amis/Device/${objectId}", "method": "get", "adaptor": "let list = []\r\nlet index = Math.floor(Math.random()*payload.data.profile.historicaldata.length)\r\nlist.push(payload.data.profile.historicaldata[index])\r\nlet rows = list\r\nlet columns = payload.data.profile.historicaldatacolumns\r\ncolumns.forEach(item =>{\r\n item.name = item.prop\r\n item.className = item.prop\r\n})\r\nlet data = {\r\n rows,\r\n columns,\r\n collect:rows\r\n}\r\nreturn {\r\n data,\r\n msg:\"ok\",\r\n status:0\r\n}\r\n" }, "name": "collect", "messages": { }, "bulkActions": [ ], "itemActions": [ ], "placeholder": "-", "syncLocation": false, "perPageAvailable": [ 10 ], "columnsTogglable": false }
1。添加采集数据初始化接口 2.格式要求
{ rows:[], columns:[] }
{ "rows": [ { watertemperature:"-", flow:'-', pressure_out:'-', pressure_in:'-', rotate:'-', vol:'-', current:'-', power:'-', head:'-' } ], "columns": [ { "label": "水温度(°C)", "prop": "watertemperature", "name": "watertemperature", "className": "watertemperature" }, { "label": "流量(m³/h)", "prop": "flow", "name": "flow", "className": "flow" }, { "label": "出口压力(MPa)", "prop": "pressure_out", "name": "pressure_out", "className": "pressure_out" }, { "label": "进口压力(MPa)", "prop": "pressure_in", "name": "pressure_in", "className": "pressure_in" }, { "label": "转速(r/min)", "prop": "rotate", "name": "rotate", "className": "rotate" }, { "label": "电压(V)", "prop": "vol", "name": "vol", "className": "vol" }, { "label": "电流(A)", "prop": "current", "name": "current", "className": "current" }, { "label": "功率(kW)", "prop": "power", "name": "power", "className": "power" }, { "label": "扬程(m)", "prop": "head", "name": "head", "className": "head" }, { "label": "机组效率(%)", "prop": "effect", "name": "effect", "className": "effect" } ] }
## 3.数据采集下发 ![file](http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/doc_xxb/amis/1.png) 过程:增加一个控制下发的采集接口,点击按钮触发接口,后端发送要采集的数据 ## 4.实时数据展示 ![file](http://dgiot-1253666439.cos.ap-shanghai-fsi.myqcloud.com/dgiot_web/doc_xxb/amis/2.png) - 实时数据替换 ```javascript //conversion_flow:该数值为物模型的变量名 document.getElementsByClassName('conversion_flow')[3].innerHTML
实时数据amis样例
{ "type": "crud", "api": { "url": "/iotapi/devicecard/${objectId}", "method": "get", "adaptor": "console.log('payload1111',payload)\r\nreturn {\r\n data:{\r\n items:payload.data\r\n },\r\n msg:'ok',\r\n status:0\r\n}" }, "card": { "body": [ { "tpl": "<span style='color:#0000ff;margin-left:50px;font-size:24px' class='${identifier}'>${number}</span>", "type": "tpl" }, { "name": "time", "label": "时间" } ], "header": { "title": "$name", "avatar": "", "subTitle": "$unit", "avatarClassName": "pull-left thumb b-3x m-r" } }, "mode": "cards", "messages": { }, "draggable": true, "placeholder": "暂无数据", "silentPolling": true, "perPageAvailable": [ 10 ] }
加微信咨询
请填写下面表单,我们的工作人员会与您联系。
报错: 未找到这个表单
请填写下面表单,我们会即时将最新版本下载地址发到您的邮箱。
加小迪为好友即可加入交流群