madchicken / homebridge-zigbee-nt

A standalone ZigBee plugin that works with CC2531 USB dongle or Deconz
Apache License 2.0
75 stars 39 forks source link

SonOff SNZB-02 - Multiple sensor support #242

Closed davidXire closed 2 years ago

davidXire commented 2 years ago

I bought 2 SonOff SNZB-02 (Temperature Sensor).

The first pairing works, the sensor sends its data. I add the second one, the pairing seems to work fine. Except that after a while the following error causes the server to crash

[01/06/2022, 13:12:46] [ZigBee] Cannot read properties of undefined (reading 'error') [01/06/2022, 13:12:46] [ZigBee] Cannot read properties of undefined (reading 'error') [01/06/2022, 13:14:12] TypeError: Cannot read properties of undefined (reading 'error') at Object.configure (/usr/local/lib/node_modules/homebridge-zigbee-nt/node_modules/zigbee-herdsman-converters/devices/sonoff.js:112:24) [01/06/2022, 13:14:12] Got SIGTERM, shutting down Homebridge...

And it's a reboot loop, until I take one out.

davidXire commented 2 years ago

Log:

[01/06/2022, 13:45:32] [ZigBee] Updating service 00000049-0000-1000-8000-0026BB765291 for device Lumière WC with state { state: 'OFF', temperature: 30 } [01/06/2022, 13:45:32] [ZigBee] Updating service 00000089-0000-1000-8000-0026BB765291 for device Lumière WC with state { state: 'OFF', temperature: 30 } [01/06/2022, 13:45:37] [ZigBee] Zigbee message from Sensor2 { type: 'attributeReport', device: Device { ID: 4, _type: 'EndDevice', _ieeeAddr: '0x00124b00251ca8c7', _networkAddress: 46407, _manufacturerID: 0, _endpoints: [ [Endpoint] ], _manufacturerName: 'eWeLink', _powerSource: 'Battery', _modelID: 'TH01', _applicationVersion: 5, _stackVersion: undefined, _zclVersion: 1, _hardwareVersion: 1, _dateCode: '20201026', _softwareBuildID: undefined, _interviewCompleted: true, _interviewing: false, _skipDefaultResponse: false, _skipTimeResponse: false, meta: {}, _lastSeen: 1654083937910, _defaultSendWhenActive: undefined, useImplicitCheckin: true, _linkquality: 98 }, endpoint: Endpoint { ID: 1, profileID: 260, deviceID: 770, inputClusters: [ 0, 3, 1026, 1029, 1 ], outputClusters: [ 3 ], deviceNetworkAddress: 46407, deviceIeeeAddress: '0x00124b00251ca8c7', clusters: { genBasic: [Object], genPowerCfg: [Object], msTemperatureMeasurement: [Object], msRelativeHumidity: [Object] }, _binds: [ [Object], [Object], [Object] ], _configuredReportings: [ [Object], [Object], [Object], [Object] ], meta: {}, pendingRequests: [], defaultSendWhenActive: undefined }, data: { measuredValue: 2412 }, linkquality: 98, groupID: 0, cluster: 'msTemperatureMeasurement', meta: { zclTransactionSequenceNumber: 93, manufacturerCode: null, frameControl: { frameType: 0, manufacturerSpecific: false, direction: 1, disableDefaultResponse: true, reservedBits: 0 } } } [01/06/2022, 13:45:37] [ZigBee] Decoded state from incoming message { temperature: 24.12 } [01/06/2022, 13:45:37] [ZigBee] Updating state of device Sensor2 with { temperature: 24.12 } [01/06/2022, 13:45:37] [ZigBee] Updated state for device Sensor2 is now { temperature: 24.12 } [01/06/2022, 13:45:37] [ZigBee] Updating service 00000096-0000-1000-8000-0026BB765291 for device Sensor2 with state { temperature: 24.12 } [01/06/2022, 13:45:37] [ZigBee] Updating service 0000008A-0000-1000-8000-0026BB765291 for device Sensor2 with state { temperature: 24.12 } [01/06/2022, 13:45:37] [ZigBee] Updating service 00000082-0000-1000-8000-0026BB765291 for device Sensor2 with state { temperature: 24.12 } [01/06/2022, 13:45:42] [ZigBee] Cannot read properties of undefined (reading 'error') {"batteryLevel":100,"charging":true,"cleaning":false,"fanSpeed":102} | Props {"state":"charging","batteryLevel":100,"cleanTime":2136,"cleanArea":38.4175,"fanSpeed":102,"in_cleaning":0,"mainBrushWorkTime":44635,"sideBrushWorkTime":44635,"filterWorkTime":44635,"sensorDirtyTime":12306,"waterBoxMode":202,"autoDustCollection":1,"dustCollectionStatus":0} [01/06/2022, 13:46:04] TypeError: Cannot read properties of undefined (reading 'error') at Object.configure (/usr/local/lib/node_modules/homebridge-zigbee-nt/node_modules/zigbee-herdsman-converters/devices/sonoff.js:112:24)

davidXire commented 2 years ago

I have removed all SonOff sensor and add again and no more crash but :

If I paired Sensor1 first, then Sensor2 don't work.

[01/06/2022, 14:17:02] [ZigBee] Zigbee: allowing new devices to join. [01/06/2022, 14:17:08] [ZigBee] Accepting joining whitelisted device '0x00124b00251c9510' [01/06/2022, 14:17:08] [ZigBee] Device joined, Adding Sensor1 (eWeLink - TH01) [01/06/2022, 14:17:08] [ZigBee] Not initializing device Sensor1: already mapped in Homebridge [01/06/2022, 14:17:08] [ZigBee] Updating state of device Sensor1 with {} [01/06/2022, 14:17:08] [ZigBee] Updated state for device Sensor1 is now { temperature: 0 } [01/06/2022, 14:17:08] [ZigBee] No need to configure device Sensor1 [01/06/2022, 14:17:08] [ZigBee] Updating service 00000096-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:08] [ZigBee] Updating service 0000008A-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:08] [ZigBee] Updating service 00000082-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:09] [ZigBee] Interview progress started for device Sensor1 [01/06/2022, 14:17:09] [ZigBee] Device announce: Sensor1 (eWeLink - TH01) [01/06/2022, 14:17:09] [ZigBee] Not initializing device Sensor1: interview process still not completed [01/06/2022, 14:17:10] [ZigBee] Zigbee message from Sensor1 { type: 'readResponse', device: Device { ID: 5, _type: 'EndDevice', _ieeeAddr: '0x00124b00251c9510', _networkAddress: 56302, _manufacturerID: 0, _endpoints: [ [Endpoint] ], _manufacturerName: 'eWeLink', _powerSource: 'Battery', _modelID: 'TH01', _applicationVersion: 5, _stackVersion: undefined, _zclVersion: 1, _hardwareVersion: 1, _dateCode: '20201026', _softwareBuildID: undefined, _interviewCompleted: false, _interviewing: true, _skipDefaultResponse: false, _skipTimeResponse: false, meta: {}, _lastSeen: 1654085830324, _defaultSendWhenActive: undefined, useImplicitCheckin: true, _linkquality: 69, _deleted: false }, endpoint: Endpoint { ID: 1, profileID: 260, deviceID: 770, inputClusters: [ 0, 3, 1026, 1029, 1 ], outputClusters: [ 3 ], deviceNetworkAddress: 56302, deviceIeeeAddress: '0x00124b00251c9510', clusters: { genBasic: [Object] }, _binds: [], _configuredReportings: [], meta: {}, pendingRequests: [], defaultSendWhenActive: false }, data: { modelId: 'TH01', manufacturerName: 'eWeLink' }, linkquality: 69, groupID: 0, cluster: 'genBasic', meta: { zclTransactionSequenceNumber: 59, manufacturerCode: null, frameControl: { frameType: 0, manufacturerSpecific: false, direction: 1, disableDefaultResponse: true, reservedBits: 0 } } } [01/06/2022, 14:17:10] [ZigBee] Decoded state from incoming message {} [01/06/2022, 14:17:10] [ZigBee] Updating state of device Sensor1 with {} [01/06/2022, 14:17:10] [ZigBee] Updated state for device Sensor1 is now { temperature: 0 } [01/06/2022, 14:17:10] [ZigBee] No need to configure device Sensor1 [01/06/2022, 14:17:10] [ZigBee] Updating service 00000096-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:10] [ZigBee] Updating service 0000008A-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:10] [ZigBee] Updating service 00000082-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] Zigbee message from Sensor1 { type: 'readResponse', device: Device { ID: 5, _type: 'EndDevice', _ieeeAddr: '0x00124b00251c9510', _networkAddress: 56302, _manufacturerID: 0, _endpoints: [ [Endpoint] ], _manufacturerName: 'eWeLink', _powerSource: 'Battery', _modelID: 'TH01', _applicationVersion: 5, _stackVersion: undefined, _zclVersion: 1, _hardwareVersion: 1, _dateCode: '20201026', _softwareBuildID: undefined, _interviewCompleted: false, _interviewing: true, _skipDefaultResponse: false, _skipTimeResponse: false, meta: {}, _lastSeen: 1654085832042, _defaultSendWhenActive: undefined, useImplicitCheckin: true, _linkquality: 65, _deleted: false }, endpoint: Endpoint { ID: 1, profileID: 260, deviceID: 770, inputClusters: [ 0, 3, 1026, 1029, 1 ], outputClusters: [ 3 ], deviceNetworkAddress: 56302, deviceIeeeAddress: '0x00124b00251c9510', clusters: { genBasic: [Object] }, _binds: [], _configuredReportings: [], meta: {}, pendingRequests: [], defaultSendWhenActive: false }, data: { stackVersion: undefined }, linkquality: 65, groupID: 0, cluster: 'genBasic', meta: { zclTransactionSequenceNumber: 60, manufacturerCode: null, frameControl: { frameType: 0, manufacturerSpecific: false, direction: 1, disableDefaultResponse: true, reservedBits: 0 } } } [01/06/2022, 14:17:12] [ZigBee] Decoded state from incoming message {} [01/06/2022, 14:17:12] [ZigBee] Updating state of device Sensor1 with {} [01/06/2022, 14:17:12] [ZigBee] Updated state for device Sensor1 is now { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] No need to configure device Sensor1 [01/06/2022, 14:17:12] [ZigBee] Updating service 00000096-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] Updating service 0000008A-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] Updating service 00000082-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] Zigbee message from Sensor1 { type: 'readResponse', device: Device { ID: 5, _type: 'EndDevice', _ieeeAddr: '0x00124b00251c9510', _networkAddress: 56302, _manufacturerID: 0, _endpoints: [ [Endpoint] ], _manufacturerName: 'eWeLink', _powerSource: 'Battery', _modelID: 'TH01', _applicationVersion: 5, _stackVersion: undefined, _zclVersion: 1, _hardwareVersion: 1, _dateCode: '20201026', _softwareBuildID: undefined, _interviewCompleted: false, _interviewing: true, _skipDefaultResponse: false, _skipTimeResponse: false, meta: {}, _lastSeen: 1654085832697, _defaultSendWhenActive: undefined, useImplicitCheckin: true, _linkquality: 72, _deleted: false }, endpoint: Endpoint { ID: 1, profileID: 260, deviceID: 770, inputClusters: [ 0, 3, 1026, 1029, 1 ], outputClusters: [ 3 ], deviceNetworkAddress: 56302, deviceIeeeAddress: '0x00124b00251c9510', clusters: { genBasic: [Object] }, _binds: [], _configuredReportings: [], meta: {}, pendingRequests: [], defaultSendWhenActive: false }, data: { swBuildId: undefined }, linkquality: 72, groupID: 0, cluster: 'genBasic', meta: { zclTransactionSequenceNumber: 61, manufacturerCode: null, frameControl: { frameType: 0, manufacturerSpecific: false, direction: 1, disableDefaultResponse: true, reservedBits: 0 } } } [01/06/2022, 14:17:12] [ZigBee] Decoded state from incoming message {} [01/06/2022, 14:17:12] [ZigBee] Updating state of device Sensor1 with {} [01/06/2022, 14:17:12] [ZigBee] Updated state for device Sensor1 is now { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] No need to configure device Sensor1 [01/06/2022, 14:17:12] [ZigBee] Updating service 00000096-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] Updating service 0000008A-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] Updating service 00000082-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] Successfully interviewed device: eWeLink - TH01 [01/06/2022, 14:17:12] [ZigBee] Not initializing device Sensor1: already mapped in Homebridge [01/06/2022, 14:17:12] [ZigBee] Updating state of device Sensor1 with {} [01/06/2022, 14:17:12] [ZigBee] Updated state for device Sensor1 is now { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] No need to configure device Sensor1 [01/06/2022, 14:17:12] [ZigBee] Updating service 00000096-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] Updating service 0000008A-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 } [01/06/2022, 14:17:12] [ZigBee] Updating service 00000082-0000-1000-8000-0026BB765291 for device Sensor1 with state { temperature: 0 }

davidXire commented 2 years ago

Last comment indicate the configure argument : https://github.com/Koenkk/zigbee2mqtt/issues/12668