diff --git a/lib/extension/receive.ts b/lib/extension/receive.ts index 984501561..80d9ef2a0 100755 --- a/lib/extension/receive.ts +++ b/lib/extension/receive.ts @@ -91,23 +91,6 @@ export default class Receive extends Extension { /* istanbul ignore next */ if (!data.device) return; - /** - * Handling of re-transmitted Xiaomi messages. - * https://github.com/Koenkk/zigbee2mqtt/issues/1238 - * https://github.com/Koenkk/zigbee2mqtt/issues/3592 - * - * Some Xiaomi router devices re-transmit messages from Xiaomi end devices. - * The network address of these message is set to the one of the Xiaomi router. - * Therefore it looks like if the message came from the Xiaomi router, while in - * fact it came from the end device. - * Handling these message would result in false state updates. - * The group ID attribute of these message defines the network address of the end device. - */ - if (data.device.isXiaomi() && data.device.zh.type === 'Router' && data.groupID) { - logger.debug('Handling re-transmitted Xiaomi message'); - data = {...data, device: this.zigbee.deviceByNetworkAddress(data.groupID)}; - } - if (!this.shouldProcess(data)) { utils.publishLastSeen({device: data.device, reason: 'messageEmitted'}, settings.get(), true, this.publishEntityState); diff --git a/lib/model/device.ts b/lib/model/device.ts index f22b8db92..8e7c8fbcd 100644 --- a/lib/model/device.ts +++ b/lib/model/device.ts @@ -67,13 +67,6 @@ export default class Device { return name === 'default' ? null : name; } - isXiaomi(): boolean { - const xiaomiManufacturerID = [4151, 4447]; - /* istanbul ignore next */ - return this.zh.modelID !== 'lumi.router' && xiaomiManufacturerID.includes(this.zh.manufacturerID) && - (!this.zh.manufacturerName || !this.zh.manufacturerName.startsWith('Trust')); - } - isIkeaTradfri(): boolean {return this.zh.manufacturerID === 4476;} isDevice(): this is Device {return true;} diff --git a/test/receive.test.js b/test/receive.test.js index 3edcf9ba0..0efae3685 100755 --- a/test/receive.test.js +++ b/test/receive.test.js @@ -350,20 +350,6 @@ describe('Receive', () => { expect(MQTT.publish.mock.calls[0][2]).toStrictEqual({"qos": 0, "retain": false}); }); - it('Should handle forwarded Xiaomi messages', async () => { - const device = zigbeeHerdsman.devices.ZNCZ02LM; - const payload = {data: {measuredValue: -85}, cluster: 'msTemperatureMeasurement', device, endpoint: device.getEndpoint(1), type: 'attributeReport', linkquality: 10, groupID: 6539}; - await zigbeeHerdsman.events.message(payload); - await flushPromises(); - expect(MQTT.publish).toHaveBeenCalledTimes(1); - expect(MQTT.publish).toHaveBeenCalledWith( - 'zigbee2mqtt/weather_sensor', - stringify({temperature: -0.85}), - {"qos": 1, "retain": false}, - expect.any(Function), - ) - }); - it('Should handle messages from Xiaomi router devices', async () => { const device = zigbeeHerdsman.devices.ZNCZ02LM; const data = {onOff: 1};