Skip to content

Commit e36d61b

Browse files
committed
Split and organize SwitchBot API v1.1 documentation by device
1 parent 0214825 commit e36d61b

80 files changed

Lines changed: 5894 additions & 5433 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 687 additions & 5433 deletions
Large diffs are not rendered by default.

devices/cameras/indoor-cam.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Indoor Cam
2+
3+
---
4+
5+
## Device List Information
6+
7+
| Key | Value Type | Description |
8+
| ------------------ | ---------- | -------------------------------------------------------------------------------------------------------- |
9+
| deviceId | String | device ID |
10+
| deviceName | String | device name |
11+
| deviceType | String | device type. _Indoor Cam_ |
12+
| enableCloudService | Boolean | determines if Cloud Service is enabled or not for the current device |
13+
| hubDeviceId | String | device's parent Hub ID. _000000000000_ when the device itself is a Hub or it is connected through Wi-Fi. |
14+
15+
---
16+
17+
## Webhook Events
18+
19+
| Key Name | Value Type | Description |
20+
| -------------- | ---------- | --------------------------------------------------------------------------- |
21+
| eventType | String | the type of events |
22+
| eventVersion | String | the current event version |
23+
| context | Object | the detail info of the event |
24+
| deviceType | String | the type of the device |
25+
| deviceMac | String | the MAC address of the device |
26+
| detectionState | String | the detection state of the device, "DETECTED" stands for motion is detected |
27+
| timeOfSample | Long | the time stamp when the event is sent |
28+
29+
```js
30+
{
31+
"eventType": "changeReport",
32+
"eventVersion": "1",
33+
"context": {
34+
"deviceType": "WoCamera",
35+
"deviceMac": DEVICE_MAC_ADDR,
36+
"detectionState": "DETECTED",
37+
"timeOfSample": 123456789
38+
}
39+
}
40+
```

devices/cameras/pantilt-cam-2k.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Pan/Tilt Cam 2K
2+
3+
---
4+
5+
## Device List Information
6+
7+
| Key | Value Type | Description |
8+
| ------------------ | ---------- | -------------------------------------------------------------------------------------------------------- |
9+
| deviceId | String | device ID |
10+
| deviceName | String | device name |
11+
| deviceType | String | device type. _Pan/Tilt Cam 2K_ |
12+
| enableCloudService | Boolean | determines if Cloud Service is enabled or not for the current device |
13+
| hubDeviceId | String | device's parent Hub ID. _000000000000_ when the device itself is a Hub or it is connected through Wi-Fi. |
14+
15+
---
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Pan/Tilt Cam Plus 2K
2+
3+
---
4+
5+
## Device List Information
6+
7+
| Key | Value Type | Description |
8+
| ------------------ | ---------- | -------------------------------------------------------------------------------------------------------- |
9+
| deviceId | String | device ID |
10+
| deviceName | String | device name |
11+
| deviceType | String | device type. _Pan/Tilt Cam Plus 2K_ |
12+
| enableCloudService | Boolean | determines if Cloud Service is enabled or not for the current device |
13+
| hubDeviceId | String | device's parent Hub ID. _000000000000_ when the device itself is a Hub or it is connected through Wi-Fi. |
14+
15+
---
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Pan/Tilt Cam Plus 3K
2+
3+
---
4+
5+
## Device List Information
6+
7+
| Key | Value Type | Description |
8+
| ------------------ | ---------- | -------------------------------------------------------------------------------------------------------- |
9+
| deviceId | String | device ID |
10+
| deviceName | String | device name |
11+
| deviceType | String | device type. _Pan/Tilt Cam Plus 3K_ |
12+
| enableCloudService | Boolean | determines if Cloud Service is enabled or not for the current device |
13+
| hubDeviceId | String | device's parent Hub ID. _000000000000_ when the device itself is a Hub or it is connected through Wi-Fi. |
14+
15+
---

devices/cameras/pantilt-cam.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Pan/Tilt Cam
2+
3+
---
4+
5+
## Device List Information
6+
7+
| Key | Value Type | Description |
8+
| ------------------ | ---------- | -------------------------------------------------------------------------------------------------------- |
9+
| deviceId | String | device ID |
10+
| deviceName | String | device name |
11+
| deviceType | String | device type. _Pan/Tilt Cam_ |
12+
| enableCloudService | Boolean | determines if Cloud Service is enabled or not for the current device |
13+
| hubDeviceId | String | device's parent Hub ID. _000000000000_ when the device itself is a Hub or it is connected through Wi-Fi. |
14+
15+
---
16+
17+
## Webhook Events
18+
19+
| Key Name | Value Type | Description |
20+
| -------------- | ---------- | --------------------------------------------------------------------------- |
21+
| eventType | String | the type of events |
22+
| eventVersion | String | the current event version |
23+
| context | Object | the detail info of the event |
24+
| deviceType | String | the type of the device |
25+
| deviceMac | String | the MAC address of the device |
26+
| detectionState | String | the detection state of the device, "DETECTED" stands for motion is detected |
27+
| timeOfSample | Long | the time stamp when the event is sent |
28+
29+
```js
30+
{
31+
"eventType": "changeReport",
32+
"eventVersion": "1",
33+
"context": {
34+
"deviceType": "WoPanTiltCam",
35+
"deviceMac": DEVICE_MAC_ADDR,
36+
"detectionState": "DETECTED",
37+
"timeOfSample": 123456789
38+
}
39+
}
40+
```

devices/cameras/video-doorbell.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Video Doorbell
2+
3+
---
4+
5+
## Device List Information
6+
7+
| Key | Value Type | Description |
8+
| ------------------ | ---------- | -------------------------------------------------------------------- |
9+
| deviceId | String | device ID |
10+
| deviceName | String | device name |
11+
| deviceType | String | device type. _Video Doorbell_ |
12+
| enableCloudService | Boolean | determines if Cloud Service is enabled or not for the current device |
13+
| hubDeviceId | String | device's parent Hub ID |
14+
15+
---
16+
17+
## Device Status
18+
19+
| Key | Value Type | Description |
20+
| ----------- | ---------- | --------------------------------------------------------- |
21+
| deviceId | String | device ID |
22+
| deviceType | String | device type. _Video Doorbell_ |
23+
| hubDeviceId | String | device's parent Hub ID |
24+
| version | String | the current BLE and Wi-Fi firmware version, e.g. V3.1-6.3 |
25+
| battery | Integer | the current battery level |
26+
| online | Boolean | the connection status of the device. _true_ or _false_ |
27+
28+
---
29+
30+
## Control Commands
31+
32+
| deviceType | commandType | Command | command parameter | Description |
33+
| -------------- | ----------- | ---------------------- | ----------------- | --------------------- |
34+
| Video Doorbell | command | enableMotionDetection | default | Set to enabled state |
35+
| Video Doorbell | command | disableMotionDetection | default | Set to disabled state |
36+
37+
---
38+
39+
## Webhook Events
40+
41+
| Key Name | Value Type | Description |
42+
| -------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
43+
| eventType | String | the type of events |
44+
| eventVersion | String | the current event version |
45+
| context | Object | the detail info of the event |
46+
| deviceType | String | the type of the device |
47+
| deviceMac | String | the MAC address of the device |
48+
| battery | Integer | the battery level |
49+
| detectionState | String | the motion state of the device, "DETECTED" stands for motion is detected; "NOT_DETECTED" stands for motion has not been detected for some time |
50+
| timeOfSample | Long | the time stamp when the event is sent |
51+
| press | Boolean | the Doorbell button was pressed |
52+
53+
```js
54+
{
55+
"eventType": "changeReport",
56+
"eventVersion": "1",
57+
"context": {
58+
"deviceType": "Video Doorbell",
59+
"deviceMac": DEVICE_MAC_ADDR,
60+
"battery": 80,
61+
"detectionState": "DETECTED",
62+
"press": true,
63+
"timeOfSample": 123456789
64+
}
65+
}
66+
```
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Air Purifier PM2.5
2+
3+
---
4+
5+
## Device List Information
6+
7+
| Key | Value Type | Description |
8+
| ------------------ | ---------- | -------------------------------------------------------------------- |
9+
| deviceId | String | device ID |
10+
| deviceName | String | device name |
11+
| deviceType | String | device type. _Air Purifier PM2.5_ |
12+
| enableCloudService | Boolean | determines if Cloud Service is enabled or not for the current device |
13+
| hubDeviceId | String | returns `null` if not a bluetooth device |
14+
15+
---
16+
17+
## Device Status
18+
19+
| Key | Value Type | Description |
20+
| ----------- | ---------- | ----------------------------------------------------------------------------------------- |
21+
| deviceId | String | device ID |
22+
| deviceType | String | device type. _Air Purifier PM2.5_ |
23+
| power | String | current state; `ON`, on; `OFF`, off |
24+
| version | String | the current firmware version, e.g. V4.2 |
25+
| hubDeviceId | String | returns `null` if not a bluetooth device |
26+
| mode | Integter | the current mode. `1`, normal or fan mode; `2`, auto mode; `3`, sleep mode; `4`, pet mode |
27+
| childLock | Integter | child lock. `0`, disabled; `1`, enabled |
28+
29+
---
30+
31+
## Control Commands
32+
33+
| deviceType | commandType | Command | command parameter | Description |
34+
| ------------------ | ----------- | ------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
35+
| Air Purifier PM2.5 | command | turnOff | default | set to OFF state |
36+
| Air Purifier PM2.5 | command | turnOn | default | set to ON state |
37+
| Air Purifier PM2.5 | command | setMode | {"mode": mode_int, "fanGear": fan_level_int} | set the mode. `mode_int`, `1`, normal or fan mode; `2`, auto mode; `3`, sleep mode; `4`, pet mode; `fan_level_int`, the fan level can only be set if `mode_int` is set to `1`, `1~3` |
38+
| Air Purifier PM2.5 | command | setChildLock | `0` or `1` | enable or disable child lock. `1`, enable; `0`, disable |
39+
40+
---
41+
42+
## Webhook Events
43+
44+
| Key Name | Value Type | Description |
45+
| ------------ | ---------- | ----------------------------------------------------------------------------------------- |
46+
| eventType | String | the type of events |
47+
| eventVersion | String | the current event version |
48+
| context | Object | the detail info of the event |
49+
| deviceType | String | the type of the device |
50+
| deviceMac | String | the MAC address of the device |
51+
| power | String | the power state of the device |
52+
| mode | Integer | the current mode. `1`, normal or fan mode; `2`, auto mode; `3`, sleep mode; `4`, pet mode |
53+
| childLock | Integer | child lock. `0`, disabled; `1`, enabled |
54+
| timeOfSample | Long | the time stamp when the event is sent |
55+
56+
```js
57+
{
58+
"eventType": "changeReport",
59+
"eventVersion": "1",
60+
"context": {
61+
"deviceType": "Air Purifier PM2.5",
62+
"deviceMac": DEVICE_MAC_ADDR,
63+
"power": "ON",
64+
"mode": 4,
65+
"childLock": 0,
66+
"timeOfSample": 123456789
67+
}
68+
}
69+
```

0 commit comments

Comments
 (0)