homebridge-roborock-vacuum 1.7.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +43 -2
- package/config.schema.json +10 -0
- package/dist/base_matter_accessory.js +89 -0
- package/dist/base_matter_accessory.js.map +1 -0
- package/dist/platform.js +335 -24
- package/dist/platform.js.map +1 -1
- package/dist/protocol.js +42 -0
- package/dist/protocol.js.map +1 -0
- package/dist/scene_matter_accessory.js +69 -0
- package/dist/scene_matter_accessory.js.map +1 -0
- package/dist/ui/index.js +244 -8
- package/dist/ui/index.js.map +1 -1
- package/dist/vacuum_matter_accessory.js +651 -0
- package/dist/vacuum_matter_accessory.js.map +1 -0
- package/homebridge-ui/public/index.html +22 -6
- package/homebridge-ui/public/index.js +500 -31
- package/homebridge-ui/public/styles.css +68 -0
- package/package.json +9 -2
- package/roborockLib/roborockAPI.js +161 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
- **New Feature**: Matter protocol support (Beta)
|
|
6
|
+
- Per-device protocol selector in the settings UI: publish each vacuum over **HomeKit (HAP)** (default), **Matter (Beta)**, or skip it
|
|
7
|
+
- Vacuums publish as native Matter robotic vacuum cleaners: proper vacuum icon and controls in Apple Home (also works with Google Home, Alexa, SmartThings)
|
|
8
|
+
- **Room cleaning** through the Matter ServiceArea cluster (Apple Home needs iOS 18.4+): pick named rooms in the controller and clean only those; the room currently being cleaned is reported live
|
|
9
|
+
- **Vacuum / Mop / Vacuum & Mop** clean modes mapped to the Roborock suction and water-box settings; models without a water box only offer Vacuum
|
|
10
|
+
- Battery, charging state and operational errors (stuck, dust bin missing, dock problems, …) reported over Matter
|
|
11
|
+
- Roborock **scenes** as Matter on/off buttons on the plugin's own bridge, with a per-device "Bridge scene buttons over Matter" toggle
|
|
12
|
+
- Pairing QR codes, commissioning status and naming hints shown on the settings page (per device, plus the scene-button bridge)
|
|
13
|
+
- Requires **Homebridge 2.x with Matter enabled**; on Homebridge 1.x (or with Matter disabled) Matter selections safely fall back to HAP
|
|
14
|
+
- **Known limitations (Beta)**: Apple Home's Matter support for vacuums is still immature — expect the "Uncertified Accessory" warning, a generic "Matter Accessory" name during pairing (type the name shown in the settings page), and occasional instability. See the README's "Matter support (Beta)" section
|
|
15
|
+
- **Improvement**: Settings page loads the device list instantly from a local cache (prefetched at login, refreshed in the background); "Load devices" forces a cloud refresh
|
|
16
|
+
- **Fix**: Matter accessories now receive live state updates (state, battery, clean mode) instead of only the startup snapshot
|
|
17
|
+
- **Fix**: Duplicate scene names across multiple Matter vacuums are suffixed with the vacuum name regardless of discovery order
|
|
18
|
+
|
|
3
19
|
## 1.2.2
|
|
20
|
+
|
|
4
21
|
- **New Feature**: Dynamic Scene Switch Management
|
|
5
22
|
- Automatically create HomeKit switch buttons for each device's available scenes
|
|
6
23
|
- Scene switches named after scene names with momentary switch behavior
|
|
@@ -11,9 +28,11 @@
|
|
|
11
28
|
- **Fix**: Resolved recursive call issue in scene methods
|
|
12
29
|
|
|
13
30
|
## 1.0.15
|
|
31
|
+
|
|
14
32
|
- Fix Roborock Saros 10R Status issue
|
|
15
33
|
|
|
16
34
|
## 1.0.6
|
|
35
|
+
|
|
17
36
|
- Support new model
|
|
18
37
|
|
|
19
38
|
## 1.0.0
|
package/README.md
CHANGED
|
@@ -69,9 +69,50 @@ Follow these steps to install the plugin:
|
|
|
69
69
|
|
|
70
70
|
## Configuration
|
|
71
71
|
|
|
72
|
-
Use the Homebridge UI settings page to sign in and configure the plugin.
|
|
72
|
+
Use the Homebridge UI settings page to sign in and configure the plugin. Click **Load devices** to list the vacuums on your account, then choose a protocol for each one:
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
- **HomeKit (HAP)** — the default. The vacuum is bridged to Apple Home as a fan-style accessory, as in previous versions.
|
|
75
|
+
- **Matter (Beta)** — the vacuum is published over Matter as a robotic vacuum cleaner, so it gets the native vacuum icon and controls in Apple Home (and works with Google Home, Alexa and SmartThings). This is an experimental feature — read the [Matter support (Beta)](#matter-support-beta) section below before enabling it.
|
|
76
|
+
- **Skip** — the vacuum is excluded entirely. You can also enter device IDs manually in the list below; manual entries are always skipped.
|
|
77
|
+
|
|
78
|
+
When Homebridge restarts, each device is (re)published according to its selection. A device that was cached under a different protocol (or is now skipped) is removed from the old bridge first. **Changing a device's protocol re-creates the accessory**, so it loses its room and automation assignments in your home app and must be re-organized there.
|
|
79
|
+
|
|
80
|
+
### Matter support (Beta)
|
|
81
|
+
|
|
82
|
+
> ⚠️ **This is an experimental, lab-grade beta feature.** Matter support for robotic vacuums is still very new on the controller side. In particular, **Apple Home's compatibility is currently poor and not very stable**: the bridge is uncertified (Apple shows an "Uncertified Accessory" warning), the accessory appears as a generic **"Matter Accessory"** during pairing and must be named manually, room selection needs iOS 18.4 or later, and accessories can occasionally show "Not responding" or lose features after iOS updates. If you want the most reliable day-to-day experience, stay on **HomeKit (HAP)**. Choose Matter only if you want the native vacuum UI and room cleaning, and can live with rough edges.
|
|
83
|
+
|
|
84
|
+
#### What you get over Matter
|
|
85
|
+
|
|
86
|
+
- The **native robot-vacuum accessory** in Apple Home (proper icon, start/stop, Siri) instead of the fan-style HAP accessory.
|
|
87
|
+
- **Room cleaning**: the vacuum's named rooms are exposed through the Matter ServiceArea cluster. Pick rooms in the controller and start cleaning — selecting none (or all) runs a full clean. While a room clean runs, the controller shows the room currently being cleaned.
|
|
88
|
+
- **Vacuum / Mop / Vacuum & Mop** clean modes, mapped to the Roborock suction and water-box settings (models without a water box only offer Vacuum).
|
|
89
|
+
- **Battery, charging state and error reporting** (stuck, dust bin missing, dock unreachable, … are surfaced as Matter operational errors).
|
|
90
|
+
- Every Roborock **scene** that targets the device becomes an on/off button (see step 5 below). When the same scene name exists on more than one Matter vacuum, the vacuum's name is appended to keep the buttons distinguishable.
|
|
91
|
+
- **Identify** ("play sound to locate" in Apple Home) plays the vacuum's find-me sound.
|
|
92
|
+
|
|
93
|
+
Run-mode semantics follow the Matter spec: setting the run mode to **Idle stops** the vacuum where it is; use the **dock/Go Home** control to send it back to the charger.
|
|
94
|
+
|
|
95
|
+
#### Requirements
|
|
96
|
+
|
|
97
|
+
- **Homebridge 2.x** with Matter enabled on the bridge this plugin runs on (Homebridge 1.x, or Matter disabled, silently falls back to HAP with a log warning — nothing breaks).
|
|
98
|
+
- For room cleaning in Apple Home: **iOS 18.4 or later**, and rooms must be **named in the Roborock app** (unnamed rooms are not published; the room list loads shortly after Homebridge starts).
|
|
99
|
+
|
|
100
|
+
#### Setup steps
|
|
101
|
+
|
|
102
|
+
1. **Enable Matter on the bridge.** If the plugin runs as a child bridge (the default when configured through the Homebridge UI), tick **"Enable Matter on this plugin's child bridge"** on the plugin settings page (writes `_bridge.matter` for you). If it runs on the main bridge, set `"matter": true` on the `bridge` block in `config.json`. Restart Homebridge to apply.
|
|
103
|
+
2. **Select the protocol.** On the plugin settings page press **Load devices** and set the vacuum's dropdown to **Matter (Beta)**, then restart Homebridge. The per-device Matter option only appears when the relevant bridge has Matter enabled.
|
|
104
|
+
3. **Pair the vacuum.** Reopen the settings page — a pairing panel with a QR code, the manual pairing code and the commissioning status appears under every Matter-selected device (each device is its own Matter node with its **own** pairing code). In Apple Home choose **Add Accessory** and scan the QR code. Expect the **"Uncertified Accessory"** warning (press _Add Anyway_) and a generic **"Matter Accessory"** name — when asked for a name, type the device name shown in the pairing panel.
|
|
105
|
+
4. **Try it.** Start/stop from the accessory tile, pick rooms (iOS 18.4+) before starting for a room clean, and use the dock control to send it home.
|
|
106
|
+
5. **Optional — scene buttons.** The scene buttons live on the plugin's **own Matter bridge**, which is a separate pairing from the vacuum. Scroll to the bottom of the device list on the settings page and scan the additional bridge QR code to add them. Scene list changes are picked up on the next Homebridge restart.
|
|
107
|
+
|
|
108
|
+
Pairing is one-time per node — switching a device between HAP and Matter later does **not** require re-pairing, but note that **changing a device's protocol re-creates the accessory**, so room and automation assignments in your home app are lost and must be re-organized.
|
|
109
|
+
|
|
110
|
+
#### Known limitations
|
|
111
|
+
|
|
112
|
+
- **Apple Home compatibility is immature** — see the warning at the top of this section. Treat this as a beta and expect to occasionally re-pair or restart Homebridge after controller/iOS updates.
|
|
113
|
+
- The device always pairs as a generic, uncertified **"Matter Accessory"**: controllers look the bridge's test vendor ID up in the certification database and ignore the name the device advertises, so the name must be entered manually (the pairing panel shows what to type).
|
|
114
|
+
- Scene buttons require the **separate bridge pairing** (step 5) and appear as plain on/off switches in the controller.
|
|
115
|
+
- Multi-floor maps are not exposed (rooms come from the currently active map), and zone cleaning, consumables and dock controls are not available over Matter yet.
|
|
75
116
|
|
|
76
117
|
## Current Room → MQTT (optional telemetry)
|
|
77
118
|
|
package/config.schema.json
CHANGED
|
@@ -30,6 +30,16 @@
|
|
|
30
30
|
"type": "string",
|
|
31
31
|
"description": "Roborock device IDs to exclude from HomeKit."
|
|
32
32
|
},
|
|
33
|
+
"matterDevices": {
|
|
34
|
+
"title": "Matter Device IDs",
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Roborock device IDs to publish over Matter instead of HAP. Requires Homebridge 2.x with Matter enabled; ignored otherwise."
|
|
37
|
+
},
|
|
38
|
+
"matterSceneDevices": {
|
|
39
|
+
"title": "Matter Scene Button Device IDs",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Matter device IDs whose Roborock scenes are bridged as Matter buttons. When omitted, scene buttons are enabled for every Matter device."
|
|
42
|
+
},
|
|
33
43
|
"baseURL": {
|
|
34
44
|
"type": "string",
|
|
35
45
|
"default": "https://usiot.roborock.com",
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Base Matter Accessory Class
|
|
4
|
+
*
|
|
5
|
+
* Provides common functionality for all Matter devices.
|
|
6
|
+
* Based on @homebridge-plugins/homebridge-matter implementation.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BaseMatterAccessory = void 0;
|
|
10
|
+
/**
|
|
11
|
+
* Base class for all Matter accessories
|
|
12
|
+
* Implements the MatterAccessory interface and provides common methods
|
|
13
|
+
*/
|
|
14
|
+
class BaseMatterAccessory {
|
|
15
|
+
constructor(api, log, config) {
|
|
16
|
+
this.api = api;
|
|
17
|
+
this.log = log;
|
|
18
|
+
// Set all required properties
|
|
19
|
+
this.UUID = config.UUID;
|
|
20
|
+
this.displayName = config.displayName;
|
|
21
|
+
this.deviceType = config.deviceType;
|
|
22
|
+
this.serialNumber = config.serialNumber;
|
|
23
|
+
this.manufacturer = config.manufacturer;
|
|
24
|
+
this.model = config.model;
|
|
25
|
+
this.firmwareRevision = config.firmwareRevision;
|
|
26
|
+
this.hardwareRevision = config.hardwareRevision;
|
|
27
|
+
this.clusters = config.clusters;
|
|
28
|
+
this.handlers = config.handlers;
|
|
29
|
+
this.parts = config.parts;
|
|
30
|
+
// Set context with all metadata
|
|
31
|
+
this.context = {
|
|
32
|
+
serialNumber: this.serialNumber,
|
|
33
|
+
manufacturer: this.manufacturer,
|
|
34
|
+
model: this.model,
|
|
35
|
+
firmwareRevision: this.firmwareRevision,
|
|
36
|
+
hardwareRevision: this.hardwareRevision,
|
|
37
|
+
...config.context,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Update the accessory state
|
|
42
|
+
* Helper method to update cluster attributes
|
|
43
|
+
*/
|
|
44
|
+
async updateState(cluster, attributes, partId) {
|
|
45
|
+
const matter = this.api.matter;
|
|
46
|
+
if (!matter) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
await matter.updateAccessoryState(this.UUID, cluster, attributes, partId);
|
|
50
|
+
this.log.debug(`[${this.displayName}] Updated ${cluster} state:`, attributes);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Log helper methods
|
|
54
|
+
*/
|
|
55
|
+
logInfo(message, ...args) {
|
|
56
|
+
this.log.info(`[${this.displayName}] ${message}`, ...args);
|
|
57
|
+
}
|
|
58
|
+
logError(message, ...args) {
|
|
59
|
+
this.log.error(`[${this.displayName}] ${message}`, ...args);
|
|
60
|
+
}
|
|
61
|
+
logDebug(message, ...args) {
|
|
62
|
+
this.log.debug(`[${this.displayName}] ${message}`, ...args);
|
|
63
|
+
}
|
|
64
|
+
logWarn(message, ...args) {
|
|
65
|
+
this.log.warn(`[${this.displayName}] ${message}`, ...args);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Convert this class instance to a plain MatterAccessory object
|
|
69
|
+
* This is what gets registered with Homebridge
|
|
70
|
+
*/
|
|
71
|
+
toAccessory() {
|
|
72
|
+
return {
|
|
73
|
+
UUID: this.UUID,
|
|
74
|
+
displayName: this.displayName,
|
|
75
|
+
deviceType: this.deviceType,
|
|
76
|
+
serialNumber: this.serialNumber,
|
|
77
|
+
manufacturer: this.manufacturer,
|
|
78
|
+
model: this.model,
|
|
79
|
+
firmwareRevision: this.firmwareRevision,
|
|
80
|
+
hardwareRevision: this.hardwareRevision,
|
|
81
|
+
context: this.context,
|
|
82
|
+
clusters: this.clusters,
|
|
83
|
+
handlers: this.handlers,
|
|
84
|
+
parts: this.parts,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.BaseMatterAccessory = BaseMatterAccessory;
|
|
89
|
+
//# sourceMappingURL=base_matter_accessory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base_matter_accessory.js","sourceRoot":"","sources":["../src/base_matter_accessory.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAmBH;;;GAGG;AACH,MAAsB,mBAAmB;IAmBvC,YACE,GAAQ,EACR,GAAW,EACX,MAAiC;QAEjC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QAEf,8BA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