Skip to main content

MQTT integration

MQTT is the fastest path to synthetic telemetry and modern sensor fleets. Use it for proofs of concept before BACnet discovery on site — details for the full platform are on Open IoT Hub.

Broker options

  • Embedded broker in the IoT Hub stack (development and edge)
  • External Mosquitto or cloud brokers (AWS IoT Core, EMQX) with bridge rules
  • TLS on port 8883 with client certificates in production

Topic convention

contexus/{tenantId}/{siteId}/{deviceId}/telemetry
contexus/{tenantId}/{siteId}/{deviceId}/state
contexus/{tenantId}/{siteId}/{deviceId}/command

Payloads should be JSON objects with scalar or nested metrics. Timestamps may be device-supplied (ISO 8601) or applied at ingestion when omitted.

Quick test publish

# With mosquitto clients on the Docker host
mosquitto_pub -h localhost -p 1883 \
  -t 'contexus/demo/site-a/sensor-01/telemetry' \
  -m '{"temperature_c":22.4,"rh_pct":48.1}'

Confirm the message in the hub UI served at http://localhost:9001 after docker-compose up -d. Database metadata is stored in PostgreSQL on localhost:5433.

Commands and ACKs

Downlink commands use the /command topic with a correlation requestId. Devices should publish acknowledgements on /state so rules engines can detect offline endpoints.

Bridge from LoRaWAN

LoRaWAN network servers often expose MQTT uplinks — see LoRaWAN for mapping DevEUI to device IDs.

Next steps

Explore a running stack, review the open source repositories, estimate ROI for a deployment, or talk with the CONTEXUS team about integration and licensing.

Module licensing details are summarised on /licensing. Browse reference dashboards in the gallery.