matterbridge-roborock-vacuum-plugin-regions 1.1.1-jb.1
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/.github/workflows/build.yml +56 -0
- package/.github/workflows/coverage.yml +59 -0
- package/.github/workflows/publish.yml +37 -0
- package/.tarignore +5 -0
- package/CHANGELOG.md +62 -0
- package/LICENSE +202 -0
- package/README.md +135 -0
- package/README_CLEANMODE.md +29 -0
- package/README_DEV.md +75 -0
- package/README_REPORT_ISSUE.md +34 -0
- package/README_SUPPORTED.md +67 -0
- package/dist/behaviorFactory.js +26 -0
- package/dist/behaviors/BehaviorDeviceGeneric.js +22 -0
- package/dist/behaviors/roborock.vacuum/default/default.js +183 -0
- package/dist/behaviors/roborock.vacuum/default/initalData.js +143 -0
- package/dist/behaviors/roborock.vacuum/default/runtimes.js +21 -0
- package/dist/behaviors/roborock.vacuum/smart/initalData.js +18 -0
- package/dist/behaviors/roborock.vacuum/smart/runtimes.js +11 -0
- package/dist/behaviors/roborock.vacuum/smart/smart.js +119 -0
- package/dist/clientManager.js +17 -0
- package/dist/helper.js +76 -0
- package/dist/index.js +4 -0
- package/dist/initialData/getBatteryStatus.js +24 -0
- package/dist/initialData/getOperationalStates.js +82 -0
- package/dist/initialData/getSupportedAreas.js +120 -0
- package/dist/initialData/getSupportedCleanModes.js +17 -0
- package/dist/initialData/getSupportedRunModes.js +11 -0
- package/dist/initialData/getSupportedScenes.js +26 -0
- package/dist/initialData/index.js +6 -0
- package/dist/model/CloudMessageModel.js +1 -0
- package/dist/model/DockingStationStatus.js +26 -0
- package/dist/model/ExperimentalFeatureSetting.js +30 -0
- package/dist/model/RoomMap.js +19 -0
- package/dist/model/roomIndexMap.js +21 -0
- package/dist/notifyMessageTypes.js +9 -0
- package/dist/platform.js +312 -0
- package/dist/platformRunner.js +90 -0
- package/dist/roborockCommunication/RESTAPI/roborockAuthenticateApi.js +213 -0
- package/dist/roborockCommunication/RESTAPI/roborockIoTApi.js +95 -0
- package/dist/roborockCommunication/Zenum/additionalPropCode.js +4 -0
- package/dist/roborockCommunication/Zenum/authenticateResponseCode.js +7 -0
- package/dist/roborockCommunication/Zenum/dockType.js +4 -0
- package/dist/roborockCommunication/Zenum/operationStatusCode.js +44 -0
- package/dist/roborockCommunication/Zenum/vacuumAndDockErrorCode.js +68 -0
- package/dist/roborockCommunication/Zmodel/apiResponse.js +1 -0
- package/dist/roborockCommunication/Zmodel/authenticateFlowState.js +1 -0
- package/dist/roborockCommunication/Zmodel/authenticateResponse.js +1 -0
- package/dist/roborockCommunication/Zmodel/baseURL.js +1 -0
- package/dist/roborockCommunication/Zmodel/batteryMessage.js +1 -0
- package/dist/roborockCommunication/Zmodel/device.js +1 -0
- package/dist/roborockCommunication/Zmodel/deviceModel.js +28 -0
- package/dist/roborockCommunication/Zmodel/deviceSchema.js +1 -0
- package/dist/roborockCommunication/Zmodel/deviceStatus.js +22 -0
- package/dist/roborockCommunication/Zmodel/dockInfo.js +6 -0
- package/dist/roborockCommunication/Zmodel/home.js +1 -0
- package/dist/roborockCommunication/Zmodel/homeInfo.js +1 -0
- package/dist/roborockCommunication/Zmodel/map.js +1 -0
- package/dist/roborockCommunication/Zmodel/mapInfo.js +29 -0
- package/dist/roborockCommunication/Zmodel/messageResult.js +7 -0
- package/dist/roborockCommunication/Zmodel/multipleMap.js +1 -0
- package/dist/roborockCommunication/Zmodel/networkInfo.js +1 -0
- package/dist/roborockCommunication/Zmodel/product.js +1 -0
- package/dist/roborockCommunication/Zmodel/room.js +1 -0
- package/dist/roborockCommunication/Zmodel/roomInfo.js +22 -0
- package/dist/roborockCommunication/Zmodel/scene.js +16 -0
- package/dist/roborockCommunication/Zmodel/userData.js +1 -0
- package/dist/roborockCommunication/Zmodel/vacuumError.js +27 -0
- package/dist/roborockCommunication/broadcast/abstractClient.js +55 -0
- package/dist/roborockCommunication/broadcast/client/LocalNetworkClient.js +174 -0
- package/dist/roborockCommunication/broadcast/client/LocalNetworkUDPClient.js +129 -0
- package/dist/roborockCommunication/broadcast/client/MQTTClient.js +139 -0
- package/dist/roborockCommunication/broadcast/client.js +1 -0
- package/dist/roborockCommunication/broadcast/clientRouter.js +82 -0
- package/dist/roborockCommunication/broadcast/listener/abstractConnectionListener.js +1 -0
- package/dist/roborockCommunication/broadcast/listener/abstractMessageHandler.js +1 -0
- package/dist/roborockCommunication/broadcast/listener/abstractMessageListener.js +1 -0
- package/dist/roborockCommunication/broadcast/listener/implementation/chainedConnectionListener.js +26 -0
- package/dist/roborockCommunication/broadcast/listener/implementation/chainedMessageListener.js +11 -0
- package/dist/roborockCommunication/broadcast/listener/implementation/connectionStateListener.js +43 -0
- package/dist/roborockCommunication/broadcast/listener/implementation/generalSyncMessageListener.js +28 -0
- package/dist/roborockCommunication/broadcast/listener/implementation/simpleMessageListener.js +27 -0
- package/dist/roborockCommunication/broadcast/listener/implementation/syncMessageListener.js +33 -0
- package/dist/roborockCommunication/broadcast/listener/index.js +1 -0
- package/dist/roborockCommunication/broadcast/messageProcessor.js +148 -0
- package/dist/roborockCommunication/broadcast/model/contentMessage.js +1 -0
- package/dist/roborockCommunication/broadcast/model/dps.js +1 -0
- package/dist/roborockCommunication/broadcast/model/headerMessage.js +1 -0
- package/dist/roborockCommunication/broadcast/model/messageContext.js +37 -0
- package/dist/roborockCommunication/broadcast/model/protocol.js +28 -0
- package/dist/roborockCommunication/broadcast/model/requestMessage.js +38 -0
- package/dist/roborockCommunication/broadcast/model/responseMessage.js +14 -0
- package/dist/roborockCommunication/helper/chunkBuffer.js +17 -0
- package/dist/roborockCommunication/helper/cryptoHelper.js +23 -0
- package/dist/roborockCommunication/helper/messageDeserializer.js +98 -0
- package/dist/roborockCommunication/helper/messageSerializer.js +84 -0
- package/dist/roborockCommunication/helper/nameDecoder.js +66 -0
- package/dist/roborockCommunication/helper/sequence.js +16 -0
- package/dist/roborockCommunication/index.js +13 -0
- package/dist/roborockService.js +494 -0
- package/dist/runtimes/handleCloudMessage.js +110 -0
- package/dist/runtimes/handleHomeDataMessage.js +57 -0
- package/dist/runtimes/handleLocalMessage.js +169 -0
- package/dist/rvc.js +51 -0
- package/dist/settings.js +1 -0
- package/dist/share/function.js +93 -0
- package/dist/share/runtimeHelper.js +17 -0
- package/dist/tests/testData/mockData.js +359 -0
- package/eslint.config.js +80 -0
- package/jest.config.js +22 -0
- package/jest.setup.js +2 -0
- package/logo.png +0 -0
- package/matterbridge-roborock-vacuum-plugin.config.json +46 -0
- package/matterbridge-roborock-vacuum-plugin.schema.json +293 -0
- package/misc/status.md +119 -0
- package/package.json +111 -0
- package/prettier.config.js +49 -0
- package/screenshot/IMG_1.PNG +0 -0
- package/screenshot/IMG_2.PNG +0 -0
- package/screenshot/IMG_3.PNG +0 -0
- package/screenshot/IMG_4.PNG +0 -0
- package/screenshot/IMG_5.PNG +0 -0
- package/screenshot/IMG_6.PNG +0 -0
- package/screenshot/IMG_7.PNG +0 -0
- package/src/behaviorFactory.ts +41 -0
- package/src/behaviors/BehaviorDeviceGeneric.ts +31 -0
- package/src/behaviors/roborock.vacuum/default/default.ts +238 -0
- package/src/behaviors/roborock.vacuum/default/initalData.ts +152 -0
- package/src/behaviors/roborock.vacuum/default/runtimes.ts +23 -0
- package/src/behaviors/roborock.vacuum/smart/initalData.ts +20 -0
- package/src/behaviors/roborock.vacuum/smart/runtimes.ts +15 -0
- package/src/behaviors/roborock.vacuum/smart/smart.ts +159 -0
- package/src/clientManager.ts +23 -0
- package/src/helper.ts +97 -0
- package/src/index.ts +16 -0
- package/src/initialData/getBatteryStatus.ts +26 -0
- package/src/initialData/getOperationalStates.ts +94 -0
- package/src/initialData/getSupportedAreas.ts +162 -0
- package/src/initialData/getSupportedCleanModes.ts +22 -0
- package/src/initialData/getSupportedRunModes.ts +14 -0
- package/src/initialData/getSupportedScenes.ts +32 -0
- package/src/initialData/index.ts +6 -0
- package/src/model/CloudMessageModel.ts +11 -0
- package/src/model/DockingStationStatus.ts +41 -0
- package/src/model/ExperimentalFeatureSetting.ts +77 -0
- package/src/model/RoomMap.ts +38 -0
- package/src/model/roomIndexMap.ts +26 -0
- package/src/notifyMessageTypes.ts +8 -0
- package/src/platform.ts +424 -0
- package/src/platformRunner.ts +103 -0
- package/src/roborockCommunication/RESTAPI/roborockAuthenticateApi.ts +302 -0
- package/src/roborockCommunication/RESTAPI/roborockIoTApi.ts +107 -0
- package/src/roborockCommunication/Zenum/additionalPropCode.ts +3 -0
- package/src/roborockCommunication/Zenum/authenticateResponseCode.ts +6 -0
- package/src/roborockCommunication/Zenum/dockType.ts +3 -0
- package/src/roborockCommunication/Zenum/operationStatusCode.ts +43 -0
- package/src/roborockCommunication/Zenum/vacuumAndDockErrorCode.ts +68 -0
- package/src/roborockCommunication/Zmodel/apiResponse.ts +3 -0
- package/src/roborockCommunication/Zmodel/authenticateFlowState.ts +6 -0
- package/src/roborockCommunication/Zmodel/authenticateResponse.ts +5 -0
- package/src/roborockCommunication/Zmodel/baseURL.ts +5 -0
- package/src/roborockCommunication/Zmodel/batteryMessage.ts +16 -0
- package/src/roborockCommunication/Zmodel/device.ts +50 -0
- package/src/roborockCommunication/Zmodel/deviceModel.ts +27 -0
- package/src/roborockCommunication/Zmodel/deviceSchema.ts +8 -0
- package/src/roborockCommunication/Zmodel/deviceStatus.ts +30 -0
- package/src/roborockCommunication/Zmodel/dockInfo.ts +9 -0
- package/src/roborockCommunication/Zmodel/home.ts +13 -0
- package/src/roborockCommunication/Zmodel/homeInfo.ts +5 -0
- package/src/roborockCommunication/Zmodel/map.ts +20 -0
- package/src/roborockCommunication/Zmodel/mapInfo.ts +54 -0
- package/src/roborockCommunication/Zmodel/messageResult.ts +75 -0
- package/src/roborockCommunication/Zmodel/multipleMap.ts +8 -0
- package/src/roborockCommunication/Zmodel/networkInfo.ts +7 -0
- package/src/roborockCommunication/Zmodel/product.ts +9 -0
- package/src/roborockCommunication/Zmodel/room.ts +4 -0
- package/src/roborockCommunication/Zmodel/roomInfo.ts +30 -0
- package/src/roborockCommunication/Zmodel/scene.ts +44 -0
- package/src/roborockCommunication/Zmodel/userData.ts +26 -0
- package/src/roborockCommunication/Zmodel/vacuumError.ts +35 -0
- package/src/roborockCommunication/broadcast/abstractClient.ts +80 -0
- package/src/roborockCommunication/broadcast/client/LocalNetworkClient.ts +218 -0
- package/src/roborockCommunication/broadcast/client/LocalNetworkUDPClient.ts +157 -0
- package/src/roborockCommunication/broadcast/client/MQTTClient.ts +174 -0
- package/src/roborockCommunication/broadcast/client.ts +19 -0
- package/src/roborockCommunication/broadcast/clientRouter.ts +104 -0
- package/src/roborockCommunication/broadcast/listener/abstractConnectionListener.ts +6 -0
- package/src/roborockCommunication/broadcast/listener/abstractMessageHandler.ts +11 -0
- package/src/roborockCommunication/broadcast/listener/abstractMessageListener.ts +5 -0
- package/src/roborockCommunication/broadcast/listener/implementation/chainedConnectionListener.ts +33 -0
- package/src/roborockCommunication/broadcast/listener/implementation/chainedMessageListener.ts +16 -0
- package/src/roborockCommunication/broadcast/listener/implementation/connectionStateListener.ts +57 -0
- package/src/roborockCommunication/broadcast/listener/implementation/generalSyncMessageListener.ts +38 -0
- package/src/roborockCommunication/broadcast/listener/implementation/simpleMessageListener.ts +37 -0
- package/src/roborockCommunication/broadcast/listener/implementation/syncMessageListener.ts +50 -0
- package/src/roborockCommunication/broadcast/listener/index.ts +3 -0
- package/src/roborockCommunication/broadcast/messageProcessor.ts +184 -0
- package/src/roborockCommunication/broadcast/model/contentMessage.ts +5 -0
- package/src/roborockCommunication/broadcast/model/dps.ts +19 -0
- package/src/roborockCommunication/broadcast/model/headerMessage.ts +7 -0
- package/src/roborockCommunication/broadcast/model/messageContext.ts +53 -0
- package/src/roborockCommunication/broadcast/model/protocol.ts +28 -0
- package/src/roborockCommunication/broadcast/model/requestMessage.ts +51 -0
- package/src/roborockCommunication/broadcast/model/responseMessage.ts +19 -0
- package/src/roborockCommunication/helper/chunkBuffer.ts +18 -0
- package/src/roborockCommunication/helper/cryptoHelper.ts +30 -0
- package/src/roborockCommunication/helper/messageDeserializer.ts +119 -0
- package/src/roborockCommunication/helper/messageSerializer.ts +101 -0
- package/src/roborockCommunication/helper/nameDecoder.ts +78 -0
- package/src/roborockCommunication/helper/sequence.ts +18 -0
- package/src/roborockCommunication/index.ts +25 -0
- package/src/roborockService.ts +657 -0
- package/src/runtimes/handleCloudMessage.ts +134 -0
- package/src/runtimes/handleHomeDataMessage.ts +67 -0
- package/src/runtimes/handleLocalMessage.ts +209 -0
- package/src/rvc.ts +97 -0
- package/src/settings.ts +1 -0
- package/src/share/function.ts +103 -0
- package/src/share/runtimeHelper.ts +23 -0
- package/src/tests/behaviors/roborock.vacuum/default/default.test.ts +134 -0
- package/src/tests/behaviors/roborock.vacuum/smart/runtimes.test.ts +64 -0
- package/src/tests/behaviors/roborock.vacuum/smart/smart.test.ts +215 -0
- package/src/tests/helper.test.ts +162 -0
- package/src/tests/initialData/getSupportedAreas.test.ts +181 -0
- package/src/tests/model/DockingStationStatus.test.ts +39 -0
- package/src/tests/platformRunner.test.ts +188 -0
- package/src/tests/platformRunner2.test.ts +228 -0
- package/src/tests/platformRunner3.test.ts +46 -0
- package/src/tests/roborockCommunication/RESTAPI/roborockAuthenticateApi.test.ts +144 -0
- package/src/tests/roborockCommunication/RESTAPI/roborockIoTApi.test.ts +106 -0
- package/src/tests/roborockCommunication/broadcast/client/LocalNetworkClient.test.ts +189 -0
- package/src/tests/roborockCommunication/broadcast/client/MQTTClient.test.ts +208 -0
- package/src/tests/roborockCommunication/broadcast/clientRouter.test.ts +168 -0
- package/src/tests/roborockCommunication/broadcast/listener/implementation/chainedConnectionListener.test.ts +59 -0
- package/src/tests/roborockCommunication/broadcast/listener/implementation/chainedMessageListener.test.ts +46 -0
- package/src/tests/roborockCommunication/broadcast/listener/implementation/simpleMessageListener.test.ts +71 -0
- package/src/tests/roborockCommunication/broadcast/listener/implementation/syncMessageListener.test.ts +86 -0
- package/src/tests/roborockCommunication/broadcast/messageProcessor.test.ts +126 -0
- package/src/tests/roborockService.setSelectedAreas.test.ts +61 -0
- package/src/tests/roborockService.test.ts +517 -0
- package/src/tests/roborockService2.test.ts +69 -0
- package/src/tests/roborockService3.test.ts +133 -0
- package/src/tests/roborockService4.test.ts +76 -0
- package/src/tests/roborockService5.test.ts +79 -0
- package/src/tests/runtimes/handleCloudMessage.test.ts +200 -0
- package/src/tests/runtimes/handleHomeDataMessage.test.ts +54 -0
- package/src/tests/runtimes/handleLocalMessage.test.ts +227 -0
- package/src/tests/testData/mockData.ts +370 -0
- package/src/tests/testData/mockHomeData-a187.json +286 -0
- package/tsconfig.jest.json +21 -0
- package/tsconfig.json +37 -0
- package/tsconfig.production.json +19 -0
- package/tslint.json +9 -0
- package/web-for-testing/README.md +47 -0
- package/web-for-testing/nodemon.json +7 -0
- package/web-for-testing/package-lock.json +6600 -0
- package/web-for-testing/package.json +36 -0
- package/web-for-testing/src/app.ts +194 -0
- package/web-for-testing/tsconfig-ext.json +19 -0
- package/web-for-testing/tsconfig.json +23 -0
- package/web-for-testing/views/index.ejs +172 -0
- package/web-for-testing/watch.mjs +93 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Build, lint and test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
node-version: [20.x, 22.x, 24.x]
|
|
17
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Cancel Previous Runs
|
|
21
|
+
uses: styfle/cancel-workflow-action@0.12.0
|
|
22
|
+
with:
|
|
23
|
+
access_token: ${{ github.token }}
|
|
24
|
+
|
|
25
|
+
- name: Checkout code
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
29
|
+
uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version: ${{ matrix.node-version }}
|
|
32
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
33
|
+
|
|
34
|
+
- name: Clean cache
|
|
35
|
+
run: npm cache clean --force
|
|
36
|
+
|
|
37
|
+
- name: Verify Node.js version
|
|
38
|
+
run: node -v
|
|
39
|
+
|
|
40
|
+
- name: Verify Npm version
|
|
41
|
+
run: npm -v
|
|
42
|
+
|
|
43
|
+
- name: Install dependencies
|
|
44
|
+
run: npm ci
|
|
45
|
+
|
|
46
|
+
- name: Install dependencies
|
|
47
|
+
run: npm run precondition && npm run deepClean && npm install && npm link matterbridge
|
|
48
|
+
|
|
49
|
+
- name: Lint the project
|
|
50
|
+
run: npm run lint
|
|
51
|
+
|
|
52
|
+
- name: Test the project
|
|
53
|
+
run: npm run test
|
|
54
|
+
|
|
55
|
+
- name: Build (optional)
|
|
56
|
+
run: npm run build
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Analyze code coverage
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- dev
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
publish:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- name: Cancel Previous Runs
|
|
15
|
+
uses: styfle/cancel-workflow-action@0.12.0
|
|
16
|
+
with:
|
|
17
|
+
access_token: ${{ github.token }}
|
|
18
|
+
|
|
19
|
+
- name: Checkout code
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Use Node.js
|
|
23
|
+
uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: '20'
|
|
26
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
27
|
+
|
|
28
|
+
- name: Clean cache
|
|
29
|
+
run: npm cache clean --force
|
|
30
|
+
|
|
31
|
+
- name: Verify Node.js version
|
|
32
|
+
run: node -v
|
|
33
|
+
|
|
34
|
+
- name: Verify Npm version
|
|
35
|
+
run: npm -v
|
|
36
|
+
|
|
37
|
+
- name: Install dependencies
|
|
38
|
+
run: npm ci
|
|
39
|
+
|
|
40
|
+
- name: Install dependencies
|
|
41
|
+
run: npm run precondition && npm run deepClean && npm install && npm link matterbridge
|
|
42
|
+
|
|
43
|
+
- name: Lint the project
|
|
44
|
+
run: npm run lint
|
|
45
|
+
|
|
46
|
+
- name: Test the project
|
|
47
|
+
run: npm run test
|
|
48
|
+
|
|
49
|
+
- name: Test with coverage
|
|
50
|
+
run: npm run test -- --coverage
|
|
51
|
+
|
|
52
|
+
- name: Upload coverage reports to Codecov
|
|
53
|
+
uses: codecov/codecov-action@v5
|
|
54
|
+
with:
|
|
55
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
56
|
+
slug: RinDevJunior/matterbridge-roborock-vacuum-plugin
|
|
57
|
+
|
|
58
|
+
- name: Build (optional)
|
|
59
|
+
run: npm run build
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- '*.*.*'
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout code
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Use Node.js
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: '20'
|
|
20
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: npm ci
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: npm run precondition && npm run deepClean && npm install && npm link matterbridge
|
|
27
|
+
|
|
28
|
+
- name: Build (optional)
|
|
29
|
+
run: npm run build
|
|
30
|
+
|
|
31
|
+
- name: Run tests
|
|
32
|
+
run: npm run test
|
|
33
|
+
|
|
34
|
+
- name: Publish to npm
|
|
35
|
+
run: npm publish
|
|
36
|
+
env:
|
|
37
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.tarignore
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## [1.1.0-rc15] - 2025-07-26
|
|
8
|
+
### Changed
|
|
9
|
+
- Refactor codebase.
|
|
10
|
+
- Correct LocalNetworkClient connecting process.
|
|
11
|
+
- Update and fix unit tests.
|
|
12
|
+
- Various lint fixes.
|
|
13
|
+
|
|
14
|
+
## [1.1.0-rc14] - 2025-07-26
|
|
15
|
+
### Added
|
|
16
|
+
- Initialize sync device status via MQTT.
|
|
17
|
+
|
|
18
|
+
## [1.1.0-rc13] - 2025-07-25
|
|
19
|
+
### Added
|
|
20
|
+
- More unit tests.
|
|
21
|
+
- Increased unit test coverage.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- Several bugs related to socket connection issues.
|
|
25
|
+
- Improve reconnect logic and cleaning status reporting.
|
|
26
|
+
|
|
27
|
+
## [1.1.0-rc11] - 2025-07-22
|
|
28
|
+
### Fixed
|
|
29
|
+
- Unable to get room from `get_room_mapping`.
|
|
30
|
+
- Can not get room from `get_multi_maps_list`.
|
|
31
|
+
|
|
32
|
+
## [1.1.0-rc10] - 2025-07-22
|
|
33
|
+
### Fixed
|
|
34
|
+
- Stop retrying to connect socket when exceeding retry count.
|
|
35
|
+
- Lint and unit test updates.
|
|
36
|
+
|
|
37
|
+
## [1.1.0-rc09] - 2025-07-20
|
|
38
|
+
### Fixed
|
|
39
|
+
- Do not re-connect MQTT unnecessarily.
|
|
40
|
+
- Reconnect when socket or MQTT is unexpectedly disconnected.
|
|
41
|
+
|
|
42
|
+
### Enhanced
|
|
43
|
+
- Save user data for subsequent logins.
|
|
44
|
+
- Unit test improvements.
|
|
45
|
+
|
|
46
|
+
## [1.1.0-rc07] - 2025-07-17
|
|
47
|
+
### Changed
|
|
48
|
+
- Enable server mode fixes.
|
|
49
|
+
- Improved error logging when plugin can't connect to device.
|
|
50
|
+
|
|
51
|
+
## [1.1.0-rc06] - 2025-07-16
|
|
52
|
+
### Fixed
|
|
53
|
+
- Can not start plugin when server mode is disabled.
|
|
54
|
+
|
|
55
|
+
## [1.1.0-rc04] - 2025-07-16
|
|
56
|
+
### Added
|
|
57
|
+
- Unit tests.
|
|
58
|
+
- GitHub Actions improvements.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
**Note:** This changelog includes only the most recent 30 commits. For the full commit history, view more on [GitHub](https://github.com/RinDevJunior/matterbridge-roborock-vacuum-plugin/commits?sort=updated&direction=desc).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./logo.png" alt="Matterbridge Roborock Platform Plugin Logo" width="64" height="64" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">Matterbridge Roborock Platform Plugin</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/matterbridge-roborock-vacuum-plugin">
|
|
9
|
+
<img src="https://img.shields.io/npm/v/matterbridge-roborock-vacuum-plugin.svg" alt="npm version" />
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/matterbridge-roborock-vacuum-plugin">
|
|
12
|
+
<img src="https://img.shields.io/npm/dt/matterbridge-roborock-vacuum-plugin.svg" alt="npm downloads" />
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://github.com/RinDevJunior/matterbridge-roborock-vacuum-plugin/actions/workflows/publish.yml/badge.svg">
|
|
15
|
+
<img src="https://github.com/RinDevJunior/matterbridge-roborock-vacuum-plugin/actions/workflows/publish.yml/badge.svg" alt="nodejs ci" />
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://codecov.io/gh/RinDevJunior/matterbridge-roborock-vacuum-plugin">
|
|
18
|
+
<img src="https://codecov.io/gh/RinDevJunior/matterbridge-roborock-vacuum-plugin/branch/main/graph/badge.svg" alt="codecov" />
|
|
19
|
+
</a>
|
|
20
|
+
<a href="https://www.npmjs.com/package/matterbridge">
|
|
21
|
+
<img src="https://img.shields.io/badge/powered%20by-matterbridge-blue" alt="powered by Matterbridge" />
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://www.npmjs.com/package/node-ansi-logger">
|
|
24
|
+
<img src="https://img.shields.io/badge/powered%20by-node--ansi--logger-blue" alt="powered by node-ansi-logger" />
|
|
25
|
+
</a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
**Matterbridge Roborock Platform Plugin** is a dynamic platform plugin for [Matterbridge](https://www.npmjs.com/package/matterbridge) that integrates Roborock vacuums into the Matter ecosystem, enabling control via Apple Home and other Matter-compatible apps.
|
|
31
|
+
|
|
32
|
+
> ⭐ If you find this project useful, please consider starring the repository on GitHub:
|
|
33
|
+
> [https://github.com/RinDevJunior/matterbridge-roborock-vacuum-plugin](https://github.com/RinDevJunior/matterbridge-roborock-vacuum-plugin)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### ⚠️ Important Notes
|
|
39
|
+
|
|
40
|
+
- **Matterbridge must be run in child bridge mode** for proper operation.
|
|
41
|
+
- **Use one Matterbridge instance per Roborock vacuum.**
|
|
42
|
+
If you have more than one vacuum, please run separate instances.
|
|
43
|
+
Please put the <**Vacuum name**>-<**duid**> of device you want to use into **whiteList** section in the plugin configuration popup.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
More details available here: [Discussion #264](https://github.com/Luligu/matterbridge/discussions/264)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
### 🆔 How to Get Your DUID
|
|
50
|
+
|
|
51
|
+
To get the **DUID** for your devices, you have two options:
|
|
52
|
+
|
|
53
|
+
**Option 1: From Matterbridge Logs**
|
|
54
|
+
1. **Start Matterbridge** with the plugin enabled.
|
|
55
|
+
2. **Watch the Docker console logs directly** (not the Matterbridge UI logs, as they may be truncated).
|
|
56
|
+
3. Look for the log message that says:
|
|
57
|
+
```text
|
|
58
|
+
Initializing - devices: [...]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Option 2: From the Roborock App**
|
|
62
|
+
1. Open the **Roborock app** on your phone.
|
|
63
|
+
2. Go to your **Device**.
|
|
64
|
+
3. Tap **Settings** > **Product Info**.
|
|
65
|
+
4. Find the **DID** field. The value will look like `rr_xxxxxxx`.
|
|
66
|
+
5. **Remove the `rr_` prefix** from the DID value. The remaining string is your DUID.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
### 🚧 Project Status
|
|
70
|
+
|
|
71
|
+
- **Under active development**
|
|
72
|
+
- Requires **`matterbridge@3.1.7`**
|
|
73
|
+
- ⚠️ **Known Issue:**
|
|
74
|
+
+ Vacuum may appear as **two devices** in Apple Home
|
|
75
|
+
+ Error: Wrong CRC32 2241274590, expected 0 -> this is normal error and not impact to plugin functionality
|
|
76
|
+
+
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### ➡️ [See Supported & Tested Roborock Devices](./README_SUPPORTED.md)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
📋 **Apple Home ↔️ Roborock Clean Mode Mapping:**
|
|
85
|
+
For a detailed table of how Apple Home clean modes map to Roborock settings, see 👉 [Apple Home ↔️ Roborock Clean Mode Mapping](./README_CLEANMODE.md)
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### 📦 Prerequisites
|
|
90
|
+
|
|
91
|
+
- A working installation of [Matterbridge](https://github.com/Luligu/matterbridge)
|
|
92
|
+
- Compatible Roborock vacuum model (not all models supported yet)
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### ⚙️ Matterbridge setting
|
|
97
|
+
|
|
98
|
+
<div align="center">
|
|
99
|
+
<img src="./screenshot/IMG_6.PNG" alt="Matterbridge Configuration Screenshot" style="border-radius: 8px; max-width: 100%; box-shadow: 0 4px 12px rgba(0,0,0,0.1);" />
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### 💬 Need Help?
|
|
105
|
+
|
|
106
|
+
🛠️ **Reporting an Issue**
|
|
107
|
+
Before opening an issue, please make sure to read the instructions here:
|
|
108
|
+
[📄 How to Report an Issue](./README_REPORT_ISSUE.md)
|
|
109
|
+
|
|
110
|
+
💬 **Community Support**
|
|
111
|
+
Join our Discord for support, updates, and community discussions:
|
|
112
|
+
👉 [Join the Matterbridge Roborock Discord](https://discord.gg/favqExHGn4)
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
### 🧱 Built With
|
|
117
|
+
|
|
118
|
+
This plugin is built on top of the official dynamic platform example:
|
|
119
|
+
🔗 [matterbridge-example-dynamic-platform](https://github.com/Luligu/matterbridge-example-dynamic-platform)
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### 📸 Screenshot
|
|
124
|
+
|
|
125
|
+
<p align="center">
|
|
126
|
+
<img src="./screenshot/IMG_1.PNG" alt="Screenshot1" width="292" height="633" />
|
|
127
|
+
<img src="./screenshot/IMG_2.PNG" alt="Screenshot2" width="292" height="633" />
|
|
128
|
+
</p>
|
|
129
|
+
<p align="center">
|
|
130
|
+
<img src="./screenshot/IMG_3.PNG" alt="Screenshot3" width="292" height="633" />
|
|
131
|
+
<img src="./screenshot/IMG_4.PNG" alt="Screenshot4" width="292" height="633" />
|
|
132
|
+
</p>
|
|
133
|
+
<p align="center">
|
|
134
|
+
<img src="./screenshot/IMG_5.PNG" alt="Screenshot5" width="292" height="633" />
|
|
135
|
+
</p>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Apple Home RVC Clean Mode Mapping to Roborock Clean Setting
|
|
2
|
+
|
|
3
|
+
This table shows the mapping between **Apple Home RVC Clean Modes** and the corresponding **Roborock Clean Settings** as defined in `smart.ts` and `default.ts`.
|
|
4
|
+
|
|
5
|
+
| Apple Home RVC Clean Mode (Key) | Apple Home Mode Name | Roborock Clean Mode | suctionPower (enum value) | waterFlow (enum value) | distance_off | mopRoute (enum value) |
|
|
6
|
+
|:-------------------------------:|:-----------------------------|:--------------------|:--------------------------|:----------------------|:------------:|:---------------------:|
|
|
7
|
+
| 4 *(smart only)* | Mop & Vacuum: Automatic | Smart Plan | 0 | 0 | 0 | Smart (306) |
|
|
8
|
+
| 5 | Mop & Vacuum: Day (Automatic)| Vac & Mop | Balanced (102) | Medium (202) | 0 | Standard (300) |
|
|
9
|
+
| 6 | Mop & Vacuum: Quick | Vac & Mop | Balanced (102) | Medium (202) | 0 | Fast (304) |
|
|
10
|
+
| 7 | Mop & Vacuum: Max | Vac & Mop | Max (104) | Medium (202) | 0 | Standard (300) |
|
|
11
|
+
| 8 | Mop & Vacuum: Min | Vac & Mop | Balanced (102) | Low (201) | 0 | Standard (300) |
|
|
12
|
+
| 9 | Mop & Vacuum: Quiet | Vac & Mop | Quiet (101) | Medium (202) | 0 | Standard (300) |
|
|
13
|
+
| 10 | Mop & Vacuum: LowEnergy | Custom | Custom (106) | Custom (204) | 0 | Custom (302) |
|
|
14
|
+
| 31 | Mop: Default | Mop | Off (105) | Medium (202) | 0 | Standard (300) |
|
|
15
|
+
| 32 | Mop: Max | Mop | Off (105) | High (203) | 0 | Standard (300) |
|
|
16
|
+
| 33 | Mop: Min | Mop | Off (105) | Low (201) | 0 | Standard (300) |
|
|
17
|
+
| 34 | Mop: Quick | Mop | Off (105) | Medium (202) | 0 | Fast (304) |
|
|
18
|
+
| 35 | Mop: DeepClean | Mop | Off (105) | Medium (202) | 0 | Deep (301) |
|
|
19
|
+
| 66 | Vacuum: Default | Vacuum | Balanced (102) | Off (200) | 0 | Standard (300) |
|
|
20
|
+
| 67 | Vacuum: Max | Vacuum | Max (104) | Off (200) | 0 | Standard (300) |
|
|
21
|
+
| 68 | Vacuum: Quiet | Vacuum | Quiet (101) | Off (200) | 0 | Standard (300) |
|
|
22
|
+
| 69 | Vacuum: Quick | Vacuum | Balanced (102) | Off (200) | 0 | Fast (304) |
|
|
23
|
+
| 99 | Mop & Vacuum: Vacation | | | | | |
|
|
24
|
+
|
|
25
|
+
**Notes:**
|
|
26
|
+
- The values in parentheses are enum values from `VacuumSuctionPowerSmart`/`VacuumSuctionPower`, `MopWaterFlowSmart`/`MopWaterFlow`, and `MopRouteSmart`/`MopRoute` in `smart.ts` and `default.ts`.
|
|
27
|
+
- Key 4 ("Smart Plan") is only available on some new vacuums.
|
|
28
|
+
- This mapping helps you understand how Apple Home clean modes correspond to Roborock's internal cleaning settings for both "smart" and "default" behaviors.
|
|
29
|
+
- Key 99 is a tricky mode to support go to charge in Apple Home Automation
|
package/README_DEV.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# How to Implement a New Device
|
|
2
|
+
|
|
3
|
+
Follow these steps to add support for a new device:
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
## 0. Precondition
|
|
7
|
+
- Matterbridge must be run at childbridge mode
|
|
8
|
+
|
|
9
|
+
## 1. Check the Model
|
|
10
|
+
|
|
11
|
+
- Open [`src/roborockCommunication/Zmodel/deviceModel.ts`](src/roborockCommunication/Zmodel/deviceModel.ts).
|
|
12
|
+
- If your model does not exist, **create a new entry** for it.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 2. Create a New Behavior Folder
|
|
17
|
+
|
|
18
|
+
- Create a new folder under [`src/behaviors/roborock.vacuum`](src/behaviors/roborock.vacuum) named after the market name of your vacuum.
|
|
19
|
+
- Inside this folder:
|
|
20
|
+
- **Create a `initalData.ts` file**
|
|
21
|
+
_Example:_ [`src/behaviors/roborock.vacuum/smart/initalData.ts`](src/behaviors/roborock.vacuum/smart/initalData.ts)
|
|
22
|
+
This file defines functions that return initial data for your device. (You can inherit from default or create your own)
|
|
23
|
+
- **Create an `runtimes.ts` file**
|
|
24
|
+
_Example:_ [`src/behaviors/roborock.vacuum/smart/runtimes.ts`](src/behaviors/roborock.vacuum/smart/runtimes.ts)
|
|
25
|
+
In case you define your own initial data. Create new method that override the default method.
|
|
26
|
+
- **Create an `abcyxz.ts` file**
|
|
27
|
+
_Example:_ [`src/behaviors/roborock.vacuum/smart/smart.ts`](src/behaviors/roborock.vacuum/smart/smart.ts)
|
|
28
|
+
Define matterbridge command handler logic to sending requests to control your vacuum (start, pause, resume, go home, etc.).
|
|
29
|
+
(Use in step 4)
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 3. Register Your Initial Functions
|
|
34
|
+
|
|
35
|
+
- Add your initial functions to the following files:
|
|
36
|
+
- [`src/initialData/getSupportedCleanModes.ts`](src/initialData/getSupportedCleanModes.ts)
|
|
37
|
+
- [`src/initialData/getSupportedRunModes.ts`](src/initialData/getSupportedRunModes.ts)
|
|
38
|
+
- [`src/initialData/getOperationalStates.ts`](src/initialData/getOperationalStates.ts)
|
|
39
|
+
|
|
40
|
+
***_In somecase, you may need to update whole function to support switch case_***
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 4. Update the Behavior Factory
|
|
44
|
+
|
|
45
|
+
- Add a new `switch` case to [`src/behaviorFactory.ts`](src/behaviorFactory.ts).
|
|
46
|
+
- This is where you set the behavior handler for your device.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 5. Build and Run
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
sudo npm run precondition
|
|
54
|
+
sudo npm run deepCleanBuild
|
|
55
|
+
sudo npm run matterbridge:add
|
|
56
|
+
sudo npm run start:roborock
|
|
57
|
+
```
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 6. Current issue
|
|
61
|
+
- Device show twice in Apple Home
|
|
62
|
+
- Device information shows incorrectly in Apple Home (Device name, firmware ....)
|
|
63
|
+
- Play Sound to Locate (Apple Home) not working
|
|
64
|
+
- Showing wrong location during opration
|
|
65
|
+
|
|
66
|
+
## 7. Not Tested
|
|
67
|
+
- Clean selected room
|
|
68
|
+
|
|
69
|
+
## 8. TODO
|
|
70
|
+
- correct state_to_matter_state
|
|
71
|
+
|
|
72
|
+
## 9. Build package
|
|
73
|
+
```sh
|
|
74
|
+
cd .. && tar -czvf matterbridge-roborock-vacuum-plugin-1.0.1-rc02.tgz matterbridge-roborock-vacuum-plugin && cd matterbridge-roborock-vacuum-plugin
|
|
75
|
+
```
|