Climaps API  version 1
Static Public Member Functions | List of all members
data Class Reference

Static Public Member Functions

static getDataByStationId ()
 
static getMostRecentValuesByStationId ()
 

Static Public Attributes

static MAX_DOWNLOAD_RANGE = 5356800
 Maximum range in seconds, scale with the number of stations (e.g., 1 station: MAX_DOWNLOAD_RANGE, 2 stations: MAX_DOWNLOAD_RANGE / 2, ...)
 
static NOT_CALIBRATABLE = 0
 The measurement cannot be calibrated.
 
static NOT_CALIBRATED = 1
 The measurement can be calibrated but has not been calibrated.
 
static CALIBRATED = 2
 The measurement has been calibrated.
 
static CAT_SENSOR = 1
 Sensors plugged into a station (e.g., an Apogee SI-11, a Sensirion SHT75)
 
static CAT_HEALTH_SYSTEM = 2
 System health data (e.g., battery level, current consumption)
 
static CAT_NETWORK = 3
 Networking data, including GPRS data (e.g., radio signal quality, next hop)
 
static CAT_SYSTEM = 4
 System data (e.g., compilation date)
 
static CAT_HEALTH_SENSOR = 5
 Sensor health data (e.g., external battery level)
 

Detailed Description

This class lets you access the data sent by stations. To download large amounts of data, it is recommended to use the downloads class which works asynchronously.

Member Function Documentation

static data::getDataByStationId ( )
static

Get the data sent by a station.

Parameters
stringstationsIdComma-separated list of stations id (e.g., "301,652,1604")
stringmeasurementsIdComma-separated list of measurements id (e.g., "246,246,265")
stringslotsComma-separated list of slots (e.g., "0,2,2")
intfromBegining of the time interval in epoch time
inttoEnd of the time interval in epoch time
stringresolutionResolution of the requested data, can be either full, 15m, 1h, or 1d
Returns

An array of objects such as:

Property Type Description
stationId int Station id
id int Measurement id
stationName string Name of the station
catId int Id of the category the sensor falls in (e.g., data::CAT_HEALTH_SYSTEM)
name string Name of the measurement (e.g., "Temperature")
sensor string Name of the sensor (e.g., "SHT75")
slot int Number of the slot the sensor is installed on
units string Units of the measurement (e.g., "°C")
data array Array of points such as [[epoch, value], [epoch, value], ...]
Note
The p arameters stationsId, measurementsId, and slots must have the same number of values
The data arrays are sorted by date, oldest data first
The name of the sensor is automatically translated into the the user's current language (see account::getOwnSettings)
static data::getMostRecentValuesByStationId ( )
static

For each measurement sent by a station, get the most recent value received.

Parameters
intstationIdThe station Id
intnotOlderThanDeadline for data in seconds, older data is ignored (set to 0 to remove age restriction)
Returns

An array of objects such as:

Property Type Description
id int Measurement id
name string Name of the measurement (e.g., "temperature")
sensor string Name of the sensor (e.g., "Apogee SI-11")
catId int Id of the category the sensor falls in (e.g., data::CAT_HEALTH_SYSTEM)
slot int Slot number
calibration int The calibration state of the measurement (e.g., data::CALIBRATED)
displayOrder int Preferred order for display (lowest value should come first)
visible boolean Whether the measurement is visible to the user (e.g., see account::setOwnMeasurementHidden)
units string Units of the sensor (e.g., "°C")
epoch int Date of the value, in epoch time
value float Value measured
Note
The name of the measurements are automatically translated into the the user's current language (see account::getOwnSettings)