Schedules

Create Schedule

Scope: Trusted
Request URL:
1
POST /schedules
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"controller_id": "G********H3",// serial number of the device
3
"days" : "0000010",// days of week you want the schedule to be active
4
"active": 1,
5
"from_time": 650, //time formula:(H)*60+(min)/10:50 =>10*60= 600 + 60 = 650
6
"to_time": 700, //time formula:(H)*60+(min)/11:40 =>11*60= 660 + 40 = 700
7
"device_hours": 14, // device hours at the moment of creatio
8
"action": "command", //thermostat mode or command
9
"target": 24, // target temperature or state// integer//
10
for smartpug or bobbie 0- off, 1 - on
11
"push":1 // 1/0 for push notification
12
"default_state": "do_nothing"// not working for vicki /"on","off","do_nothing"
13
// when schedule ends, what state you want to set the device, its for melissa bobbie smartplug
14
}
Copied!
Response:
1
{
2
"schedules": {
3
"controller_id": 1******,
4
"days": "0000010",
5
"active": 1,
6
"from_time": "2021-05-29 10:50:00",
7
"to_time": "2021-05-29 11:40:00",
8
"action": "command",
9
"target": 24,
10
"push": 1,
11
"user_time_offset": null,
12
"id": 21
13
},
14
"_links": {
15
"self": {
16
"href": "/v1/schedules"
17
}
18
}
19
}
Copied!

Fetch Controller's Schedule

Scope: Trusted
Request URL:
1
GET /schedules/{Controller Serial Number}
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Response:
1
{
2
"_embedded": {
3
"schedules": [
4
{
5
...
6
},
7
{
8
...
9
},
10
{
11
"controller_id": 1****,
12
"from_time": "2021-05-29 10:50:00",
13
"to_time": "2021-05-29 11:40:00",
14
"days": "0000010",
15
"target": 24,
16
"main_target": null,
17
"default_state": "do_nothing",
18
"action": "command",
19
"priority": 0,
20
"active": 1,
21
"push": 1,
22
"user_time_offset": null,
23
"id": 21,
24
"_links": {
25
"self": {
26
"href": "/v1/schedules/21"
27
}
28
}
29
}
30
]
31
},
32
"total": 5,
33
"_links": {
34
"self": {
35
"href": "/v1/schedules/GC********3"
36
}
37
}
38
}
Copied!

Fetch Schedule

Scope: Trusted
Request URL:
1
GET /schedules/{schedule id}
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Response:
1
{
2
"schedules": {
3
"id": 3,
4
"controller_id": 2,
5
"from_time": "2021-07-02 09:20:00",
6
"to_time": "2021-07-02 16:40:00",
7
"days": "1111111",
8
"target": 27,
9
"main_target": null,
10
"default_state": "do_nothing",
11
"action": "thermostat_mode",
12
"priority": 0,
13
"active": 1,
14
"push": 1,
15
"user_time_offset": null
16
},
17
"_links": {
18
"self": {
19
"href": "/v1/schedules/3"
20
}
21
}
22
}
Copied!

Update Timer

Scope: Trusted
Request URL:
1
PATCH /schedules/{schedules id}
Copied!
Headers:
1
Content-Type: application/json
2
Authorization: Bearer {access_token}
Copied!
Body:
1
{
2
"from_time" : 1300,
3
"to_time" : 1400,
4
"days": "0000011"
5
}
Copied!
Response:
1
{
2
"schedules": {
3
"id": 10,
4
"controller_id": 1,
5
"from_time": "2021-07-03 21:40:00",
6
"to_time": "2021-07-03 23:20:00",
7
"days": "0000011",
8
"target": 24,
9
"main_target": null,
10
"default_state": "do_nothing",
11
"action": "command",
12
"priority": 0,
13
"active": 1,
14
"push": 1,
15
"user_time_offset": null
16
},
17
"_links": {
18
"self": {
19
"href": "/v1/schedules/10"
20
}
21
}
22
}
Copied!
Last modified 4mo ago