Skip to main content
POST
/
api
/
var
/
sensor
/
add
添加传感量
curl --request POST \
  --url https://api.example.com/api/var/sensor/add \
  --header 'Authentication: <authentication>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "sn": "abababab",
  "key": "c",
  "label": "变量c",
  "type": "string",
  "data": "i am c",
  "index": 1,
  "config": {
    "calc": {
      "base": 0,
      "decimal": 0,
      "mult": 1
    },
    "param": {
      "count": 0,
      "offset": 0,
      "read": 3,
      "reg": 98
    },
    "type": "uint32",
    "unit": "Nm³"
  },
  "param": {
    "tags": [
      "韭菜",
      "馅饼"
    ]
  }
}
'
{}

Headers

Authentication
string
required

Body

application/json
key
string
required

变量不能包含特殊字符 尤其 . 表示子节点操作

type
string
required
data
object
required

该变量值的结构

sn
string

设备时必需

productModel
string

产品时必需

label
string
config
object

该变量的配置

param
object

扩展参数

index
integer
id
string

添加子节点时必需

Response

200 - application/json

The response is of type object.