RS485设备Api
# 简易添加
接口说明
简易添加一个RS485设备
接口版本
v1接口地址
/api-v1/hardwares/create-simple
请求方法
POST
请求参数
参数类型 | 参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|---|
body | - | Object | True | 设备对象字段说明 |
- | name | String | True | 网关名称 |
- | control | ObjectId | True | 网关ID |
- | hardwareWord | ObjectId | True | 字典ID |
- | shortAddress | String | True | 设备地址 |
- | netMqttDevice | String | True | MqttId |
请求参数举例
{
"name":"测试设备",
"shortAddress":"01",
"control": "5da994dc0dc418001b95d381",
"hardwareWord":"5d1f3f288ce12637b661b8e4",
"netMqttDevice":"6465d14672db352e90f3d15f",
}
// Make sure to add code blocks to your code group
返回参数
参数名称 | 数据类型 | 是否必须 | 参数描述 |
---|---|---|---|
code | number | True | 是否成功 |
data | json | True | 返回创建的对象 |
返回参数举例
{
"code": 0,
"data": {
"_id": "6465f838a60e9c46913daf1c",
"name": "3333",
"line": false,
"control": {
"onlineTime": 1684392325044,
"_id": "6465cbd6ba28ca265d86f985",
"type": 1,
"name": "TEST",
"number": "0220",
"line": false,
"clientId": "",
"version": "",
"serverName": "OpenMqttApi",
"server": "6465cbc6ba28ca265d86f979",
"creator": "5da855b71816bc001be72f4b",
"serialData": [],
"createdAt": "2023-05-18T06:55:18.734Z",
"updatedAt": "2023-05-18T07:10:10.477Z",
"__v": 0
},
"shortAddress": "22",
"hardwareWord": {
"status": 0,
"line_status": 0,
"uiModelPropsItemNum": 0,
"uiModelProps": [],
"_id": "5d1f3f288ce12637b661b798",
"deploy": [],
"serialData": {
"_id": "5d723a5eb5e24e0c898c4a7b",
"baud": 9600,
"verification": "none",
"stopBit": 1,
"dataBit": 8
},
"loraData": {
"optimize": 0,
"_id": "5d723a5eb5e24e0c898c4a7c"
},
"detCon": [
{
"_id": "5d1f3f288ce12637b661b79a",
"name": "光照",
"company": "kLux",
"analysis": "function analyze(data) { data=parseInt(data,16);return data/1000; }",
"address": "0",
"precision": 10,
"sort": 1,
"interval": "[[\"阴天\",\"晴天\"],[1],[0,10]]",
"icon": "光照"
}
],
"defaultButton": [],
"name": "光照-仁科",
"code": "RS-GZ-N01-2",
"type": 0,
"agreement": {
"state": 0,
"_id": "5d2ed41a7177a96441169bd8",
"name": "RS-GZ-N01-2-pro",
"type": 1,
"hanShu": "agreement/RS-GZ-N01-2-pro/index.source.js",
"notes": "仁科光照度变送器",
"minJs": "agreement/RS-GZ-N01-2-pro/index.js",
"minNode": "agreement/RS-GZ-N01-2-pro/index.node.js",
"createdAt": "2019-07-17T07:54:02.304Z",
"updatedAt": "2019-09-07T05:28:12.644Z",
"__v": 0,
"dimension": null,
"edition": "V1.0"
},
"createdAt": "2019-07-05T12:14:32.331Z",
"updatedAt": "2020-10-30T06:11:22.168Z",
"__v": 13,
"attribute": [],
"defaultCheck": [
{
"canRead": true,
"_id": "5d723ad7b5e24e0c898c4b0f",
"name": "光照",
"company": "kLux",
"icon": "icon-sensor-guangzhao",
"analysis": "function analyze(data) { data=parseInt(data,16);return data/1000; }",
"interval": "[[\"阴天\",\"晴天\"],[1],[0,10]]",
"address": "0",
"precision": 10,
"sort": 1,
"numericalValue": null,
"exAnalysis": "empty",
"boardConfigStr": "{}"
}
],
"defaultOperate": [],
"image": "https://res.25soft.com/api/uploads/5f9bae881e911e0006e163a8/1584009065513.jpg",
"defaultClean": [
{
"extreme": [],
"_id": "5ee326d03dc0d8001b09f738",
"name": "光照",
"shortAddress": "0",
"time": 600,
"day": 30,
"model": "check",
"precision": 10
}
],
"rosterModel": []
},
"creator": {
"_id": "5da855b71816bc001be72f4b",
"trueName": "王宾宾",
"username": "15258284638"
},
"createdAt": "2023-05-18T10:04:40.931Z",
"id": "6465f838a60e9c46913daf1c"
}
}
上次更新: 2023/05/26, 14:01:44