T-Valve 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" : "{T-Valve Serial Number}"
3
}
Copied!
Response:
1
{
2
"provider": {
3
"network_provider": "the_things_network",
4
"rssi": -31,
5
"spf": "SF7BW125",
6
"valveState": false,
7
"boxTamper": true,
8
"floodDetectionWireState": false,
9
"flood": false,
10
"magnet": false,
11
"alarmValidated": false,
12
"manualOpenIndicator": true,
13
"manualCloseIndicator": true,
14
"closeTime": 0,
15
"openTime": 0,
16
"waterTemp": 24.5,
17
"ambientTemp": 24.5,
18
"battery": 2.872,
19
"createdAt": "2021-02-16T11:53:16.526Z",
20
"lastActive": "2021-02-23T14:50:24.192Z",
21
"online": true
22
},
23
"_links": {
24
"self": {
25
"href": "/v1/provider/fetch"
26
}
27
}
28
}
Copied!

Request full 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" : "{T-Valve Serial Number}",
3
"command" : "request_full_data"
4
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "603516aa08f81715fffd1827",
5
"commandName": "RequestFullData",
6
"commandParams": "",
7
"deviceId": "36************1",
8
"createdAt": "2021-02-23T14:52:26.634Z",
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": “{T-Valve 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": "SetPacketPeriod",
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 Open Close 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": “{T-Valve Serial Number}”,
3
"command" : "set_open_close_time",
4
"opening_time" : 1, //in minutes, range 0-255, cannot be both 0
5
"closing_time" : 0 //in minutes, range 0-255, cannot be both 0
6
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "602fb8470a9764116d41b562",
5
"commandName": "SetOpenCloseTime",
6
"commandParams": {
7
"openingTime": 1,
8
"closingTime": 0
9
},
10
"deviceId": "36************11",
11
"createdAt": "2021-02-19T13:08:23.394Z",
12
"__v": 0
13
},
14
"_links": {
15
"self": {
16
"href": "/v1/provider/send"
17
}
18
}
19
}
Copied!

Set Manual Control

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{T-Valve Serial Number}”,
3
"command" : "set_manual_control",
4
"enable_open" : false,
5
"enable_close" : false
6
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "602fba020a9764116d41b563",
5
"commandName": "SetManualControl",
6
"commandParams": {
7
"enableOpen": false,
8
"enableClose": false
9
},
10
"deviceId": "363************1",
11
"createdAt": "2021-02-19T13:15:46.578Z",
12
"__v": 0
13
},
14
"_links": {
15
"self": {
16
"href": "/v1/provider/send"
17
}
18
}
19
}
Copied!

Set Emergency Openings

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{T-Valve Serial Number}”,
3
"command" : "set_emergency_openings",
4
"max_openings" : 5 // max 15
5
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "602fba020a9764116d41b563",
5
"commandName": "SetEmergencyOpenings",
6
"commandParams": {
7
"maxOpenings": 5
8
},
9
"deviceId": "363************1",
10
"createdAt": "2021-02-19T13:15:46.578Z",
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": “{T-Valve 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": “{T-Valve 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" : 2 // ms; min 10 ms
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
}
Copied!

Set Working Voltage

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{T-Valve Serial Number}”,
3
"command" : "set_working_voltage",
4
"voltage" : 1850 // in mV, value less than 1850mV has undefined behavior
5
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "604b5a5fdf17f60011b5d58c",
5
"commandName": "SetWorkingVoltage",
6
"commandParams": {
7
"voltage": 1850
8
},
9
"deviceId": "363************1",
10
"createdAt": "2021-03-12T12:11:11.300Z",
11
"__v": 0
12
},
13
"_links": {
14
"self": {
15
"href": "/v1/provider/send"
16
}
17
}
18
}
Copied!

Set Device Flood Sensor

Request URL:
1
POST /provider/send
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"serial_number": “{T-Valve Serial Number}”,
3
"command" : "set_device_flood_sensor",
4
"enabled" : true
5
}
Copied!
Response:
1
{
2
"provider": {
3
"status": "pending",
4
"_id": "604b5cf0df17f60011b5d5bf",
5
"commandName": "SetDeviceFloodSensor",
6
"commandParams": {
7
"enabled": true
8
},
9
"deviceId": "363************1",
10
"createdAt": "2021-03-12T12:22:08.954Z",
11
"__v": 0
12
},
13
"_links": {
14
"self": {
15
"href": "/v1/provider/send"
16
}
17
}
18
}
Copied!
Last modified 5mo ago