|
| 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