Luligu / matterbridge-zigbee2mqtt

Matterbridge zigbee2mqtt plugin
https://github.com/Luligu/matterbridge-zigbee2mqtt/blob/main/README.md
Apache License 2.0
75 stars 9 forks source link

matterbridge-zigbee2mqtt issue receiving invalid Z2M message #78

Open robvanoostenrijk opened 2 weeks ago

robvanoostenrijk commented 2 weeks ago

When matterbridge-zigbee2mqtt receives an invalid Z2M message as per issue reported (https://github.com/Luligu/zigbee2mqtt-automations/issues/5).

It ends up trying to convert the message to Matter and then fails.

[InteractionServer] Subscription 825015395 for Session 27795: Error while sending initial data reports The number NaN cannot be converted to a BigInt because it is not an integer
  at BigInt (<anonymous>)
  at toBigInt (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/util/Number.js:25:38)
  at DataWriter.writeInt64 (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/util/DataWriter.js:57:53)
  at TlvCodec.writeUInt (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/tlv/TlvCodec.js:375:23)
  at TlvCodec.writePrimitive (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/tlv/TlvCodec.js:301:21)
  at TlvByteArrayWriter.writePrimitive (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/tlv/TlvSchema.js:70:14)
  at file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/tlv/TlvAny.js:57:18
  at Array.forEach (<anonymous>)
  at AnySchema.encodeTlvInternal (file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/tlv/TlvAny.js:37:15)
  at file:///usr/local/lib/node_modules/matterbridge/node_modules/@project-chip/matter.js/dist/esm/tlv/TlvArray.js:25:51

This repeats 3 times, after which the controller is unsubscribed:

[SubscriptionHandler] Sending update failed 3 times in a row, canceling subscription 825015377 and let controller subscribe again.

Either this requires a manual MatterBridge addon restart or some amount of time for the devices to be available again on Matter.

Luligu commented 3 days ago

Hi,

I need a full log to understand where to put a filter in the plugin to filter wrong values that can come from anywhere.

Subscribe again is the typical controller behaviour... after a while the controller subscribe again.