Device Monitoring
Nwave API provides endpoints for device health monitoring. They allow you to build your own monitoring system, device health dashboards, or alerting systems.
The full API documentation is available at the end of the page.
Terms
Incident - something out of the ordinary happened with a device
Device state - the last or highest priority incident with additional information about device damaging/activation/positioning
Severity - level of importance. The higher it is the higher attention you have to pay to a device.
OK - there is no reason to worry about the devices
Info - detected a low-priority issue with a device, it can even be temporal
Warning - detected a high-priority problem, it can be possibly resolved by yourselves
Critical - detected a critical problem, the device need to be replaced
Error types - short description of an action that happened with the device and created an incident
Manual - someone has marked a device as damaged
Hardware Error - issue with device hardware (sensors, battery, radio, or Bluetooth module)
Last Message Time Error - no messages had been receiving at least for last 24
Anomalous Status Duration - temporarily disabled
Positioned But Inactive - a device is bound to a position, not damaged, but inactive
Positioned But Not Calibrated - the device is bound to a position, but Nwave Cloud has not received a notification about the device calibration
Incident reasons - a result of incident reason detection using the Nwave Replacement App and visual control.
Missing - a device has been lost from its position
Hidden Problem - a device is not fully functional or not functional at all, but visually it is ok
Not Confirmed - the detected problem is not confirmed
Not Specified - reason has not been specified, but the problem is confirmed
Broken Casing - a device body is broken
No Reason - the incident reason has not been investigated yet
Relation between error types and severity:
Severity | Error |
---|---|
OK |
|
Info |
|
Warning |
|
Critical |
|
API
Before using this API you should create an Authorization Token. You can find instructions here: Generating Authorization Tokens
Getting current device states
URL: https://api.nwave.io/monitoring/v1/devices/states
The endpoint responds with a list of devices with information about an active incident. New incidents are placed at the beginning of the list.
API arguments (more details in the OpenAPI documentation at the end of the document):
Filters by:
Project
Project ID
Zone
Zone ID
Level
Level ID
Floor number
Group
Group ID
Position
Network ID
Device
Device ID
Damaging status
Activation status
Incident
Error type
Reason
Pagination
Limit
Offset
Additional abilities
Download - flag for getting response as CSV file
The following example shows how to request 1 device that has not been sending messages for 24 hours and more:
curl --request GET 'https://api.nwave.io/monitoring/v1/devices/states?incident_type=last_message_time_error&limit=1&offset=0' --header 'X-Auth-Token: YOURTOKEN'
The response example:
{
"reason": "ok",
"data": [
{
"device_id": "3e583f",
"zone_name": "Foo",
"zone_id": 6781,
"group_name": "Bar",
"group_id": 1712038,
"project_name": "FooBar",
"incident_type": "last_message_time_error",
"reason": null,
"incident_date": "2023-02-22T19:55:35.835968+00:00",
"incident_id": 625497955,
"days_broken": 4
"latitude": 50.7794461486047,
"longitude": -1.08391361741045,
"severity": "info",
"network_id": "d690ac73-dcf2-feeb-daed-3e583ff79a2"
}
],
"message": null,
"total": 49
}
Response data object fields:
device_id
- Device unique IDzone_name
- Name of the zone containing the devicezone_id
- ID of the zone containing the devicegroup_name
- Name of the group containing the devicegroup_id
- ID of the group containing the deviceproject_name
- Name of the project containing the deviceincident_type
- see the term “Error types” abovereason
- see the term “Incident reasons” aboveincident_date
- date and time of the incident detectionincident_id
- ID of the incidentdays_broken
- how many days ago the incident was registeredlatitude
/latitude
- device position coordinatesseverity
- see the termSeverity
abovenetwork_id
- network ID of the position to which the device is bound to
Getting a history of device incidents
URL: https://api.nwave.io/monitoring/v1/incidents
The endpoint responds with a list of devices containing information about all incidents. New incidents are placed at the beginning of the list.
API arguments (more details in the OpenAPI documentation at the end of the document):
Filters by:
Project
Project ID
Zone
Zone ID
Level
Level ID
Floor number
Group
Group ID
Position
Network ID
Device
Device ID
Damaging status
Activation status
Incident
Error type
Reason
Creation time period
Resolving time period
Resolving status
Comment
Is damaged incident
Pagination
Limit
Offset
Additional abilities
Download - flag for getting response as CSV file
The following example shows a request for the last 10 incidents which automatically marks devices as damaged:
curl --location 'https://api.nwave.io/monitoring/v1/incidents?damaging=true&limit=10&offset=0' --header 'X-Auth-Token: YOURTOKEN'
Response example:
{
"reason": "ok",
"data": [
{
"device_id": "13d45a",
"network_id": "d618f2dc-a5c0-40c6-aaf2-4e32df090abf",
"zone_id": 2,
"zone_name": "Nwave_Test",
"error_type": "manual",
"is_resolved": true,
"created_time": "2023-01-29T09:55:42.475167+00:00",
"reason": "broken_casing",
"resolved_time": "2023-01-29T09:55:42.475261+00:00",
"resolving_type": "manual",
"group_id": 24368,
"group_name": "Group_test",
"damaging": true,
"id": 6230232153,
"state": {
"trace_id": null,
"error_datetime": "2023-01-29T09:55:42.389000+00:00"
},
"comment": "Found broken sensor",
"user_id": "88954cc3-851a-4a2d-b8d4-6351ab574b8d",
"activation_status": false,
"damaged_status": false
},
...
],
"message": null,
"total": 144
}
Response data object fields:
device_id
- Device unique IDzone_name
- Name of the zone containing the devicezone_id
- ID of the zone containing the devicegroup_name
- Name of the group containing the devicegroup_id
- ID of the group containing the deviceproject_name
- Name of the project containing the devicereason
- see the term “Incident reasons” aboveid
- ID of the incidentdays_broken
- how many days ago the incident was registeredlatitude
/latitude
- device position coordinatesnetwork_id
- network ID of the position to which the device is bound toerror_type
- see the term “Error types” aboveis_resolved
- true if someone has diagnosed the problem with the Nwave Replacement App or changed the device damaging status to Falseresolving_time
- time of the incident resolving. see “is_resolved” filedcreated_time
- time of the incident registrationresolving_type
-auto
if the incident has been resolved by itself.manual
if someone resolved it using Nwave Replacement App or changed the device damaging status to Falsedamaging
- True if a consequence of the error detection was setting the device damaged statusstate.trace_id
- Trace ID of Raw Messages which led to the incident creationstate.error_datetime
- time of the incident creationcomment
- a user who resolves the incident can leave a commentuser_id
- ID of a user who resolved the incidentactivation_status
- current activation status of the devicedamaged_status
- current damaged status of the device