Alarms

Alarms

Device alarms are alarms that trigger when sensor values go out of the threshold values configured on the device. This page provides an API to enable these alarms on the device by configuring the threshold values of the sensor data.

Request Components

HTTP Request

POST 'https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Resource Path and Query Parameters

None.

Header Parameters

The request header must contain a current ThingSpace authorization token and a current VZ-M2M session token, and must set the content-type to JSON.

Parameter Name Data Type Description
Authorization
required
string HTTP Authorization bearer token.
VZ-M2M-Token
required
string A valid session token returned by POST /api/m2m/v1/session/login.
Content-Type
required
string Must be application/json.

Request Body

The request body must include the UUID of the subscription that you want to update plus any properties that you want to change. There are different types of alarms that can be set on the device. This page provides only type 4 alarms. Type 4 alarms are the alarms that will be triggered if the sensor values fall below the set threshold or exceed the threshold range.

Parameter Name Data Type Description
accountidentifier
required
JSON object The ID of the authenticating billing account, in the format {"billingaccountid":"1234567890-12345"}
resourceidentifier
required
JSON object The ID of the device to set alarms, in the format {"id": "dd1682d3-2d80-cefc-f3ee-25154800beff"}.
deviceConfig
required
JSON object {"<<Alarm Key Word>>":{"alarmType":4,"threshold":"15","thresholdRange":"20"}}}'

Sensor Alarm Key Words

Each sensor will have a special alarm key word. The following is a list of key words for each sensor type:

Sensor Type Alarm Key Word
Temperature tempAlarm
Light liteAlarm
Humidity humiAlarm
Pressure presAlarm
Battery battAlarm

Examples:

Example Alarm for Temperature Sensor

curl -k -v -X POST -H
"Content-Type: application/json" -H 'Authorization: Bearer 18261b8341d07fc32c760c2a5acaad27'-H 'VZ-M2M-Token: 885b3ba5-b149-4fe8-91c5-51efb1b7462a' -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"tempAlarm":{"alarmType":4,"threshold":"15","thresholdRange":"20"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Temperature Alarm API response

[{"action":"set","capabilityid":"00000000-0001-0001-0001-000000000000","createdon":"2019-08-08T17:14:43.276220009Z","deviceid":"04314840-7e38-6e64-e6e7-cfd1f0be5515","fields":{"deviceConfig":{"tempAlarm":{"alarmType":4,"threshold":"15","thresholdRange":"20"}}},"id":"a5a1935d-222d-6ecf-efa4-18be00ab5a7c","kind":"ts.event","lastupdated":"2019-08-08T17:14:43.276220072Z","state":"pending","transactionid":"91a6868e-f593-4102-a12f-ed8319c5909a","version":"1.0","versionid":"037c6952-ba00-11e9-94f6-02420a4e1a12"}]

Example Alarm for Light Sensor

curl -k -v -X POST -H
"Content-Type: application/json" -H 'Authorization: Bearer 18261b8341d07fc32c760c2a5acaad27' -H 'VZ-M2M-Token: 885b3ba5-b149-4fe8-91c5-51efb1b7462a' -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"liteAlarm":{"alarmType":4,"threshold":"100","thresholdRange":"110"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Light Alarm API Response

[{"action":"set","capabilityid":"00000000-0001-0001-0001-000000000000","createdon":"2019-08-08T17:17:29.461331282Z","deviceid":"04314840-7e38-6e64-e6e7-cfd1f0be5515","fields":{"deviceConfig":{"liteAlarm":{"alarmType":4,"threshold":"100","thresholdRange":"110"}}},"id":"e5116a42-0e28-6631-e830-8fdc180a85ac","kind":"ts.event","lastupdated":"2019-08-08T17:17:29.461331332Z","state":"pending","transactionid":"c6f47f25-efb3-4be4-9cd6-4ffd69af07cf","version":"1.0","versionid":"668a3f3b-ba00-11e9-94fe-02420a4e1a12"}]

Example Alarm for Humidity Sensor

curl -k -v -X POST -H
"Content-Type: application/json" -H 'Authorization: Bearer 18261b8341d07fc32c760c2a5acaad27' -H 'VZ-M2M-Token: 885b3ba5-b149-4fe8-91c5-51efb1b7462a' -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"humiAlarm":{"alarmType":4,"threshold":"50","thresholdRange":"60"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Humidity Alarm API Response

[{"action":"set","capabilityid":"00000000-0001-0001-0001-000000000000","createdon":"2019-08-08T17:20:04.91388507Z","deviceid":"04314840-7e38-6e64-e6e7-cfd1f0be5515","fields":{"deviceConfig":{"humiAlarm":{"alarmType":4,"threshold":"50","thresholdRange":"60"}}},"id":"c54194ee-bb41-64ba-fc7a-eef2070caa8e","kind":"ts.event","lastupdated":"2019-08-08T17:20:04.913885138Z","state":"pending","transactionid":"ccce3cfb-b60a-425d-a12c-0efa8a6a3c26","version":"1.0","versionid":"c3326c9d-ba00-11e9-9575-02420a4e1a12"}]

Example Alarm for Pressure Sensor

curl -k -v -X POST -H
"Content-Type: application/json" -H 'Authorization: Bearer 18261b8341d07fc32c760c2a5acaad27' -H 'VZ-M2M-Token: 885b3ba5-b149-4fe8-91c5-51efb1b7462a' -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"presAlarm":{"alarmType":4,"threshold":"600","thresholdRange":"710"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Pressure Alarm API Response

[{"action":"set","capabilityid":"00000000-0001-0001-0001-000000000000","createdon":"2019-08-08T17:21:12.321021069Z","deviceid":"04314840-7e38-6e64-e6e7-cfd1f0be5515","fields":{"deviceConfig":{"presAlarm":{"alarmType":4,"threshold":"600","thresholdRange":"710"}}},"id":"0541c33e-6415-68ad-e21f-3f9450c4c707","kind":"ts.event","lastupdated":"2019-08-08T17:21:12.321021139Z","state":"pending","transactionid":"d203ee1d-dfa8-4156-a3ef-1339cdfd80ec","version":"1.0","versionid":"eb5fefdc-ba00-11e9-9576-02420a4e1a12"}]

Example Alarm for Battery Sensor

curl -k -v -X POST -H
"Content-Type: application/json" -H 'Authorization: Bearer 18261b8341d07fc32c760c2a5acaad27' -H 'VZ-M2M-Token: 885b3ba5-b149-4fe8-91c5-51efb1b7462a' -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"battAlarm":{"alarmType":4,"threshold":"90","thresholdRange":"100"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Battery Alarm API Response

[{"action":"set","capabilityid":"00000000-0001-0001-0001-000000000000","createdon":"2019-08-08T17:22:44.493371697Z","deviceid":"04314840-7e38-6e64-e6e7-cfd1f0be5515","fields":{"deviceConfig":{"battAlarm":{"alarmType":4,"threshold":"90","thresholdRange":"100"}}},"id":"25816a60-d18e-6c8b-fb1c-f674b91c61ef","kind":"ts.event","lastupdated":"2019-08-08T17:22:44.493371922Z","state":"pending","transactionid":"2267b343-8e69-4fd7-ab4b-5d06c97b6288","version":"1.0","versionid":"2250524f-ba01-11e9-9577-02420a4e1a12"}]

Alarm reporting ##

Temperature Alarm

deviceAlarm{{"temperature":{"Threshold":"15","ThresholdRange":"20","alarmType":"4","sensorReading":"24"}}}

Light Alarm

deviceAlarm{{"light":{"Threshold":"100","ThresholdRange":"110","alarmType":"4","sensorReading":"98"}}

Humidity Alarm

deviceAlarm{{"humidity":{"Threshold":"50","ThresholdRange":"60","alarmType":"4","sensorReading":"98"}}

Pressure Alarm

deviceAlarm{{"pressure":{"Threshold":"600","ThresholdRange":"710","alarmType":"4","sensorReading":"800"}}

Battery Alarm

deviceAlarm{{"battery":{"Threshold":"90","ThresholdRange":"100","alarmType":"4","sensorReading":"88"}}

Clearing/Disabling Alarm:

Disabling Temperature Alarm:

curl -k -v -X POST -H
"Content-Type: application/json" -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"tempAlarm":{"alarmType":0,"threshold":"20","thresholdRange":"25"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Disabling Light Alarm:

curl -k -v -X POST -H
"Content-Type: application/json" -H 'Authorization: Bearer 18261b8341d07fc32c760c2a5acaad27' -H 'VZ-M2M-Token: 885b3ba5-b149-4fe8-91c5-51efb1b7462a' -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"liteAlarm":{"alarmType":0,"threshold":"100","thresholdRange":"110"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Disabling Humidity Alarm:

curl -k -v -X POST -H
"Content-Type: application/json" -H 'Authorization: Bearer 18261b8341d07fc32c760c2a5acaad27' -H 'VZ-M2M-Token: 885b3ba5-b149-4fe8-91c5-51efb1b7462a' -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"humiAlarm":{"alarmType":0,"threshold":"50","thresholdRange":"60"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Disabling Pressure Alarm:

curl -k -v -X POST -H
"Content-Type: application/json" -H 'Authorization: Bearer 18261b8341d07fc32c760c2a5acaad27' -H 'VZ-M2M-Token: 885b3ba5-b149-4fe8-91c5-51efb1b7462a' -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"humiAlarm":{"alarmType":0,"threshold":"50","thresholdRange":"60"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set

Disabling Battery Alarm:

curl -k -v -X POST -H
"Content-Type: application/json" -H 'Authorization: Bearer 18261b8341d07fc32c760c2a5acaad27' -H 'VZ-M2M-Token: 885b3ba5-b149-4fe8-91c5-51efb1b7462a' -d
'{"accountidentifier":{"billingaccountid":"123456789-00001"},
"resourceidentifier":{"imei":864508030123456},
"deviceConfig": {"presAlarm":{"alarmType":0,"threshold":"600","thresholdRange":"710"}}}'
https://thingspace.verizon.com/api/cc/v1/devices/actions/set