alarm.publish
The alarm.publish command is used to publish alarm states for a Thing.
TR50 Request
{
"cmd": {
"command": "alarm.publish",
"params": {
"thingKey": "mything",
"key": "myprop",
"state": 3,
"msg": "Message.",
"ts": "2014-04-05T02:03:04.322Z",
"corrId": "mycorrid",
"lat": 26.39489,
"lng": -80.11293,
"republish": false
}
}
}
Request Parameters
Name |
Type |
Required |
Description |
---|---|---|---|
|
Thing Identifier Parameters |
|
Identifies the thing to which the alarm state is to be associated. If omitted, the thingKey associated with your session will be used. See Thing Identifier Parameters table below for supported parameters. |
key |
String |
Yes |
The key for the alarm that you wish to publish. |
state |
Integer |
Yes |
The state to publish. |
msg |
String |
|
The message to publish. |
ts |
String |
|
The timestamp in which the value was recorded. |
corrId |
String |
|
A correlation ID that can be used when querying to find related data objects. |
lat |
Float |
|
Latitude coordinate of the alarm state event. |
lng |
Float |
|
Longitude coordinate of the alarm state event. |
republish |
Boolean |
|
If the publish is the latest value (ie the timestamp is newer than all other timestamps for the alarm), and republish is false, the publish will be suppressed and will not add an additional record. The default value is false. |
If two or more alarm states are published with the same timestamp (ts), they are only published if the states are different or if the republish flag is set to true.
Thing Identifier Parameters
Name |
Type |
Description |
---|---|---|
thingKey |
String |
Key of the thing |
thingId |
String |
Id of the thing |
esn |
String |
Esn of the thing |
iccid |
String |
Iccid of the thing |
imei |
String |
Imei of the thing |
imsi |
String |
Imsi of the thing |
meid |
String |
Meid of the thing |
msisdn |
String |
Msisdn of the thing |
TR50 Response
If the command is sent successfully a success message is returned. Otherwise, an error and error message will be returned.
{
"cmd": {
"success": true
}
}