diff --git a/README.md b/README.md index 5c8ab58..77fe8a2 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,47 @@ Plug Mini (US). Where several values are listed, each identifies the same product. Values are Byte 0 of the service data with Bit 7 cleared, as listed in pySwitchbot's `SUPPORTED_TYPES`. +Newer products have no single-byte Device Type (Byte 0 of their service data, usually `0x00`, is +not in the table above). They are identified by a 4-byte **Product ID** at the end of the service +data: read the last 4 bytes; if they are not a known Product ID, read the 4 bytes before the last +byte. Most products have a `0x00…` and a `0x01…` form. These are the Product IDs in pySwitchbot's +`SUPPORTED_TYPES` (`_find_model_from_service_data_suffix`): + +| Device Type | Product ID | +|----------------------------|------------| +| Art Frame | 0x00113e10, 0x01113e10 | +| Candle Warmer Lamp | 0x001122b8, 0x011122b8 | +| Circulator Fan Pro | 0x0011b340, 0x0111b340 | +| Climate Panel | 0x0010f3d8, 0x0110f3d8 | +| Floor Lamp | 0x0010d0b0, 0x0110d0b0 | +| Hub3 | 0x0010b940, 0x0110b940 | +| Hub4 | 0x00128248, 0x01128248 | +| K11+ Vacuum | 0x0010fba8, 0x0110fba8 | +| Keypad Vision | 0x00110378, 0x01110378 | +| Keypad Vision Pro | 0x00115198, 0x01115198 | +| Lock Nano | 0x00122488, 0x01122488 | +| Lock Pro Wifi | 0x0010ff90, 0x0110ff90 | +| Lock Ultra | 0x0010a5b8, 0x0110a5b8 | +| Lock Ultra Max | 0x00119fb8, 0x01119fb8 | +| Lock Vision | 0x00116908, 0x01116908 | +| Lock Vision Pro | 0x00116909, 0x01116909 | +| Outdoor Plug (EU) | 0x001218d0 | +| Permanent Outdoor Light | 0x0010d0b7, 0x0110d0b7 | +| Plug Mini (IT) | 0x001243c8, 0x011243c8 | +| Presence Sensor | 0x0010ccc8, 0x0110ccc8 | +| RGBIC Neon Rope Light | 0x0010d0b6, 0x0110d0b6 | +| RGBIC Neon Wire Rope Light | 0x0010d0b5, 0x0110d0b5 | +| RGBICWW Ceiling Light | 0x0011bb10, 0x0111bb10 | +| RGBICWW Floor Lamp | 0x0010d0b4, 0x0110d0b4 | +| RGBICWW Light Bars | 0x0011bef8, 0x0111bef8 | +| RGBICWW Strip Light | 0x0010d0b3, 0x0110d0b3 | +| S20 Vacuum | 0x0010e050, 0x0110e050 | +| Smart Thermostat Radiator | 0x00113640, 0x01113640 | +| Standing Fan | 0x00110760, 0x01110760 | +| Strip Light 3 | 0x0010d0b1, 0x0110d0b1 | +| UWB Lock | 0x00121100, 0x01121100 | +| Weather Station | 0x001053b0, 0x011053b0 | + The device type is in the service data of SCAN_RSP. | Service data | | | diff --git a/devicetypes/lock.md b/devicetypes/lock.md index 7fd9c8f..f34118a 100644 --- a/devicetypes/lock.md +++ b/devicetypes/lock.md @@ -42,8 +42,8 @@ The following table is the Service Data of SCAN_RSP. ## Lock Pro, Lock Ultra and Lock Vision Pro Broadcast Message -Lock Pro (`$` / `0x04`), Lock Pro WiFi, Lock Ultra, Lock Ultra Max and Lock Vision Pro use a -different manufacturer data layout from the Lock and Lock Lite. Byte offsets below count from the +Lock Pro (`$` / `0x04`), Lock Pro WiFi, Lock Ultra, Lock Ultra Max, UWB Lock and Lock Vision Pro +use a different manufacturer data layout from the Lock and Lock Lite. Byte offsets below count from the start of the manufacturer data payload, after the 2-byte company ID `0x0969`. This is the layout [pySwitchbot](https://github.com/sblibs/pySwitchbot) parses (`switchbot/adv_parsers/lock.py`). @@ -58,10 +58,32 @@ start of the manufacturer data payload, after the 2-byte company ID `0x0969`. Th
| Byte | Field | Value |
|---|---|---|
| 0~5 | MAC Address | Device MAC address |
| 6 | Sequence Number | Increases when the broadcast data is updated |
| 7 | Lock Info | bit7: calibrated bit6-3: lock status (see Lock status) |
| 8 | State | bit3: automatic locking paused bit1: night latch bit0: charging status, high bit |
| 9 | Battery | bit7: charging status, low bit bit6-0: battery 0~100% |
| 10 | Alarms | bit6: unlocked alarm bit5: low temperature alarm bit4: power alarm bit2-1: battery status bit0: charging fault |
| Command | Lock / Lock Lite | Lock Pro, Ultra, Ultra Max, Vision, Vision Pro, Pro WiFi |
|---|---|---|
| Command | Lock / Lock Lite | Lock Pro, Ultra, Ultra Max, UWB Lock, Nano, Vision, Vision Pro, Pro WiFi |
| Lock | 0x570f4e01011000 | 0x570f4e0101000000 |
| Byte | Lock, Lock Lite, Lock Vision, Lock Vision Pro | Lock Pro, Ultra, Ultra Max, Pro WiFi |
|---|---|---|
| Byte | Lock, Lock Lite, Lock Vision, Lock Vision Pro | Lock Pro, Ultra, Ultra Max, UWB Lock, Pro WiFi |
| 0 | bit7: calibrated bit6-4: lock status bit2: door open (Lock and Lock Vision Pro only) | bit7: calibrated bit6-3: lock status |
| Bit | Setting |
|---|---|
| 7 | Light (0 off, 1 on) |
| 6 | Sound (0 off, 1 on) |
| 5 | Reserved |
| 4 | Manual unlock linkage (0 off, 1 on) |
| 3 | Quick Key enabled (0 off, 1 on) |
| 2 | Quick Key trigger (0 single press, 1 double press) |
| 1~0 | Quick Key function: 00 lock only, 01 unlock only, 10 lock and unlock |