Skip to main content

Subscribe to AirNgin MQTT topics

Read the provisioning/login guide before subscribing.

What is Subscribe?

In MQTT, Subscribe tells the broker which topics a client wants to receive. After a successful subscription, messages published to matching topics are delivered to that client according to MQTT QoS rules.

Important Direct Device subscriptions

The Direct Device canonical contract includes, among others:

projectCode/ServerToDevice/{serial}
projectCode/DeviceSetting/{serial}

For encrypted variants, append /AES where the Direct Device security contract requires it.

  • ServerToDevice/{serial} carries commands for the target device.
  • DeviceSetting/{serial} carries device-specific settings/configuration payloads.

The server-to-device payload is JSON. A common direct command payload has the target deviceSerial plus a data field containing the logical command.

{
"deviceSerial": "AIRN1234567890",
"data": "{"key":"ch1","value":"on"}"
}

Always validate the target deviceSerial and the logical operation/value before changing device state.