Events over MQTT
Events over MQTT API enables real-time delivery of LoRaWAN Network Server events to external systems using the MQTT protocol.
It is based on the rule engine (alarm rules) mechanism, allowing subscription to gateway- and application-level events such as status changes, alarms, and faults.
When a configured rule is triggered, the event is published to a configured MQTT broker topic.
- Real-time event streaming via MQTT (push-based architecture)
- Support for gateway and device-level alarm rules
- Flexible rule configuration (online/offline status, faults, alarms)
- MQTT authentication support (username/password, topic-based access control)
- Configurable retry and delivery behavior
- Event segregation by domain (gateway / application)
- Real-time monitoring of gateway connectivity status
- Integration with external IoT platforms via MQTT brokers
- Building NOC/SOC alerting systems
- Automated response to network or device failures
GATEWAY OFFLINE:
curl --location 'https://{host}/api/gatewayGroup/{gateway_group_id}/alarmRules' \
--header 'X-Authorization: Bearer {host}' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"alarmTriggers": [
{
"type": "GW_OFFLINE"
}
],
"notifications": [
{
"type": "MQTT",
"configuration": {
"port": {port},
"ssl": false,
"retryInterval": 30,
"token": "",
"password": "",
"host": {"mqtt_host"},
"pushTopic": {"pushtopic"}
}
}
],
"name": "mqtt events api gateway offline",
"description": "gateway offline"
}
]'
{token}- MQTT Username{password}- MQTT Password{pushTopic}- MQTT Topic to push events to
GATEWAY ONLINE:
curl --location 'https://{host}/api/gatewayGroup/{gateway_group_id}/alarmRules' \
--header 'X-Authorization: Bearer {host}' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"alarmTriggers": [
{
"type": "GW_ONLINE"
}
],
"notifications": [
{
"type": "MQTT",
"configuration": {
"port": {port},
"ssl": false,
"retryInterval": 30,
"token": "",
"password": "",
"host": {"mqtt_host"},
"pushTopic": {"pushtopic"}
}
}
],
"name": "mqtt events api gateway online",
"description": "gateway online"
}
]'
{token}- MQTT Username{password}- MQTT Password{pushTopic}- MQTT Topic to push events to
GATEWAY ALARMS:
curl --location 'https://{host}/api/gatewayGroup/{gateway_group_id}/alarmRules' \
--header 'X-Authorization: Bearer {host}' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"alarmTriggers": [
{
"type": "GW_ALARM",
"severity": [
"CRITICAL",
"MAJOR",
"MINOR"
],
"description": "*",
"state": [
"CLEAR",
"RAISED"
]
}
],
"notifications": [
{
"type": "MQTT",
"configuration": {
"port": {port},
"ssl": false,
"retryInterval": 30,
"token": "",
"password": "",
"host": {"mqtt_host"},
"pushTopic": {"pushtopic"}
}
}
],
"name": "mqtt events api gateway alarm",
"description": "gateway alarm"
}
]'
{token}- MQTT Username{password}- MQTT Password{pushTopic}- MQTT Topic to push events to
GATEWAY FAULTS:
curl --location 'https://{host}/api/gatewayGroup/{gateway_group_id}/alarmRules' \
--header 'X-Authorization: Bearer {host}' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"alarmTriggers": [
{
"type": "GW_FAULT",
"severity": [
"CRITICAL",
"MAJOR",
"MINOR"
],
"description": "*",
"state": [
"CLEAR",
"RAISED"
]
}
],
"notifications": [
{
"type": "MQTT",
"configuration": {
"port": {port},
"ssl": false,
"retryInterval": 30,
"token": "",
"password": "",
"host": {"mqtt_host"},
"pushTopic": {"pushtopic"}
}
}
],
"name": "mqtt events api gateway fault",
"description": "gateway fault"
}
]'
{token}- MQTT Username{password}- MQTT Password{pushTopic}- MQTT Topic to push events to
DEVICE OFFLINE
curl --location 'https://{host}/api/application/{application_id}/alarmRules' \
--header 'X-Authorization: Bearer {token} \
--header 'Content-Type: application/json' \
--data '[
{
"alarmTriggers": [
{
"type": "DEV_OFFLINE"
}
],
"notifications": [
{
"type": "MQTT",
"configuration": {
"port": {port},
"ssl": false,
"retryInterval": 30,
"token": "",
"password": "",
"host": {"mqtt_host"},
"pushTopic": {"pushtopic"}
}
}
],
"name": "mqtt events api device offline",
"description": "device offine"
}
]
{token}- MQTT Username{password}- MQTT Password{pushTopic}- MQTT Topic to push events to
DEVICE ONLINE
curl --location 'https://{host}/api/application/{application_id}/alarmRules' \
--header 'X-Authorization: Bearer {token} \
--header 'Content-Type: application/json' \
--data '[
{
"alarmTriggers": [
{
"type": "DEV_ONLINE"
}
],
"notifications": [
{
"type": "MQTT",
"configuration": {
"port": {port},
"ssl": false,
"retryInterval": 30,
"token": "",
"password": "",
"host": {"mqtt_host"},
"pushTopic": {"pushtopic"}
}
}
],
"name": "mqtt events api device online",
"description": "device online"
}
]
{token}- MQTT Username{password}- MQTT Password{pushTopic}- MQTT Topic to push events to
INTEGRATION CONNECTED
curl --location 'https://{host}/api/application/{application_id}/alarmRules' \
--header 'X-Authorization: Bearer {token} \
--header 'Content-Type: application/json' \
--data '[
{
"alarmTriggers": [
{
"type": "INTEGRATION_IS_CONNECTED"
}
],
"notifications": [
{
"type": "MQTT",
"configuration": {
"port": {port},
"ssl": false,
"retryInterval": 30,
"token": "",
"password": "",
"host": {"mqtt_host"},
"pushTopic": {"pushtopic"}
}
}
],
"name": "mqtt events api integration connected",
"description": "integration connected"
}
]
{token}- MQTT Username{password}- MQTT Password{pushTopic}- MQTT Topic to push events to
INTEGRATION DISCONNECTED
curl --location 'https://{host}/api/application/{application_id}/alarmRules' \
--header 'X-Authorization: Bearer {token} \
--header 'Content-Type: application/json' \
--data '[
{
"alarmTriggers": [
{
"type": "INTEGRATION_IS_DISCONNECTED"
}
],
"notifications": [
{
"type": "MQTT",
"configuration": {
"port": {port},
"ssl": false,
"retryInterval": 30,
"token": "",
"password": "",
"host": {"mqtt_host"},
"pushTopic": {"pushtopic"}
}
}
],
"name": "mqtt events api integration disconnected",
"description": "integration disconnected"
}
]
{token}- MQTT Username{password}- MQTT Password{pushTopic}- MQTT Topic to push events to