Skip to main content

Air quality Modbus

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.

Description

The VAPIX® Air quality Modbus API enables applications and users to configure Modbus parameters(such as service status and port settings) for the Air quality modbus service. It configures how the device utilizes the universal Modbus protocol to broadcast real-time sensor data to a user's Modbus client.

note

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.

curl --request GET \
--anyauth \
--user "<username>:<password>" \
--http1.1 \
--header "Content-Type: application/json" \
http://my-device/config/rest/airqualitymodbus/v1/configurations
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.

curl --request PATCH \
--anyauth \
--user "<username>:<password>" \
--http1.1 \
--header "Content-Type: application/json" \
http://my-device/config/rest/airqualitymodbus/v1/configurations/My-SensorId \
--data '{
"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 it's value.

curl --request GET \
--anyauth \
--user "<username>:<password>" \
--http1.1 \
--header "Content-Type: application/json" \
http://my-device/config/rest/airqualitymodbus/v1/configurations/My-SensorId/modbusEnable
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.

curl --request PATCH \
--anyauth \
--user "<username>:<password>" \
--http1.1 \
--header "Content-Type: application/json" \
http://my-device/config/rest/airqualitymodbus/v1/configurations/My-SensorId/modbusEnable \
--data '{
"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(#datatypes-sensorid))
  • Operations
    • GET
    • SET
      • Properties: modbusEnable, modbusPort, sensorId
  • 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
  • Attributes
    • Nullable: No
    • Dynamic Support: No / Dynamic Enum: No / Dynamic Range: No
Actions

This entity has no actions.


Data types

ModbusPort

  • Description: The range of 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$