Analog Input Readings
This page explains one AnalogInputState item inside peripherals.analogInputs.
Only devices with analog input channels return this array.
AnalogInputState Schema
| Field | Type | Required | Description |
|---|---|---|---|
index | integer | Yes | Analog input channel index, starting from 1 |
type | string | Yes | Type code. Current enum values: CURRENT |
value | number | No | Analog input current value |
unit | string | Yes | Analog input current unit, fixed to mA |
status | string | Yes | Channel status. Enum: ONLINE, OFFLINE |
measurement | object | No | Converted measurement value based on device configuration. Omitted when configuration is missing or incomplete |
Notes:
- When the channel is offline,
valuemay be omitted. valuealways means the real analog input current inmA.measurementis returned only when the device has analog input range, sensor range, and display unit configured, and the service can calculate the converted reading.
measurement Schema
| Field | Type | Required | Description |
|---|---|---|---|
value | number | Yes | Converted measurement value |
unit | string | Yes | Converted measurement unit from device configuration |
Analog Input type Enum
| Value | Description |
|---|---|
CURRENT | Current |
Channel status Enum
| Value | Description |
|---|---|
ONLINE | Analog input is online |
OFFLINE | Analog input is offline |
Example
json
[
{
"index": 1,
"type": "CURRENT",
"value": 15.468,
"unit": "mA",
"status": "ONLINE",
"measurement": {
"value": 71.7,
"unit": "C"
}
},
{
"index": 2,
"type": "CURRENT",
"value": 6.928,
"unit": "mA",
"status": "ONLINE"
}
]Channels without conversion configuration or offline channels do not return measurement:
json
[
{
"index": 1,
"type": "CURRENT",
"unit": "mA",
"status": "OFFLINE"
}
]