Export Readings

The Urbanise "Export Readings" API is used to extract "processed and structured" sensor data from the Monitoring platform. It would typically be used to display a device status, trends or to define when a job, or other event, may comments in a third party system.

There are three calls available:

  1. All sensors at location (details, and current status of all sensors at a specific location)
  2. Sensor details (details, and current status of a specific sensor)
  3. Sensor history (historic readings from a specific sensor)

Security

In order to access the API you will need an API TOKEN which obtained from the "Operator Edit" screen by an Urbanise Super User. Please contact your Urbanise representative to obtain your API token.

Restful Interface

This is the preferred method for using the API

To use this interface GET a JSON representation of sensor data.

HTTP Verb

GET

Resource URL

https://monitoring.urbanise.com/api/v2/

Request Headers

X-Ubn-Api-Auth2: [YOUR API TOKEN]

Location & Sensor ID's

This API documentation refers to "Location ID" and "Sensor ID". These can be found in the Monitoring platform as part of the URL for either a Location or a Sensor. Please refer to below screenshots on where to find these ID's.

All Sensors at Location

Use this API to get details of all sensors at a specified location.

Request Method

URL: https://monitoring.urbanise.com/api/v2/sites/[LOCATION_ID]/sensors

Response

A JSON array of all sensors at the specified Location ID.

Example below:

{
  "_id": "5760a98187add1002200000e",
  "has_alert": false,
  "is_offline": false,
  "last_30_days": 0.6712595761275264,
  "last_30_days_previous": 0.9967034594208852,
  "last_7_days": 0.8108189592456401,
  "measures": "vibration",
  "name": "Outdoor: FCU",
  "sensor_id": "600521",
  "currently": 0,
  "previously": 7.91,
  "current_trend": "down",
  "last_reading_ts": "2017-02-05T09:11:12+00:00",
  "units": "mm/s",
  "display_state": "offline",
  "display_label": "offline",
  "display_url": "https://monitoring.urbanise.com/sensors/5760a98187add1002200000e",
  "profile_name": "Refrigerated Chiller - Residential",
  "value_type": "continuous",
  "down_is_good": true
},
 
{
  "_id": "5760a98187add10022000010",
  "has_alert": false,
  "is_offline": false,
  "last_30_days": 90.16826904219121,
  "last_30_days_previous": 95.45830692835234,
  "last_7_days": 87.04694302696463,
  "measures": "battery",
  "name": "FCU outside - battery",
  "sensor_id": "600521",
  "currently": 0,
  "previously": 82.5,
  "current_trend": "down",
  "last_reading_ts": "2017-02-05T09:11:12+00:00",
  "units": "%",
  "display_state": "offline",
  "display_label": "offline",
  "display_url": "https://monitoring.urbanise.com/sensors/5760a98187add10022000010",
  "profile_name": "Coin Cell Sensor",
  "value_type": "continuous",
  "down_is_good": false
},


Sensor Details

Use this API to get details of a specific sensor.

Request Method

URL: https://monitoring.urbanise.com/api/v2/sensors/[SENSOR_ID]

Response

A JSON response containing details of the specified sensor will be returned.

Example below:

{
 "_id": "5760c81863565b0013000021",
 "has_alert": false,
 "is_offline": false,
 "last_30_days": 28.852525761926533,
 "last_30_days_previous": 28.33389155028388,
 "last_7_days": 28.34117941266109,
 "measures": "temperature",
 "name": "Outdoor: Pool Temp",
 "sensor_id": "600759",
 "currently": 28.8,
 "previously": 28.7,
 "current_trend": "up",
 "last_reading_ts": "2017-02-07T04:51:39+00:00",
 "units": "C",
 "display_state": "ok",
 "display_label": "Perfect",
 "display_url": "https://monitoring.urbanise.com/sensors/5760c81863565b0013000021",
 "profile_name": "Pool Water Temp",
 "value_type": "continuous",
 "down_is_good": true
}

Sensor History

Use this API to get historic readings for a specific sensor.

Request Method

URL: https://monitoring.urbanise.com/api/v2/sensors/[SENSOR_ID]/history

Optional Parameters

If no parameters are supplied the API will return the last month of data. However you have the option to use the "period" parameter to return either the last day, week, month or year.

URL: https://monitoring.urbanise.com/api/v2/sensors/[SENSOR_ID]/history?period=d/w/m/y

Response

A JSON array containing the historical values of the specified sensor.

Example below:

{
 "value": {
   "si": "600759",
   "dt": "temperature",
   "ch": null,
   "gr": "145806",
   "ts": "2017-01-08T00:00:00+00:00",
   "count": 144,
   "mean": 30.68194444444445,
   "total": 4418.200000000001,
   "min": 27.9,
   "max": 33.2,
   "delta": 5.300000000000004,
   "v": 33.2
 }
},

{
 "value": {
   "si": "600759",
   "dt": "temperature",
   "ch": null,
   "gr": "145806",
   "ts": "2017-01-09T00:00:00+00:00",
   "count": 144,
   "mean": 28.427777777777784,
   "total": 4093.600000000001,
   "min": 26.5,
   "max": 30,
   "delta": 3.5,
   "v": 30
 }
},


/end