Air quality Modbus API
This API is based on the Device Configuration API framework. For guidance on how to use these APIs, please refer to the Device Configuration APIs section in the VAPIX Library.
This API is in RELEASE stage. It can be used in the production environment.
The Air quality Modbus API enables applications and users to configure Modbus parameters for example, service status and port settings for the Air quality Modbus service. It uses the universal Modbus protocol to broadcast real-time sensor data to a Modbus client.
This API is optional and may not be present on all products. Check the products listed under compatible products to determine API support.
Use cases
Configure parameters
List or update the value of the specified parameter.
Get all configurations
List all configurations and their value.
GET /config/rest/airqualitymodbus/v1/configurations HTTP/1.1
HOST: my-device
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "success",
"data": [
{
"modbusEnable": false,
"modbusPort": 1502
}
]
}
Set all configurations
Update all configurations with the new values.
PATCH /config/rest/airqualitymodbus/v1/configurations/My-SensorId HTTP/1.1
HOST: my-device
Content-Type: application/json
{
"data": {
"modbusEnable": true,
"modbusPort": 1502
}
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "success"
}
Get a single configuration
List a single configuration and its value.
GET /config/rest/airqualitymodbus/v1/configurations/My-SensorId/modbusEnable HTTP/1.1
HOST: my-device
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "success",
"data": false
}
Set a single configuration
Update a single configuration with the new value.
PATCH /config/rest/airqualitymodbus/v1/configurations/My-SensorId/modbusEnable HTTP/1.1
HOST: my-device
Content-Type: application/json
{
"data": true
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "success"
}
API definition
Structure
airqualitymodbus.v1 (Root Entity)
├── configurations (Entity Collection)
├── modbusEnable (Property)
├── modbusPort (Property)
├── sensorId (Property)
Entities
airqualitymodbus.v1
- Description: Air quality Modbus root entity
- Type: Singleton
- Operations
GET
- Attributes
- Dynamic Support: No
Properties
This entity has no properties.
Actions
This entity has no actions.
airqualitymodbus.v1.configurations
- Description: Configuration of air quality Modbus
- Type: Collection (Key Property:
sensorId) - Operations
GETSET- Properties:
modbusEnable,modbusPort,sensorId
- Properties:
- Attributes
- Dynamic Support: No
Properties
modbusEnable
- Description: Modbus enable
- Datatype: boolean
- Operations
GET(Permissions: admin, operator, viewer)SET(Permissions: admin)
- Attributes
- Nullable: No
- Dynamic Support: No / Dynamic Enum: No / Dynamic Range: No
modbusPort
- Description: Modbus port
- Datatype:
ModbusPort - Operations
GET(Permissions: admin, operator, viewer)SET(Permissions: admin)
- Attributes
- Nullable: No
- Dynamic Support: No / Dynamic Enum: No / Dynamic Range: No
sensorId
- Description: Sensor ID
- Datatype:
SensorId - Operations
GET(Permissions: admin, operator, viewer)
- Attributes
- Nullable: No
- Dynamic Support: No / Dynamic Enum: No / Dynamic Range: No
Actions
This entity has no actions.
Data types
ModbusPort
- Description: The valid range for the Modbus port is 1024–65535
- Type: integer
- Minimum value: 1024
- Maximum value: 65535
SensorId
- Description: A unique alphanumeric ID
- Type: string
- Minimum length: 1
- Pattern:
^[1-9]\d*|0$