-
Notifications
You must be signed in to change notification settings - Fork 1
/
data-scheme.jsonc
70 lines (70 loc) · 1.47 KB
/
data-scheme.jsonc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
[
// ============================ Server to Device Message
{ // type 1: set state
"cmd": "set",
"state": {
"1": { // set schedule
"mode": "time",
"detail": [
[
1543817375897,
1543817385237
],
] // schedule
},
"2": { // set on-off
"mode": "manual",
"detail": "on/off" // this is optional
},
"3": { // auto (sensor)
"mode": "auto",
"detail": {
"sensor": "soil/humidity/temp",
"trigger": 30,
"symbol": "<"
}
}
}
},
{
"cmd": "fetch"
},
// ============================ Device to Server Message
{
"t": "data",
"data": {
// whatever device want to send
},
},
{
"t": "greeting"
},
// ============================= DB Schema
{
"id": "1f7e204a",
"secret": "4cc348cd11d7018f42331197525d8e1bb4cf7a7fb934dd2d597f8f1845996756", // sha256
"owner": "john_smith", // username of owner
"state": {
// same as Server to Device Message
// except scheduled mode
"2": {
"mode": "time",
"detail": {
"schedules": [
{ // schedult 1:30 - 4:00 on Sun Mon Wed
"startHour": 1,
"startMin": 30,
"endHour": 4,
"endMin": 0,
"dows": [
0,
1,
3
]
}
]
}
}
}
}
]