Contents
1. File structure
| Field | Type | Description | |
|---|---|---|---|
| id | string | required | Unique driver identifier. Uppercase, no spaces. Example: |
| enabled | boolean | required | Whether this driver is active. Set |
| version | string | optional | Driver version string. Example: |
| info | object | optional | Human-readable device metadata. Used in the dashboard UI. |
| connection | object | required | Transport settings (serial or TCP). Topology entries can override individual fields. |
| commands | array | required | One or more measurement commands the device supports. |
2. info
| Field | Type | Description | |
|---|---|---|---|
| displayName | string | required | Full human-readable name shown in the UI.
|
| model | string | required | Model number. Also used for image resolution.
|
| manufacturer | string | required | Manufacturer name. |
| serie | string | optional | Product series name.
|
| type | string | required | Device category. Used for placeholder image selection. Known values: |
3. connection
| Field | Type | Values | Description |
|---|---|---|---|
| protocol | string |
|
Communication protocol. See Protocol types. |
| timeout | integer | milliseconds | Maximum time to wait for a response. Default: |
| Serial fields — used by STRING · STRING_BINARY · BINARY · MODBUS_RTU | |||
| baud | integer | 1200 2400 4800 9600 … |
Baud rate. Must match the device's hardware setting. Default: |
| parity | integer | 0 = none1 = even |
Parity check mode. Default: |
| stopBit | integer | 1 = 1 bit2 = 2 bits15 = 1.5 bits |
Number of stop bits. Default: |
| TCP fields — used by MODBUS_TCP | |||
| host | string | IP or hostname | IP address or hostname of the Modbus TCP gateway or device. Example: |
| tcp_port | integer | 1–65535 |
TCP port. Default: |
| unit_id | integer | 1–247 |
Modbus unit identifier (slave address) placed in the MBAP header. Default: |
4. commands
| Field | Type | Description | |
|---|---|---|---|
| parameter | string | required |
Measurement or action identifier. Uppercase, used in the API URL. Examples: |
| type | string | required |
Endpoint classification.
|
| unit | string | required | Physical unit returned in the API response.
|
| write | object | optional | Command to send before reading. Omit for broadcast devices that push data automatically. |
| read | object | required | Defines how to parse the device's response. |
5. write
| Field | Type | Description | |
|---|---|---|---|
| cmd | string | optional |
The command bytes to transmit.
|
| dtr | string | optional | DTR line state before transmission.
|
| rts | string | optional | RTS line state before transmission.
|
| brk | string | optional | Break signal handling.
|
6. read
| Field | Type | Description | |
|---|---|---|---|
| parser | string | required |
How to extract the value. See Parser types.
|
| validator | string | optional | Regex applied to the full response. If it does not match, status is set to Example: |
| offset | integer | optional | Byte offset where the value starts in the response. Used with |
| length | integer | optional | Number of bytes to read for the value. Used with
|
| head | string | optional | Expected HEX bytes at the start of the response. Used for validation / framing.
|
| tail | string | optional | Expected HEX bytes at the end of the response.
|
| bufsize | integer | optional | Number of bytes to read from the port. Default: Set to the exact expected response length for efficiency. Example: Modbus 6-register reply = |
| factor | float | optional | Multiplier applied to the raw integer value. Default:
|
| expression | string | optional | Arithmetic expression evaluated after parsing.
|
7. Protocol types
STRING
ASCII text over RS-232. Device sends and receives printable strings. Parser is a regex that extracts a number from the response.
STRING_BINARY
Similar to STRING but the response may contain non-printable binary bytes. Parser is still a regex.
BINARY
Raw binary protocol. write.cmd is a hex string. Response is parsed with BE, BE_DECIMAL, or MODBUS_RTU.
MODBUS_RTU
Modbus RTU over RS-485 or RS-232. write.cmd contains the full Modbus request frame as hex.
MODBUS_TCP
Modbus over Ethernet (TCP/IP). Same PDU as RTU but wrapped in a 7-byte MBAP header — no CRC, no serial port. Requires host and optionally tcp_port / unit_id in the connection block.
8. Parser types
Regex (STRING / STRING_BINARY)
Any valid regex. The last number found in the match is used as the value.
parser: "[+-]?\\d+\\.\\d+" response: "+ 25.300 g S" → 25.3BE
Reads length bytes at offset as a Big-Endian unsigned integer, then scales by factor or expression.
BE_DECIMAL
Reads length bytes at offset as an ASCII decimal string, then scales by factor or expression.
MODBUS_RTU
Parses a standard Modbus RTU read-holding-registers reply: [addr][func][len][data…][crc]. Data starts at byte 3. Scales by factor or expression.
MODBUS_TCP
Strips the 7-byte MBAP header then parses the PDU: [func][len][data…]. Data starts at byte 2 of the PDU. Exception responses (func | 0x80) return null.
9. Full example
STRING protocol — LT300 thermometer
// drivers/LT300.json { "id": "LT300", "enabled": true, "version": "1", "info": { "displayName": "TermexLab LT300", "model": "LT300", "manufacturer": "TermexLab", "type": "thermometer" }, "connection": { "protocol": "STRING", "baud": 4800, "parity": 0, "stopBit": 1, "timeout": 1000 }, "commands": [ { "parameter": "TEMPERATURE", "unit": "CELSIUS", "type": "read", "write": { "cmd": "d\r" }, // send ASCII "d" + CR "read": { "parser": "[+-]?([0-9]*[.])?[0-9]+" // extract last number } } ] }
BINARY (Modbus RTU) — IVA-6B2 thermohygrometer
// drivers/IVA6B2.json — two parameters, one request each { "id": "IVA6B2", "enabled": true, "connection": { "protocol": "BINARY", "baud": 9600, "parity": 0, "stopBit": 1, "timeout": 1000 }, "commands": [ { "parameter": "TEMPERATURE", "unit": "CELSIUS", "type": "read", "write": { "cmd": "010300010001D5CA" }, // Read register 0x0001 "read": { "parser": "MODBUS_RTU", "bufsize": 7, "factor": 0.01 } }, { "parameter": "RELATIVE_HUMIDITY", "unit": "%", "type": "read", "write": { "cmd": "010300000001840A" }, // Read register 0x0000 "read": { "parser": "MODBUS_RTU", "bufsize": 7, "factor": 0.01 } } ] }
MODBUS_TCP — Generic Ethernet device
// drivers/GENERIC_MODBUS_TCP.json — Modbus TCP, single read-holding-register { "id": "GENERIC_MODBUS_TCP", "enabled": true, "connection": { "protocol": "MODBUS_TCP", "host": "192.168.1.100", "tcp_port": 502, "unit_id": 1, "timeout": 1000 }, "commands": [ { "parameter": "TEMPERATURE", "unit": "CELSIUS", "type": "read", "write": { "cmd": "0300010001" }, // PDU: func=03, addr=0x0001, count=1 (no MBAP here) "read": { "parser": "MODBUS_TCP", "bufsize": 11, "factor": 0.1 } } ] } // config/topology.json — override host per instance { "id": "temp-sensor-1", "driver_file": "GENERIC_MODBUS_TCP.json", "port": "TCP", "keep_alive": false, "enabled": true, "connection": { "host": "10.0.0.50", "unit_id": 3 } // overrides driver defaults }
Broadcast (no write.cmd) — IAKR thermohygrometer
// Device sends data automatically; no request needed. // Two commands share the same response line: "T;025.50;F;060.00" { "id": "IAKR", "enabled": true, "connection": { "protocol": "STRING", "baud": 9600, ... }, "commands": [ { "parameter": "TEMPERATURE", "unit": "CELSIUS", "type": "read", // no "write" field "read": { "parser": "T;[+-]?([0-9]{3}[.]){1}[0-9]{2}" } }, { "parameter": "RELATIVE_HUMIDITY", "unit": "%", "type": "read", "read": { "parser": "F;[+-]?([0-9]{3}[.]){1}[0-9]{2}" } } ] }
10. Complete field template
// drivers/MY_DEVICE.json { "id": "MY_DEVICE", // required — unique, uppercase "enabled": true, // required — true | false "version": "1", // optional "info": { // optional block "displayName": "Brand Model-X", "model": "Model-X", "manufacturer": "Brand", "serie": "X-Series", // optional "type": "thermometer" // thermometer | scales | barometer | // thermphygrometer | multichannel thermometer | // thermohygrometer with barometer | comparator }, "connection": { // required block. Topology can override any field. "protocol": "STRING", // STRING | STRING_BINARY | BINARY | MODBUS_RTU | MODBUS_TCP "timeout": 1000, // ms — how long to wait for a response (all transports) // Serial fields — used by STRING / STRING_BINARY / BINARY / MODBUS_RTU "baud": 9600, // 1200 | 2400 | 4800 | 9600 | 19200 | 38400 | ... "parity": 0, // 0 = none | 1 = even "stopBit": 1, // 1 = 1 bit | 2 = 2 bits | 15 = 1.5 bits // TCP fields — used by MODBUS_TCP (serial fields are ignored) "host": "192.168.1.100", // IP address or hostname of the device/gateway "tcp_port": 502, // TCP port (default: 502) "unit_id": 1 // Modbus unit ID in MBAP header (default: 1) }, "commands": [ { "parameter": "TEMPERATURE", // required — TEMPERATURE | WEIGHT | PRESSURE | // RELATIVE_HUMIDITY | TEMPERATURE_1 | ... "unit": "CELSIUS", // required — CELSIUS | g | % | hPa | ... "type": "read", // required — read | command "write": { // optional — omit for broadcast devices "cmd": "d\r", // STRING: ASCII string ("d\r", "SI\r\n") // BINARY: hex string ("010300010001D5CA") "dtr": "SET_DTR", // optional — SET_DTR | CLEAR_DTR "rts": "SET_RTS", // optional — SET_RTS | CLEAR_RTS "brk": "IGNORE" // optional — IGNORE }, "read": { // required block "parser": "[+-]?\\d+\\.\\d+", // required — regex (STRING) // "BE" (binary, big-endian int) // "BE_DECIMAL" (binary, ASCII decimal) // "MODBUS_RTU" (Modbus RTU frame) // "MODBUS_TCP" (Modbus TCP — strips MBAP header) "validator": "S", // optional — regex; no match → status UNSTABLE "offset": 6, // optional — byte offset (BE / BE_DECIMAL) "length": 2, // optional — byte count (BE / BE_DECIMAL) // 2 → uint16 | 4 → uint32 "head": "1002", // optional — expected hex header bytes "tail": "1004", // optional — expected hex footer bytes "bufsize": 64, // optional — bytes to read (default: 64) "factor": 0.01, // optional — raw × factor = value (default: 1.0) // raw 2500 × 0.01 = 25.00 °C // ignored when expression is set "expression": "value * 1.8 + 32" // optional — arithmetic expression; takes precedence // over factor. Variable: value (parsed raw) // e.g. "value * 0.03527396" (g → oz) } } ] }