Air Quality Control
Resource From Client
Documents
- Guide to Multi-stage Aggregations Time Series Data API Endpoint (Conduit V7)
- Guide to enable a conduit for a user
- MQTT

[
{
"siteid": "Calculated Air Quality",
"location": {
"coordinates": [
0,
0
],
"type": "Point"
},
"deviceName": "CUP Fl. B4 North of West Corridors AQS ",
"channelDescription": "Temperature",
"offset": 0,
"cal": 1,
"netid": "65114f71abf5e4120e013cbe",
"chid": 1,
"tag": "CUP-B4-Z01-AQS-001v",
"unit": "°C",
"sensorType": "Temperature",
"id": "65114f71abf5e4120e013cbe",
"minVal": null,
"maxVal": null,
"data": [
{
"timestamp": "2023-10-05 05:00:01.000",
"value": 28.358
}
],
"limitData": false,
"limitOutput": false,
"timezone": "UTC"
},
{
"siteid": "Calculated Air Quality",
"location": {
"coordinates": [
0,
0
],
"type": "Point"
},
"deviceName": "CUP Fl. B4 North of West Corridors AQS",
"channelDescription": "Humidity",
"offset": 0,
"cal": 1,
"netid": "651150d5d161d60da10128fd",
"chid": 1,
"tag": "CUP-B4-Z01-AQS-001v",
"unit": "%",
"sensorType": "Percentage",
"id": "651150d5d161d60da10128fd",
"minVal": null,
"maxVal": null,
"data": [
{
"timestamp": "2023-10-05 05:00:01.000",
"value": 69.256
}
],
"limitData": false,
"limitOutput": false,
"timezone": "UTC"
},
{
"siteid": "Calculated Air Quality",
"location": {
"coordinates": [
0,
0
],
"type": "Point"
},
"deviceName": "CUP Fl. B4 North of West Corridors AQS",
"channelDescription": "PM2.5",
"offset": 0,
"cal": 1,
"netid": "651151fb33e3d96d9802aff2",
"chid": 1,
"tag": "CUP-B4-Z01-AQS-001v",
"unit": "μg/m3",
"sensorType": "Micrograms per meter cubed",
"id": "651151fb33e3d96d9802aff2",
"minVal": null,
"maxVal": null,
"data": [
{
"timestamp": "2023-10-05 05:00:01.000",
"value": 47.852
}
],
"limitData": false,
"limitOutput": false,
"timezone": "UTC"
},
{
"siteid": "Calculated Air Quality",
"location": {
"coordinates": [
0,
0
],
"type": "Point"
},
"locationSensor": [
{
"id": "650aa13385efb818290ab2a5",
"chid": 6,
"netid": "CUP-B4-AQS-01"
}
],
"deviceName": "CUP Fl. B4 North of West Corridors AQS",
"channelDescription": "PM10",
"offset": 0,
"cal": 1,
"netid": "651152c4304864ec0e031304",
"chid": 1,
"tag": "CUP-B4-Z01-AQS-001v",
"unit": "μg/m3",
"sensorType": "Micrograms per meter cubed",
"id": "651152c4304864ec0e031304",
"minVal": null,
"maxVal": null,
"data": [
{
"timestamp": "2023-10-05 05:00:01.000",
"value": 163.607
}
],
"limitData": false,
"limitOutput": false,
"timezone": "UTC"
}
]
curl --location 'http://203.159.103.38/conduitv7?token=xxx&siteid=xxx&limit=2&id=CUP-L2-AQS-50&ch=1&fcdt=1696377600&tcdt=1696464000&aggregateby=avg&groupby=hour'
Hierarchy
Hierarchy
Required Data for each Network ID
Examples
For Outdoor
[
{
"NID": 1,
"locationID": 1,
"category": "outdoor",
"parentCategory": null,
"nameEN": "outdoor",
"nameTH": "outdoor",
"nameZH": "outdoor",
}
]
For Outdoor Stations
[
{
"NID": 2,
"locationID": 2,
"category": "outdoor-station",
"parentCategory": "outdoor",
"nameEN": "Civic Plaza",
"nameTH": "Civic Plaza",
"nameZH": "Civic Plaza",
},
{
"NID": 3,
"locationID": 3,
"category": "outdoor-station",
"parentCategory": "outdoor",
"nameEN": "Parq",
"nameTH": "Parq",
"nameZH": "Parq",
}
]
For Indoor
filter category by indoor, get below response
[
{
"NID": 4,
"locationID": 4,
"category": "indoor",
"parentCategory": null,
"nameEN": "indoor",
"nameTH": "indoor",
"nameZH": "indoor",
}
]
For Towers in Indoor
filter category by tower, get below response
[
{
"NID": 5,
"locationID": 5,
"category": "tower-a",
"parentCategory": "indoor",
"nameEN": "tower A",
"nameTH": "tower A",
"nameZH": "tower A",
},
{
"NID": 6,
"locationID": 6,
"category": "tower-b",
"parentCategory": "indoor",
"nameEN": "tower B",
"nameTH": "tower B",
"nameZH": "tower B",
}
]
For Towers in Indoor
[
{
"NID": 7,
"locationID": 7,
"category": "tower-a",
"parentCategory": "tower-a",
"nameEN": "tower A",
"nameTH": "tower A",
"nameZH": "tower A",
},
{
"NID": 8,
"locationID": 8,
"category": "tower-b",
"parentCategory": "tower-a",
"nameEN": "tower B",
"nameTH": "tower B",
"nameZH": "tower B",
}
]
For Floors in Tower
[
{
"NID": 9,
"locationID": 9,
"category": "floor-1",
"parentCategory": "tower-a",
"nameEN": "Floor 1",
"nameTH": "Floor 1",
"nameZH": "Floor 1",
},
{
"NID": 10,
"locationID": 10,
"category": "floor-2",
"parentCategory": "tower-a",
"nameEN": "Floor 2",
"nameTH": "Floor 2",
"nameZH": "Floor 2",
}
]
For Location in Floor
[
{
"NID": 11,
"locationID": 11,
"category": "restroom",
"parentCategory": "floor-1",
"nameEN": "Restroom 1",
"nameTH": "Restroom 1",
"nameZH": "Restroom 1",
},
{
"NID": 12,
"locationID": 12,
"category": "conference-room-1",
"parentCategory": "floor-1",
"nameEN": "Conference Room 1",
"nameTH": "Conference Room 1",
"nameZH": "Conference Room 1",
}
]
Outdoor
Home

Station

Indoor
Home

Tower

Floor

Location

Mock Data Structure Design
[
// top parent indoor sensor
{
"sensorId": "CUP-L2-AQS-50",
"locationType": "indoor",
"name": "One Bangkoo",
"parent": 0,
"sensorType": null
},
// top parent outdoor sensor
{
"sensorId": "CUP-L2-AQS-51",
"locationType": "outdoor",
"name": "One Bangkoo",
"parent": 0,
"sensorType": null
},
// indoor tower
{
"sensorId": "CUP-L2-AQS-52",
"locationType": "indoor",
"name": "XXX Tower",
"parent": "CUP-L2-AQS-50",
"sensorType": "tower"
},
// indoor floor
{
"sensorId": "CUP-L2-AQS-53",
"locationType": "indoor",
"name": "F2",
"parent": "CUP-L2-AQS-52",
"sensorType": "floor"
},
// indoor location
{
"sensorId": "CUP-L2-AQS-54",
"locationType": "indoor",
"name": "Location A",
"parent": "CUP-L2-AQS-53",
"sensorType": "location"
},
// indoor location
{
"sensorId": "CUP-L2-AQS-55",
"locationType": "outdoor",
"name": "Outdoor Location A",
"parent": "CUP-L2-AQS-51",
"sensorType": "location"
}
]
Questions
- What is the diff between siteIDs
- When should we use MQTT and APIs
- How do we get all sensor grouping data