Downloading data for analysis
Sensor data you send with MQTT is stored on our data server and can be accessed for analysis through a REST api.
Get data
https://data.stemi.education/api/v1/streams/[streamId]/events/analysis?take=[takeNum]&skip=[skipNum]&tags=[tag1]&tags=[tag2]&startDate=[2022-12-31 23:45]&endDate=[2023-01-01 00:15]
| Type | Description | |
|---|---|---|
streamId | string | Grabs the data for a particular stream |
take | integer | Number of events to return |
skip | integer | Number of events to skip |
tags | string or array of string | Filters data for specific tag(s) |
type | string, must be one of SensorData.SENSOR_TYPES | Filters data for specific type |
startDate | string that can be parsed by new Date() | Filters data from given date |
endDate | string that can be parsed by new Date() | Filters data until given date |
Response format
{
"columns": ["eventId", "value", "typeId", "tagId"],
"events": [{
'id': 57,
'deviceId': 1,
'createdAt': '2023-01-17T19:52:00.954Z',
'entries': [
[57, 36.3096, 2, None],
[57, 974.783, 1, None],
[57, 849, 3, 1],
....,
]},
...
]
}
Get dimensions
https://data.stemi.education/api/v1/streams/[streamId]/events/dimensions
| Type | Description | |
|---|---|---|
streamId | string | Grabs the data for a particular stream |
Response format
{
"tags": {
"1": "S2",
"2": "S1",
"3": "Barometer",
"4": "Aht",
"5": "Light right",
"6": "Light left"
},
"types": {
"0": "Light",
"1": "Pressure",
"2": "AirHumidity",
"3": "SoilHumidity",
"4": "AirTemperature",
"5": "SoilTemperature",
"6": "Other"
},
"devices": {
"1": "cl0kyjr5d235822dsxzgyeg27k1"
}
}