@homebridge-plugins/homebridge-meross 10.14.0 → 10.15.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/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to `@homebridge-plugins/homebridge-meross` will be documented in this file.
4
4
 
5
+ ## v10.15.1 (2026-05-05)
6
+
7
+ ### Changed
8
+
9
+ - chore: dependency updates
10
+
11
+ ## v10.15.0 (2026-05-04)
12
+
13
+ ### Changed
14
+
15
+ - remove node 20 from build workflow
16
+ - feat: show/hide devices in custom ui device list (#732) (@burtherman)
17
+ - fix: fix js syntax errors in config schema file
18
+ - chore: dependency updates
19
+
5
20
  ## v10.14.0 (2026-04-09)
6
21
 
7
22
  ### Added
@@ -173,7 +173,7 @@
173
173
  "title": "Hide From HomeKit",
174
174
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
175
175
  "condition": {
176
- "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && model.singleDevices[arrayIndices].serialNumber && model.singleDevices[arrayIndices].serialNumber.length === 32 && model.singleDevices[arrayIndices].connection !== 'local' && !model.singleDevices[arrayIndices].deviceUrl);"
176
+ "functionBody": "return (model.singleDevices && model.singleDevices[arrayIndices] && model.singleDevices[arrayIndices].serialNumber && model.singleDevices[arrayIndices].serialNumber.length === 32);"
177
177
  }
178
178
  },
179
179
  "model": {
@@ -463,7 +463,7 @@
463
463
  "title": "Hide From HomeKit",
464
464
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
465
465
  "condition": {
466
- "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].serialNumber && model.multiDevices[arrayIndices].serialNumber.length === 32 && model.multiDevices[arrayIndices].connection !== 'local' && !model.multiDevices[arrayIndices].deviceUrl);"
466
+ "functionBody": "return (model.multiDevices && model.multiDevices[arrayIndices] && model.multiDevices[arrayIndices].serialNumber && model.multiDevices[arrayIndices].serialNumber.length === 32);"
467
467
  }
468
468
  },
469
469
  "model": {
@@ -687,7 +687,7 @@
687
687
  "title": "Hide From HomeKit",
688
688
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
689
689
  "condition": {
690
- "functionBody": "return (model.lightDevices && model.lightDevices[arrayIndices] && model.lightDevices[arrayIndices].serialNumber && model.lightDevices[arrayIndices].serialNumber.length === 32 && model.lightDevices[arrayIndices].connection !== 'local' && !model.lightDevices[arrayIndices].deviceUrl);"
690
+ "functionBody": "return (model.lightDevices && model.lightDevices[arrayIndices] && model.lightDevices[arrayIndices].serialNumber && model.lightDevices[arrayIndices].serialNumber.length === 32);"
691
691
  }
692
692
  },
693
693
  "model": {
@@ -930,7 +930,7 @@
930
930
  "title": "Hide From HomeKit",
931
931
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
932
932
  "condition": {
933
- "functionBody": "return (model.fanDevices && model.fanDevices[arrayIndices] && model.fanDevices[arrayIndices].serialNumber && model.fanDevices[arrayIndices].serialNumber.length === 32 && model.fanDevices[arrayIndices].connection !== 'local' && !model.fanDevices[arrayIndices].deviceUrl);"
933
+ "functionBody": "return (model.fanDevices && model.fanDevices[arrayIndices] && model.fanDevices[arrayIndices].serialNumber && model.fanDevices[arrayIndices].serialNumber.length === 32);"
934
934
  }
935
935
  },
936
936
  "model": {
@@ -1025,7 +1025,7 @@
1025
1025
  "title": "Hide From HomeKit",
1026
1026
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
1027
1027
  "condition": {
1028
- "functionBody": "return (model.diffuserDevices && model.diffuserDevices[arrayIndices] && model.diffuserDevices[arrayIndices].serialNumber && model.diffuserDevices[arrayIndices].serialNumber.length === 32 && model.diffuserDevices[arrayIndices].connection !== 'local' && !model.diffuserDevices[arrayIndices].deviceUrl);"
1028
+ "functionBody": "return (model.diffuserDevices && model.diffuserDevices[arrayIndices] && model.diffuserDevices[arrayIndices].serialNumber && model.diffuserDevices[arrayIndices].serialNumber.length === 32);"
1029
1029
  }
1030
1030
  },
1031
1031
  "model": {
@@ -1134,7 +1134,7 @@
1134
1134
  "title": "Hide From HomeKit",
1135
1135
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
1136
1136
  "condition": {
1137
- "functionBody": "return (model.purifierDevices && model.purifierDevices[arrayIndices] && model.purifierDevices[arrayIndices].serialNumber && model.purifierDevices[arrayIndices].serialNumber.length === 32 && model.purifierDevices[arrayIndices].connection !== 'local' && !model.purifierDevices[arrayIndices].deviceUrl);"
1137
+ "functionBody": "return (model.purifierDevices && model.purifierDevices[arrayIndices] && model.purifierDevices[arrayIndices].serialNumber && model.purifierDevices[arrayIndices].serialNumber.length === 32);"
1138
1138
  }
1139
1139
  },
1140
1140
  "model": {
@@ -1221,7 +1221,7 @@
1221
1221
  "type": "string",
1222
1222
  "format": "ipv4",
1223
1223
  "condition": {
1224
- "functionBody": "return (model.humidifierDevices && model.humidifierDevices[arrayIndices] && model.humidifierDevices[arrayIndices].serialNumber && model.humidifierDevices[arrayIndices].serialNumber.length === 32 && ((!model.username && !model.password && model.userkey) || (model.username && model.password && ((model.connection === 'local' && [undefined, 'local'].includes(model.humidifierDevices[arrayIndices].connection)) || || (model.connection !== 'local' && model.humidifierDevices[arrayIndices].connection === 'local')))));"
1224
+ "functionBody": "return (model.humidifierDevices && model.humidifierDevices[arrayIndices] && model.humidifierDevices[arrayIndices].serialNumber && model.humidifierDevices[arrayIndices].serialNumber.length === 32 && ((!model.username && !model.password && model.userkey) || (model.username && model.password && ((model.connection === 'local' && [undefined, 'local'].includes(model.humidifierDevices[arrayIndices].connection)) || (model.connection !== 'local' && model.humidifierDevices[arrayIndices].connection === 'local')))));"
1225
1225
  }
1226
1226
  },
1227
1227
  "ignoreDevice": {
@@ -1229,7 +1229,7 @@
1229
1229
  "title": "Hide From HomeKit",
1230
1230
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
1231
1231
  "condition": {
1232
- "functionBody": "return (model.humidifierDevices && model.humidifierDevices[arrayIndices] && model.humidifierDevices[arrayIndices].serialNumber && model.humidifierDevices[arrayIndices].serialNumber.length === 32 && model.humidifierDevices[arrayIndices].connection !== 'local' && !model.humidifierDevices[arrayIndices].deviceUrl);"
1232
+ "functionBody": "return (model.humidifierDevices && model.humidifierDevices[arrayIndices] && model.humidifierDevices[arrayIndices].serialNumber && model.humidifierDevices[arrayIndices].serialNumber.length === 32);"
1233
1233
  }
1234
1234
  },
1235
1235
  "model": {
@@ -1316,7 +1316,7 @@
1316
1316
  "type": "string",
1317
1317
  "format": "ipv4",
1318
1318
  "condition": {
1319
- "functionBody": "return (model.thermostatDevices && model.thermostatDevices[arrayIndices] && model.thermostatDevices[arrayIndices].serialNumber && model.thermostatDevices[arrayIndices].serialNumber.length === 32 && ((!model.username && !model.password && model.userkey) || (model.username && model.password && ((model.connection === 'local' && [undefined, 'local'].includes(model.thermostatDevices[arrayIndices].connection)) || || (model.connection !== 'local' && model.thermostatDevices[arrayIndices].connection === 'local')))));"
1319
+ "functionBody": "return (model.thermostatDevices && model.thermostatDevices[arrayIndices] && model.thermostatDevices[arrayIndices].serialNumber && model.thermostatDevices[arrayIndices].serialNumber.length === 32 && ((!model.username && !model.password && model.userkey) || (model.username && model.password && ((model.connection === 'local' && [undefined, 'local'].includes(model.thermostatDevices[arrayIndices].connection)) || (model.connection !== 'local' && model.thermostatDevices[arrayIndices].connection === 'local')))));"
1320
1320
  }
1321
1321
  },
1322
1322
  "ignoreDevice": {
@@ -1324,7 +1324,7 @@
1324
1324
  "title": "Hide From HomeKit",
1325
1325
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
1326
1326
  "condition": {
1327
- "functionBody": "return (model.thermostatDevices && model.thermostatDevices[arrayIndices] && model.thermostatDevices[arrayIndices].serialNumber && model.thermostatDevices[arrayIndices].serialNumber.length === 32 && model.thermostatDevices[arrayIndices].connection !== 'local' && !model.thermostatDevices[arrayIndices].deviceUrl);"
1327
+ "functionBody": "return (model.thermostatDevices && model.thermostatDevices[arrayIndices] && model.thermostatDevices[arrayIndices].serialNumber && model.thermostatDevices[arrayIndices].serialNumber.length === 32);"
1328
1328
  }
1329
1329
  },
1330
1330
  "model": {
@@ -1447,7 +1447,7 @@
1447
1447
  "title": "Hide From HomeKit",
1448
1448
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
1449
1449
  "condition": {
1450
- "functionBody": "return (model.garageDevices && model.garageDevices[arrayIndices] && model.garageDevices[arrayIndices].serialNumber && model.garageDevices[arrayIndices].serialNumber.length === 32 && model.garageDevices[arrayIndices].connection !== 'local' && !model.garageDevices[arrayIndices].deviceUrl);"
1450
+ "functionBody": "return (model.garageDevices && model.garageDevices[arrayIndices] && model.garageDevices[arrayIndices].serialNumber && model.garageDevices[arrayIndices].serialNumber.length === 32);"
1451
1451
  }
1452
1452
  },
1453
1453
  "model": {
@@ -1568,7 +1568,7 @@
1568
1568
  "title": "Hide From HomeKit",
1569
1569
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
1570
1570
  "condition": {
1571
- "functionBody": "return (model.rollerDevices && model.rollerDevices[arrayIndices] && model.rollerDevices[arrayIndices].serialNumber && model.rollerDevices[arrayIndices].serialNumber.length === 32 && model.rollerDevices[arrayIndices].connection !== 'local' && !model.rollerDevices[arrayIndices].deviceUrl);"
1571
+ "functionBody": "return (model.rollerDevices && model.rollerDevices[arrayIndices] && model.rollerDevices[arrayIndices].serialNumber && model.rollerDevices[arrayIndices].serialNumber.length === 32);"
1572
1572
  }
1573
1573
  },
1574
1574
  "model": {
@@ -1697,7 +1697,7 @@
1697
1697
  "title": "Hide From HomeKit",
1698
1698
  "description": "If true, this accessory will be removed and ignored from HomeKit.",
1699
1699
  "condition": {
1700
- "functionBody": "return (model.babyDevices && model.babyDevices[arrayIndices] && model.babyDevices[arrayIndices].serialNumber && model.babyDevices[arrayIndices].serialNumber.length === 32 && model.babyDevices[arrayIndices].connection !== 'local' && !model.babyDevices[arrayIndices].deviceUrl);"
1700
+ "functionBody": "return (model.babyDevices && model.babyDevices[arrayIndices] && model.babyDevices[arrayIndices].serialNumber && model.babyDevices[arrayIndices].serialNumber.length === 32);"
1701
1701
  }
1702
1702
  },
1703
1703
  "model": {
@@ -114,6 +114,17 @@
114
114
  <th scope="row">Firmware Version</th>
115
115
  <td id="firmware"></td>
116
116
  </tr>
117
+ <tr>
118
+ <th scope="row">Hide from HomeKit</th>
119
+ <td>
120
+ <div class="custom-control custom-checkbox">
121
+ <input type="checkbox" class="custom-control-input" id="hideDevice">
122
+ <label class="custom-control-label" for="hideDevice">
123
+ Hide this device from HomeKit
124
+ </label>
125
+ </div>
126
+ </td>
127
+ </tr>
117
128
  </tbody>
118
129
  </table>
119
130
  </div>
@@ -294,6 +305,80 @@
294
305
  document.getElementById('mac_address').innerHTML = context.macAddress || 'N/A'
295
306
  document.getElementById('hardware').innerHTML = context.hardware || 'N/A'
296
307
  document.getElementById('firmware').innerHTML = context.firmware || 'N/A'
308
+
309
+ // Handle hide device checkbox
310
+ const hideCheckbox = document.getElementById('hideDevice')
311
+ const deviceUUID = context.serialNumber.toLowerCase().replace(/[^a-z0-9]/g, '')
312
+ const deviceArrays = [
313
+ 'singleDevices', 'multiDevices', 'lightDevices', 'fanDevices',
314
+ 'diffuserDevices', 'purifierDevices', 'humidifierDevices',
315
+ 'thermostatDevices', 'garageDevices', 'rollerDevices',
316
+ 'babyDevices', 'sensorDevices',
317
+ ]
318
+ const findEntry = (cfg) => {
319
+ for (const key of deviceArrays) {
320
+ const arr = cfg[0]?.[key]
321
+ if (!Array.isArray(arr)) continue
322
+ const idx = arr.findIndex(e => e.serialNumber?.toLowerCase().replace(/[^a-z0-9]/g, '') === deviceUUID)
323
+ if (idx !== -1) return { key, idx, entry: arr[idx] }
324
+ }
325
+ return null
326
+ }
327
+
328
+ // Check if device is currently hidden
329
+ const config = await homebridge.getPluginConfig()
330
+ const existing = findEntry(config)
331
+ hideCheckbox.checked = !!existing?.entry?.ignoreDevice
332
+
333
+ // Remove previous event listeners by cloning the element
334
+ const newCheckbox = hideCheckbox.cloneNode(true)
335
+ hideCheckbox.parentNode.replaceChild(newCheckbox, hideCheckbox)
336
+
337
+ // Add event listener for checkbox changes
338
+ newCheckbox.addEventListener('change', async (e) => {
339
+ try {
340
+ homebridge.showSpinner()
341
+ const cfg = await homebridge.getPluginConfig()
342
+ const found = findEntry(cfg)
343
+
344
+ if (e.target.checked) {
345
+ if (found) {
346
+ cfg[0][found.key][found.idx].ignoreDevice = true
347
+ } else {
348
+ const arrayKey = await homebridge.request('/getDeviceConfigKey', { model: context.model })
349
+ if (!arrayKey) {
350
+ homebridge.toast.error(`Unsupported device model: ${context.model}`, 'Cannot hide device')
351
+ e.target.checked = false
352
+ homebridge.hideSpinner()
353
+ return
354
+ }
355
+ if (!Array.isArray(cfg[0][arrayKey])) {
356
+ cfg[0][arrayKey] = []
357
+ }
358
+ cfg[0][arrayKey].push({
359
+ name: thisAcc.displayName,
360
+ serialNumber: deviceUUID,
361
+ ignoreDevice: true,
362
+ })
363
+ }
364
+ homebridge.toast.success(`${thisAcc.displayName} will be hidden from HomeKit after restart`, 'Device Hidden')
365
+ } else if (found) {
366
+ cfg[0][found.key][found.idx].ignoreDevice = false
367
+ homebridge.toast.success(`${thisAcc.displayName} will be shown in HomeKit after restart`, 'Device Unhidden')
368
+ }
369
+
370
+ await homebridge.updatePluginConfig(cfg)
371
+
372
+ // Switch to Settings tab to sync the form with updated config
373
+ showSettings()
374
+ homebridge.toast.info('Please click Save to persist your changes', 'Settings Updated')
375
+ homebridge.hideSpinner()
376
+ } catch (err) {
377
+ homebridge.toast.error(err.message, 'Error')
378
+ homebridge.hideSpinner()
379
+ }
380
+ })
381
+
297
382
  document.getElementById('deviceTable').style.display = 'inline-table'
298
383
  homebridge.hideSpinner()
299
384
  }
@@ -1,8 +1,55 @@
1
1
  import { HomebridgePluginUiServer } from '@homebridge/plugin-ui-utils'
2
2
 
3
+ import platformConsts from '../utils/constants.js'
4
+
5
+ function getDeviceConfigKey(model) {
6
+ if (!model) {
7
+ return null
8
+ }
9
+ const m = platformConsts.models
10
+ if (m.switchSingle.includes(model)) {
11
+ return 'singleDevices'
12
+ }
13
+ if (Object.hasOwn(m.switchMulti, model)) {
14
+ return 'multiDevices'
15
+ }
16
+ if (m.lightDimmer.includes(model) || m.lightRGB.includes(model) || m.lightCCT.includes(model)) {
17
+ return 'lightDevices'
18
+ }
19
+ if (m.fan.includes(model)) {
20
+ return 'fanDevices'
21
+ }
22
+ if (m.diffuser.includes(model)) {
23
+ return 'diffuserDevices'
24
+ }
25
+ if (m.purifier.includes(model)) {
26
+ return 'purifierDevices'
27
+ }
28
+ if (m.humidifier.includes(model)) {
29
+ return 'humidifierDevices'
30
+ }
31
+ if (m.thermostat.includes(model)) {
32
+ return 'thermostatDevices'
33
+ }
34
+ if (m.garage.includes(model)) {
35
+ return 'garageDevices'
36
+ }
37
+ if (m.roller.includes(model)) {
38
+ return 'rollerDevices'
39
+ }
40
+ if (m.baby.includes(model)) {
41
+ return 'babyDevices'
42
+ }
43
+ if (m.sensorPresence.includes(model)) {
44
+ return 'sensorDevices'
45
+ }
46
+ return null
47
+ }
48
+
3
49
  class PluginUiServer extends HomebridgePluginUiServer {
4
50
  constructor() {
5
51
  super()
52
+ this.onRequest('/getDeviceConfigKey', ({ model }) => getDeviceConfigKey(model))
6
53
  this.ready()
7
54
  }
8
55
  }
package/lib/platform.js CHANGED
@@ -116,15 +116,16 @@ export default class {
116
116
  case 'thermostatDevices':
117
117
  if (Array.isArray(val) && val.length > 0) {
118
118
  val.forEach((x) => {
119
+ if (!(x.serialNumber && x.name)) {
120
+ logIgnoreItem(key)
121
+ return
122
+ }
119
123
  if (
120
- !(
121
- x.serialNumber
122
- && x.name
123
- && (
124
- (config.connection !== 'local' && x.connection !== 'local')
125
- || (config.connection !== 'local' && x.connection === 'local' && x.deviceUrl)
126
- || (config.connection === 'local' && x.model && x.deviceUrl)
127
- )
124
+ !x.ignoreDevice
125
+ && !(
126
+ (config.connection !== 'local' && x.connection !== 'local')
127
+ || (config.connection !== 'local' && x.connection === 'local' && x.deviceUrl)
128
+ || (config.connection === 'local' && x.model && x.deviceUrl)
128
129
  )
129
130
  ) {
130
131
  logIgnoreItem(key)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@homebridge-plugins/homebridge-meross",
3
3
  "alias": "Meross",
4
4
  "type": "module",
5
- "version": "10.14.0",
5
+ "version": "10.15.1",
6
6
  "description": "Homebridge plugin to integrate Meross devices into HomeKit.",
7
7
  "author": {
8
8
  "name": "bwp91",
@@ -48,8 +48,8 @@
48
48
  ],
49
49
  "main": "lib/index.js",
50
50
  "engines": {
51
- "homebridge": "^1.6.0 || ^2.0.0-beta.0",
52
- "node": "^22 || ^24"
51
+ "homebridge": "^1.6.0 || ^2.0.0",
52
+ "node": "^22.12.0 || ^24.0.0"
53
53
  },
54
54
  "scripts": {
55
55
  "lint": "eslint . --max-warnings=0",
@@ -57,13 +57,13 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@homebridge/plugin-ui-utils": "^2.2.3",
60
- "axios": "^1.15.0",
60
+ "axios": "^1.16.0",
61
61
  "mqtt": "^5.15.1",
62
62
  "node-persist": "^4.0.4",
63
- "p-queue": "^9.1.2",
63
+ "p-queue": "^9.2.0",
64
64
  "p-timeout": "^7.0.1"
65
65
  },
66
66
  "devDependencies": {
67
- "@antfu/eslint-config": "^8.1.1"
67
+ "@antfu/eslint-config": "^8.2.0"
68
68
  }
69
69
  }