Events over MQTT
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