AQI Sensor LoRaWAN

Get device data

Request URL:
1
POST /provider/fetch
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number" : "{AQI-Sensor Serial Number}"
3
}
Copied!
Response:
1
{
2
"provider": {
3
"network_provider": "the_things_network",
4
"rssi": -73,
5
"spf": "SF7BW125",
6
"sAQI": 48,
7
"AQI": 48,
8
"CO2eq": 608,
9
"VOC": 0,
10
"relative_humidity": 27.6,
11
"pressure": 983.6,
12
"temperature": 23.5,
13
"accuracy_aqi": 3,
14
"voltage": 3.432,
15
"uplinkType": "01",
16
"keepAliveTime": 3,
17
"joinRetryPeriod": 2,
18
"deviceVersions": {
19
"hardware": 16,
20
"software": 16
21
},
22
"createdAt": "2021-02-24T21:34:44.698Z",
23
"lastActive": "2021-02-24T22:12:40.343Z",
24
"watchDogParams": {
25
"wdpC": 17,
26
"wdpUc": 24
27
},
28
"online": true,
29
"mac": "363936367A396B18"
30
},
31
"_links": {
32
"self": {
33
"href": "/v1/provider/fetch"
34
}
35
}
36
}
Copied!

Set KeepAlive Time

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{AQI-Sensor Serial Number}”,
3
"command" : "set_keepalive_time",
4
"time" : 3 // in minutes
5
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6036c743994ab35c7c701b8f",
5
"commandName": "SetKeepAlive",
6
"commandParams": {
7
"time": 3
8
},
9
"deviceId": "36*************8",
10
"createdAt": "2021-02-24T21:38:11.155Z",
11
"__v": 0
12
},
13
"_links": {
14
"self": {
15
"href": "/v1/provider/send"
16
}
17
}
18
}
Copied!

Get KeepAlive Time

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{AQI-Sensor Serial Number}”,
3
"command" : "get_keepalive_time"
4
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6036c795994ab35c7c701b95",
5
"commandName": "GetKeepAliveTime",
6
"commandParams": [],
7
"deviceId": "36*************8",
8
"createdAt": "2021-02-24T21:39:33.922Z",
9
"__v": 0
10
},
11
"_links": {
12
"self": {
13
"href": "/v1/provider/send"
14
}
15
}
16
}
Copied!

Get Device Version

Request URL:
1
POST /provider/fetch
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number" : "{AQI-Sensor Serial Number}",
3
"command" : "get_device_version"
4
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6036c987994ab35c7c701bac",
5
"commandName": "GetDeviceVersion",
6
"commandParams": [],
7
"deviceId": "36*************8",
8
"createdAt": "2021-02-24T21:47:51.812Z",
9
"__v": 0
10
},
11
"_links": {
12
"self": {
13
"href": "/v1/provider/send"
14
}
15
}
16
}
Copied!

Set Join Retry Period

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{AQI-Sensor Serial Number}”,
3
"command" : "set_join_retry_period",
4
"period" : 2, //minutes, cannot be 0
5
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6036c9c3994ab35c7c701bb1",
5
"commandName": "SetJoinRetryPeriod",
6
"commandParams": {
7
"period": 2
8
},
9
"deviceId": "36*************8",
10
"createdAt": "2021-02-24T21:48:51.970Z",
11
"__v": 0
12
},
13
"_links": {
14
"self": {
15
"href": "/v1/provider/send"
16
}
17
}
18
}
Copied!

Get Join Retry Period

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{HT-Sensor Serial Number}”,
3
"command" : "get_join_retry_period"
4
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6036caaf994ab35c7c701bbe",
5
"commandName": "GetJoinRetryPeriod",
6
"commandParams": [],
7
"deviceId": "36*************8",
8
"createdAt": "2021-02-24T21:52:47.045Z",
9
"__v": 0
10
},
11
"_links": {
12
"self": {
13
"href": "/v1/provider/send"
14
}
15
}
16
}
Copied!
Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{AQI-Sensor Serial Number}”,
3
"command" : "set_uplink_type",
4
"type" : "01" // string, "00" - unconfirmed, "01" - confirmed
5
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6036cb0a994ab35c7c701bc4",
5
"commandName": "SetUplinkType",
6
"commandParams": {
7
"type": "01"
8
},
9
"deviceId": "36*************8",
10
"createdAt": "2021-02-24T21:54:18.528Z",
11
"__v": 0
12
},
13
"_links": {
14
"self": {
15
"href": "/v1/provider/send"
16
}
17
}
18
}
Copied!
Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{HT-Sensor Serial Number}”,
3
"command" : "get_uplink_type"
4
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6036cb66994ab35c7c701bcb",
5
"commandName": "GetUplinkType",
6
"commandParams": [],
7
"deviceId": "36*************8",
8
"createdAt": "2021-02-24T21:55:50.153Z",
9
"__v": 0
10
},
11
"_links": {
12
"self": {
13
"href": "/v1/provider/send"
14
}
15
}
16
}
Copied!

Set Buzzer

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{AQI Serial Number}”,
3
"command" : "set_buzzer",
4
"volume" : 0, // Volume 15 - off, 0 - min... 14 - max
5
"frequency" : 1, // range 0 - 10
6
"active_time" : 2, // seconds; 0 - untill volume 15 is received
7
"on_time" : 1, // ms; min 10ms
8
"off_time" : 2 // ms; min 10ms
9
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "602fba020a9764116d41b563",
5
"commandName": "SetBuzzer",
6
"commandParams": {
7
"volume": 0,
8
"frequency": 1,
9
"activeTime": 2,
10
"onTime": 1,
11
"offTime": 2
12
},
13
"deviceId": "36*************8",
14
"createdAt": "2021-02-19T13:15:46.578Z",
15
"__v": 0
16
},
17
"_links": {
18
"self": {
19
"href": "/v1/provider/send"
20
}
21
}
22
}
Copied!

Set AQI Led

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{AQI Serial Number}”,
3
"command" : "set_aqi_led",
4
"red_behavior": 3, // 1- turn on, 2- blink fast, 3-blik slow, 4-turn off
5
"red_duration": 80, // in seconds, if it`s 0 -until it’s changed from new radio
6
// command or the device button is pressed
7
"green_behavior": 4,
8
"green_duration": 0,
9
"blue_behavior": 3,
10
"blue_duration": 80
11
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6037a0aa87c54b23ecebf846",
5
"commandName": "SetAqiLed",
6
"commandParams": {
7
"redBehavior": 3,
8
"redDuration": 80,
9
"greenBehavior": 0,
10
"greenDuration": 0,
11
"blueBehavior": 3,
12
"blueDuration": 70
13
},
14
"deviceId": "36*************8",
15
"createdAt": "2021-02-25T13:05:46.224Z",
16
"__v": 0
17
},
18
"_links": {
19
"self": {
20
"href": "/v1/provider/send"
21
}
22
}
23
}
Copied!

Set Watch Dog Params

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{AQI Serial Number}”,
3
"command" : "set_watch_dog_params",
4
"period_confirmen_uplinks": 17, // in minutes, if it is disabled "0"
5
//period_confirmen_uplinks !MUST! BE DIVIDABLE BY DEVICE KEEPALIVE PERIOD+ 7
6
"period_unconfirmen_uplinks":24, // in hours, if it is disabled "0"
7
"device_keepalive":3 // in minutes
8
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6035505708f81715fffd19c0",
5
"commandName": "SetWatchDogParams",
6
"commandParams": {
7
"periodConfirmenUplinks": 17,
8
"periodUnconfirmenUplinks": 24,
9
"deviceKeepAlive": 3
10
},
11
"deviceId": "36*************8",
12
"createdAt": "2021-02-23T18:58:31.945Z",
13
"__v": 0
14
},
15
"_links": {
16
"self": {
17
"href": "/v1/provider/send"
18
}
19
}
20
}
Copied!

Get Watch Dog Params

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{AQI Serial Number}”,
3
"command" : "get_watch_dog_params"
4
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "6036ce5bf6c1b85f22d280cc",
5
"commandName": "GetWatchDogParams",
6
"commandParams": [],
7
"deviceId": "36*************8",
8
"createdAt": "2021-02-24T22:08:27.116Z",
9
"__v": 0
10
},
11
"_links": {
12
"self": {
13
"href": "/v1/provider/send"
14
}
15
}
16
}
Copied!
Last modified 5mo ago