t0bst4r / home-assistant-matter-hub

Publish your Home-Assistant Instance using Matter.
Apache License 2.0
129 stars 6 forks source link

Not able to create a bridge due to an error comes from Homematic IP water leak sensor #154

Closed Obicom closed 7 hours ago

Obicom commented 7 hours ago

If I try to create my first bridge, a error occours. If I execlude the domain "binary_sensor" it works. The error comes from a Homematic IP Water leak sensor. Is it possible to execlude only this device and not all "binary_sensor"?**

✓bridgedDeviceBasicInformation ✓homeAssistant ✓descriptor
[ 2024-11-16T22:05:52.603Z ] [ ERROR ] [ matter.js / Transaction                            ]: Rolling back initialize<3addaca1d89142508058963ba0db41f7.aggregator.binary_sensor_homematic_wassersensor>#353 due to error: Behaviors have errors
[ 2024-11-16T22:05:52.621Z ] [ ERROR ] [ matter.js / Logger                                 ]: Unhandled error detected: Behaviors have errors
  at file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/node/dist/esm/endpoint/properties/Behaviors.js:128:21
  at all (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/util/Construction.js:375:17)
  at file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/util/Construction.js:365:11
  Cause #0: Error initializing 3addaca1d89142508058963ba0db41f7.aggregator.binary_sensor_homematic_wassersensor.booleanState
    at crash (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/node/dist/esm/behavior/internal/BehaviorBacking.js:48:13)
  Caused by: Cannot read properties of undefined (reading 'inverted')
    at BooleanStateServer.getStateValue (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:1387:40)
    at BooleanStateServer.update (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:1383:27)
    at BooleanStateServer.initialize (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:1379:10)
file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/node/dist/esm/endpoint/properties/Behaviors.js:128
        (causes) => new EndpointBehaviorsError(causes)
                    ^
EndpointBehaviorsError [AggregateError]: Behaviors have errors
    at file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/node/dist/esm/endpoint/properties/Behaviors.js:128:21
    at all (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/util/Construction.js:375:17)
    at file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/general/dist/esm/util/Construction.js:365:11 {
  format: [Function: format],
  [Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]],
  [errors]: [
    BehaviorInitializationError: Error initializing 3addaca1d89142508058963ba0db41f7.aggregator.binary_sensor_homematic_wassersensor.booleanState
        at crash (file:///usr/local/lib/node_modules/home-assistant-matter-hub/node_modules/@matter/node/dist/esm/behavior/internal/BehaviorBacking.js:48:13) {
      cause: TypeError: Cannot read properties of undefined (reading 'inverted')
          at BooleanStateServer.getStateValue (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:1387:40)
          at BooleanStateServer.update (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:1383:27)
          at BooleanStateServer.initialize (file:///usr/local/lib/node_modules/home-assistant-matter-hub/dist/backend/cli.js:1379:10)
    }
  ]
}
Node.js v18.20.4
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
t0bst4r commented 6 hours ago

This error was related to water leak detectors I just introduced. I just fixed it, please upgrade.

In general I’d recommend using a label in home assistant which can be added to every entity you want to expose with matter.

Then in the bridge configuration, only add one "include" rule for this label:

{
  "filter": {
    "include": [
      {
        "type": "label",
        "value": "voice_assistant"
      }
    ],
    "exclude": []
  }
}

with that configuration you can easily include and exclude new entities by just adding or removing the label. so if the addon does not start because of an error, you can simply remove the label from the entity.