Flood 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" : "{Flood Serial Number}"
3
}
Copied!
Response:
1
{
2
"provider": {
3
"network_provider": "the_things_network",
4
"rssi": 0,
5
"boxTamper": false,
6
"flood": false,
7
"temperature": 24,
8
"battery": 3.088,
9
"createdAt": "2021-02-08T15:15:22.516Z",
10
"lastActive": "2021-02-19T15:36:44.731Z",
11
"online": false
12
},
13
"_links": {
14
"self": {
15
"href": "/v1/provider/fetch"
16
}
17
}
18
}
Copied!

Get Temperature

Request URL:
1
POST /provider/fetch
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number" : "{Flood Serial Number}",
3
"command" : "get_temperature"
4
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "603114ad0355950a25d5175e",
5
"commandName": "GetTemperature",
6
"commandParams": "",
7
"deviceId": "313638353E387F18",
8
"createdAt": "2021-02-20T13:54:53.497Z",
9
"__v": 0
10
},
11
"_links": {
12
"self": {
13
"href": "/v1/provider/send"
14
}
15
}
16
}
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": “{Flood Serial Number}”,
3
"command" : "set_keepalive_time",
4
"time" : 3 // in minutes
5
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "602fa06f0a9764116d41b4ab",
5
"commandParams": {
6
"time": 3
7
},
8
"commandName": "SetFloodPacketPeriod",
9
"deviceId": "3************1",
10
"createdAt": "2021-02-19T11:26:39.004Z",
11
"__v": 0
12
},
13
"_links": {
14
"self": {
15
"href": "/v1/provider/send"
16
}
17
}
18
}
Copied!

Set Flood Alarm 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": “{Flood Serial Number}”,
3
"command" : "set_flood_alarm_time",
4
"time" : 10, //seconds, cannot be 0
5
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "603117d8fd3e800bf072899f",
5
"commandName": "SetFloodAlarmTime",
6
"commandParams": {
7
"time": 10
8
},
9
"deviceId": "31**************18",
10
"createdAt": "2021-02-20T14:08:24.155Z",
11
"__v": 0
12
},
13
"_links": {
14
"self": {
15
"href": "/v1/provider/send"
16
}
17
}
18
}
Copied!

Set 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": “{Flood Serial Number}”,
3
"command" : "set_led",
4
"led_id" : 0,
5
"behavior" : 1,
6
"senonds" : 2 //IF seconds=0, execute the command until OK button is pressed or
7
//next command is received
8
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "602fba020a9764116d41b563",
5
"commandName": "SetLED",
6
"commandParams": {
7
"ledId": 0,
8
"behavior": 1,
9
"seconds": 2
10
},
11
"deviceId": "363************1",
12
"createdAt": "2021-02-19T13:15:46.578Z",
13
"__v": 0
14
},
15
"_links": {
16
"self": {
17
"href": "/v1/provider/send"
18
}
19
}
20
}
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": “{Flood 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" : 10, // ms; min 10ms
8
"off_time" : 20 // 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": "363************1",
14
"createdAt": "2021-02-19T13:15:46.578Z",
15
"__v": 0
16
},
17
"_links": {
18
"self": {
19
"href": "/v1/provider/send"
20
}
21
}
22
}
23
"href": "/v1/provider/send"
24
}
25
}
26
}
Copied!
Last modified 5mo ago