To create, edit or delete sensors, use the command unit/update_sensor:
svc=unit/update_sensor¶ms={"itemId":<long>, "id":<long>, "callMode":<text>, "n":<text>, "t":<text>, "d":<text>, "m":<text>, "p":<text>, "f":<uint>, "vt":<uint>, "vs":<long>, "tbl":[ { "x":<double>, "a":<double>, "b":<double> } ]}
| Name | Description |
|---|---|
| itemId | unit ID |
| id | sensor ID |
| callMode | action: create, update, delete |
| Parameters required only to create and update: | |
| n | name |
| t | type (see below) |
| d | description |
| m | metrics |
| p | parameter |
| f | sensor flags (see below) |
| vt | validation type (see below) |
| vs | validating sensor ID |
| tbl | calculation table |
Sensor flags:
| Flag | Description |
|---|---|
| 0x01 | sensor type: instant |
| 0x02 | sensor type: differential |
| 0x03 | sensor type: differential with overflow (2 bytes) |
| 0x04 | sensor type: switch from off to on |
| 0x05 | sensor type: switch from on to off |
Sensor types:
Validation types:
| Type | Description |
|---|---|
| 0x01 | Logical AND |
| 0x02 | Logical OR |
| 0x03 | Math AND |
| 0x04 | Math OR |
| 0x05 | Sum up |
| 0x06 | Subtract validator from sensor |
| 0x07 | Subtract sensor from validator |
| 0x08 | Multiply |
| 0x09 | Divide sensor by validator |
| 0x0A | Divide validator by sensor |
| 0x0B | Not-null check |
On create and edit:
[ <long>, /* sensor ID */ { "nm":<text>, /* name */ "tp":<text>, /* type */ "de":<text>, /* description */ "me":<text>, /* metrics */ "pn":<text>, /* parameter */ "fl":<uint>, /* sensor flags */ "vt":<int>, /* validation type */ "vs":<long>, /* validating sensor ID */ "tbl":[ /* calculation table */ { /* parameters */ "x":<double>, "a":<double>, "b":<double> } ] } ]
On delete:
[ <long>, /* sensor ID */ null ]