diff --git a/lib/converters/zigbee2mqtt.js b/lib/converters/zigbee2mqtt.js index 0ab4a0ad..0b36b467 100644 --- a/lib/converters/zigbee2mqtt.js +++ b/lib/converters/zigbee2mqtt.js @@ -1,4 +1,5 @@ const clickLookup = { + 1: 'single', 2: 'double', 3: 'triple', 4: 'quadruple', @@ -25,7 +26,7 @@ const store = {} const parsers = [ { - devices: ['WXKG01LM', 'RTCGQ01LM', 'WSDCGQ01LM', 'MCCGQ01LM'], + devices: ['WXKG01LM', 'RTCGQ01LM', 'WSDCGQ01LM', 'MCCGQ01LM', 'WXKG11LM'], cid: 'genBasic', type: 'attReport', disablePublish: true, @@ -124,6 +125,39 @@ const parsers = [ type: 'devChange', convert: (msg) => {return {color_temp: msg.data.data['colorTemperature']}}, }, + { + devices: ['WXKG11LM'], + cid: 'genOnOff', + type: 'attReport', + convert: (msg, publish) => { + const data = msg.data.data; + let clicks; + + if (data.onOff) { + clicks = 1; + } else if (data['32768']) { + clicks = data['32768']; + } + + if (clickLookup[clicks]) { + return {click: clickLookup[clicks]}; + } + } + }, + + // Ignore parsers (these message dont need parsing). + { + devices: ['WXKG11LM'], + cid: 'genOnOff', + type: 'devChange', + convert: () => null + }, + { + devices: ['WXKG11LM'], + cid: 'genBasic', + type: 'devChange', + convert: () => null + }, ]; module.exports = parsers; diff --git a/lib/devices.js b/lib/devices.js index ecb23b75..cd0f3ef1 100644 --- a/lib/devices.js +++ b/lib/devices.js @@ -35,6 +35,12 @@ const devices = { description: 'Hue Go', supports: 'on/off, brightness, color temperature, color rgb', }, + 'lumi.sensor_switch.aq2': { + model: 'WXKG11LM', + vendor: 'Xiaomi', + description: 'Aqara wireless switch', + supports: 'single, double, triple, quadruple click', + }, } module.exports = devices; diff --git a/support/docgen.js b/support/docgen.js index 4768e675..e868a1d8 100644 --- a/support/docgen.js +++ b/support/docgen.js @@ -4,12 +4,6 @@ */ const plannedToSupport = [ - { - model: 'WXKG11LM', - description: 'Aqara wireless switch', - supports: '-', - vendor: 'Xiaomi', - }, { model: 'WSDCGQ11LM', description: 'Aqara temperature & humidity sensor',