This document defines the JSON contract for alert RPC requests (trigAlertOnce, trigAlertContinuous, stopAlertAll, stopAlertContinuous).
Scope: Alert methods only. The
refreshDevicesserver-side RPC method is documented in the SmartVOX Gateway MQTT API.
refreshDevices)Alert params rules are defined in this document. The machine-readable schemas below validate the full MQTT RPC payload ({ method, params }). Paths match the published HTML documentation (out/ after running script/generate-mqtt-api-doc.sh).
| Direction | Download | Validate |
|---|---|---|
| Server-side RPC request (backend → gateway) | rpc-server-side-request.bundled.schema.json | Open validator |
| Client-side RPC request (gateway → backend) | rpc-client-side-request.bundled.schema.json | Open validator |
| Server-side RPC response | rpc-server-side-response.schema.json | Open validator |
Alert requests use topic v1/devices/me/rpc/request/$request_id, shared with other RPC methods. The direction depends on who initiates the exchange:
| Direction | Initiator | Consumer | Role |
|---|---|---|---|
| Server-side RPC | MQTT backend | SmartVOX Gateway | Backend publishes the request; gateway executes alert actions on the radio network |
| Client-side RPC | SmartVOX Gateway | MQTT backend | Gateway publishes when an alert originates from the radio network (propagation and traceability) |
Both directions support the four alert methods listed below. Client-side RPC is limited to alert methods; other RPC such as refreshDevices is server-side only and documented in the main MQTT API.
trigAlertOnce: trigger one alert cycletrigAlertContinuous: trigger a continuous alertstopAlertAll: stop all alerts in scopestopAlertContinuous: stop one continuous alert by alertIdAlert requests are sent as MQTT RPC messages on v1/devices/me/rpc/request/$request_id.
The payload is a JSON object with a top-level method and params key, following ThingsBoard MQTT RPC conventions and compatible with any broker that routes these topics.
The top-level method selects which request type the gateway will parse and handle; the alert contract itself lives under params.
Example:
{
"method": "stopAlertAll",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "global" },
"signaling": "visual"
}
}
scope is a required object with:
type (required): global or groupgroupId (required only when type = "group"): integer 0..15Business meaning:
- scope defines where the alert applies.
- global means the alert targets all devices.
- group means the alert targets one logical group of devices identified by groupId.
Examples:
{
"scope": {
"type": "global"
}
}
{
"scope": {
"type": "group",
"groupId": 5
}
}
Allowed values:
combinedaudiblevisualBusiness meaning:
- audible: play sound only.
- visual: activate the visual beacon only.
- combined: audible + visual behavior in the same request.
Allowed values:
highesthighmediumlowlowestBusiness meaning:
- priority defines the alert urgency used by the application when multiple alerts compete.
alertIdtrigAlertContinuous and stopAlertContinuoustrigAlertOnce and stopAlertAll0..255Business meaning:
- alertId identifies the continuous alert instance to start or stop.
- The same alertId is used later by stopAlertContinuous to stop a previously started continuous alert.
- For other methods, alertId is ignored by the application.
alertRelayActivationon, offtrigAlertOnce and trigAlertContinuousonBusiness meaning:
- alertRelayActivation controls whether the siren alert relay is enabled while an alert is active.
ts)tsuint64)msec)0..18446744073709551615Business meaning:
- ts is the request timestamp expressed in milliseconds.
- It can be used for ordering, traceability, and correlation across systems.
Example:
{
"ts": 1774961285037
}
sourcekind: device, user, service, or systemid: non-empty string, max 63 charactersBusiness meaning:
- source identifies who originated the alert request.
- source.kind provides the origin category.
- source.id provides the origin identifier.
Example:
{
"source": {
"kind": "device",
"id": "1A2B"
}
}
| Key | trigAlertOnce | trigAlertContinuous | stopAlertAll | stopAlertContinuous |
|---|---|---|---|---|
ts |
optional | optional | optional | optional |
source |
required | required | required | required |
scope |
required | required | required | required |
priority |
required | required | n/a | n/a |
alertId |
optional (ignored) | required | optional (ignored) | required |
signaling |
required | required | required | required |
audible |
required when signaling is combined or audible |
required when signaling is combined or audible; not required when signaling is visual |
n/a | n/a |
visual |
required when signaling is visual |
optional; ignored if present (any signaling value) |
n/a | n/a |
alertRelayActivation |
optional (default on) |
optional (default on) |
n/a | n/a |
audible contains:
sounds (required): array of sound objectssequenceRepeats (0..65535):trigAlertOncetrigAlertContinuousBusiness meaning:
- audible defines the full sound playback pattern.
- sounds contains one or two sound definitions.
- sequenceRepeats controls how many times the full sounds sequence is replayed (for trigAlertOnce).
sounds.length must be 1 or 2sounds.length = 1:sounds[0] must existtrigAlertOnce, sounds[0].repeats and sequenceRepeats are required and usedtrigAlertContinuous, sounds[0].repeats may be present but is ignoredsounds.length = 2:sounds[0] and sounds[1] must existtrigAlertOnce, sounds[0].repeats and sounds[1].repeats are required and usedtrigAlertContinuous, sounds[0].repeats and sounds[1].repeats MUST be present (schema-level requirement)Each item in sounds:
{
"bank": "standard",
"fileId": 0,
"attenuationInDB": 0,
"repeats": 1
}
Field constraints:
bank: standard or customfileId: 0..127attenuationInDB: 0..40repeats: 0..255Business meaning:
- bank selects the sound library.
- fileId selects the sound inside the selected bank.
- attenuationInDB sets volume attenuation for this sound.
- repeats defines how many times this sound is repeated before moving to the next sound in the sequence.
visual:
{
"visual": {
"durationInSec": 10
}
}
Constraints:
durationInSec: 1..65534trigAlertOnce when signaling = "visual"trigAlertContinuous, visual is optional and ignored if present (including when signaling = "visual")Business meaning:
- visual.durationInSec is the visual beacon activation time in seconds.
- For continuous trigger requests, visual-specific timing is managed elsewhere, so this object is ignored.
- A trigAlertContinuous request with signaling = "visual" needs only the core fields (source, scope, priority, alertId, signaling); neither audible nor visual is required.
ts MAY be present and, when present, MUST be an integer in 0..18446744073709551615 (milliseconds).source MUST be present and MUST be an object with kind and id.source.kind MUST be one of device, user, service, system.source.id MUST be a non-empty string of max 63 characters.scope MUST be present and MUST be an object containing type.scope.type MUST be global or group.scope.type = "group", scope.groupId MUST be present.scope.type = "global", scope.groupId MAY be omitted.signaling is combined or audible, audible MUST be present.trigAlertOnce when signaling = "visual", visual MUST be present.trigAlertContinuous when signaling = "visual", audible MAY be omitted (not required).trigAlertContinuous when signaling = "visual", visual MAY be omitted; if present it is IGNORED.sounds.length MUST be 1 or 2.trigAlertContinuous, visual is IGNORED (any signaling value).trigAlertContinuous, sequenceRepeats is IGNORED.trigAlertContinuous with sounds.length = 1, repeats MAY be present but is IGNORED.trigAlertContinuous with sounds.length = 2, each sound repeats MUST be present.{
"method": "trigAlertOnce",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "group", "groupId": 0 },
"priority": "high",
"signaling": "combined",
"audible": {
"sounds": [
{ "bank": "standard", "fileId": 0, "attenuationInDB": 0, "repeats": 1 },
{ "bank": "standard", "fileId": 1, "attenuationInDB": 0, "repeats": 2 }
],
"sequenceRepeats": 1
},
"alertRelayActivation": "on"
}
}
{
"method": "trigAlertOnce",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "global" },
"priority": "high",
"signaling": "visual",
"visual": {
"durationInSec": 10
}
}
}
{
"method": "trigAlertContinuous",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "global" },
"priority": "high",
"alertId": 0,
"signaling": "audible",
"audible": {
"sounds": [
{ "bank": "standard", "fileId": 0, "attenuationInDB": 0 }
]
}
}
}
Minimal payload: no audible or visual object. Continuous visual timing is managed by the application, not by visual.durationInSec.
{
"method": "trigAlertContinuous",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "global" },
"priority": "high",
"alertId": 3,
"signaling": "visual"
}
}
{
"method": "stopAlertAll",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "group", "groupId": 5 },
"signaling": "combined"
}
}
{
"method": "stopAlertContinuous",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "global" },
"alertId": 0,
"signaling": "combined"
}
}
{
"method": "trigAlertOnce",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "global" },
"priority": "medium",
"signaling": "audible",
"audible": {
"sounds": [
{ "bank": "custom", "fileId": 12, "attenuationInDB": 5, "repeats": 3 }
],
"sequenceRepeats": 2
}
}
}
{
"method": "trigAlertOnce",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "group", "groupId": 9 },
"priority": "highest",
"signaling": "combined",
"audible": {
"sounds": [
{ "bank": "standard", "fileId": 2, "attenuationInDB": 0, "repeats": 1 },
{ "bank": "custom", "fileId": 7, "attenuationInDB": 8, "repeats": 2 }
],
"sequenceRepeats": 4
},
"alertRelayActivation": "off"
}
}
{
"method": "trigAlertContinuous",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "global" },
"priority": "high",
"alertId": 42,
"signaling": "combined",
"audible": {
"sounds": [
{ "bank": "standard", "fileId": 0, "attenuationInDB": 0, "repeats": 1 },
{ "bank": "standard", "fileId": 1, "attenuationInDB": 4, "repeats": 2 }
]
},
"visual": {
"durationInSec": 20
}
}
}
{
"method": "trigAlertContinuous",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "group", "groupId": 1 },
"priority": "low",
"alertId": 7,
"signaling": "audible",
"audible": {
"sounds": [
{ "bank": "custom", "fileId": 3, "attenuationInDB": 12, "repeats": 200 }
]
},
"alertRelayActivation": "on"
}
}
{
"method": "stopAlertAll",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "global" },
"signaling": "visual"
}
}
{
"method": "stopAlertContinuous",
"params": {
"source": { "kind": "device", "id": "1A2B" },
"scope": { "type": "group", "groupId": 4 },
"alertId": 17,
"signaling": "audible"
}
}