diff --git a/lib/converters/zigbee2mqtt.js b/lib/converters/zigbee2mqtt.js index b5d127e30..157e1bc1d 100644 --- a/lib/converters/zigbee2mqtt.js +++ b/lib/converters/zigbee2mqtt.js @@ -314,36 +314,17 @@ const parsers = [ cid: 'genBasic', type: 'attReport', convert: (msg) => { - if(msg.data.data['65281']){ + if (msg.data.data['65281']) { const data = msg.data.data['65281']; - const result = { - state: data['100'] === 1 ? "ON" : "OFF", + return { + state: data['100'] === 1 ? 'ON' : 'OFF', power: precisionRound(data['152'], 2), - consumption: precisionRound(data['149'], 2), - temperature: precisionRound(data['3'], 2), voltage: precisionRound(data['150'] * 0.1, 1), + consumption: precisionRound(data['149'], 2), // ?? + temperature: precisionRound(data['3'], 2), // ?? }; - return result; } - } - }, - { - devices: ['ZNCZ02LM'], - cid: 'genBasic', - type: 'devChange', - convert: (msg) => { - if(msg.data.data['65281']){ - const data = msg.data.data['65281']; - const result = { - state: data['100'] === 1 ? "ON" : "OFF", - power: precisionRound(data['152'], 2), - consumption: precisionRound(data['149'], 2), - temperature: precisionRound(data['3'], 2), - voltage: precisionRound(data['150'] * 0.1, 1), - }; - return result; - } - } + }, }, { devices: ['QBKG04LM'], @@ -411,7 +392,7 @@ const parsers = [ { devices: [ 'WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM', 'WSDCGQ11LM', 'SJCGQ11LM', 'MCCGQ01LM', 'RTCGQ01LM', 'WXKG01LM', - 'WSDCGQ01LM', 'JTYJ-GD-01LM/BW', + 'WSDCGQ01LM', 'JTYJ-GD-01LM/BW', 'ZNCZ02LM', ], cid: 'genBasic', type: 'devChange',