Skip to main content

Overview & Prerequisites

This guide is intended for IoT device manufacturers and explains how to request permissions to control other devices, receive their status updates, and manage scenarios within the AirNgin platform.

Manufacturers can request the necessary permissions for their devices to interact with other equipment, monitor device status changes, or manage scenarios configured within a location (project).

Activating these permissions requires approval from the location (project) owner. After a request is submitted, the owner must open the AirNgin mobile application, navigate to the corresponding location (project), and approve the access request. Once approved, the requested permissions will become active for the device.

This guide is for manufacturers of touch panels, smart switches, controllers, and firmware that control Devices, receive live state, or run scenarios in an AirNgin Project.

Access has two stages: firmware requests the exact permission and the Project owner approves it; the Device then uses the MQTT contract for that capability. A pending request remains valid for only 48 hours.

Implementation path​

  1. Provision and connect the Device with its issued MQTT credentials.
  2. Submit the capability-specific Access Control request.
  3. Keep the capability disabled until the Project owner approves it.
  4. After approval, implement the MQTT control and live-state contract.

Practical example: touch panel and lighting controller​

Suppose a touch panel must turn on a light and display its subsequent state:

  1. Using the configuration-file token confirmed for that Device, the panel requests:
    • SendToSerial = 20 to send commands;
    • ListenFromSerial = 21 to receive state changes.
  2. The Project owner approves both requests before the 48-hour deadline.
  3. The panel subscribes to {projectCode}/ReceiveGeneralData/{DeviceSerial}.
  4. It publishes this command to {projectCode}/ControlOthers:
{
"deviceSerial": "LIGHT_CONTROLLER_SERIAL",
"operationName": "power",
"value": "on"
}
  1. The panel updates its display only after receiving ListenToDevice and decoding data, then JsonData.
note

power and on are examples. Read the real Operation name and command from the target controller's Project configuration.

Capabilities and permissions​

CapabilityTargetType
Disable a scenarioDisableScenario = 10
Enable a scenarioEnableScenario = 11
Get server scenario informationServerScenarioInfo = 12
Run a manual scenarioRunServerScenario = 13
Control another DeviceSendToSerial = 20
Receive another Device's live stateListenFromSerial = 21
Get another Device's last valueGetSerialLastValue = 22

Each permission is independent. For example, SendToSerial does not grant live-state access or scenario execution.

Firmware security rules​

  • Treat the configuration-file token as a secret; never expose it in logs, UI, or public firmware.
  • The current public source does not specify where that token is delivered or acquired. Confirm it with the AirNgin integration contact or approved deployment SDK, and do not substitute another credential type.
  • Request only the permissions required by the product.
  • Obtain serials, projectCode, Operations, and commands from trusted provisioning data.
  • Do not treat a publish or QoS 1 delivery as successful execution.
  • Without approval or a valid state message, do not update local state optimistically.
  • Make parsers resilient to nested JSON, unknown future enum values, and malformed messages.

Continue​