From 79d405afe9318d5566ad91a98554bd87ba687f27 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 21 Apr 2018 09:14:02 +0200 Subject: [PATCH] Support RTCGQ11LM. #4 --- lib/converters/zigbee2mqtt.js | 25 ++++++++++++++++++++++--- lib/devices.js | 7 +++++++ support/docgen.js | 6 ------ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/lib/converters/zigbee2mqtt.js b/lib/converters/zigbee2mqtt.js index 757633488..cce12ede0 100644 --- a/lib/converters/zigbee2mqtt.js +++ b/lib/converters/zigbee2mqtt.js @@ -26,7 +26,7 @@ const store = {} const parsers = [ { - devices: ['WXKG01LM', 'RTCGQ01LM', 'WSDCGQ01LM', 'MCCGQ01LM', 'WXKG11LM', 'MCCGQ11LM'], + devices: ['WXKG01LM', 'RTCGQ01LM', 'WSDCGQ01LM', 'MCCGQ01LM', 'WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM'], cid: 'genBasic', type: 'attReport', disablePublish: true, @@ -84,7 +84,7 @@ const parsers = [ convert: (msg) => {return {humidity: parseFloat(msg.data.data['measuredValue']) / 100.0}} }, { - devices: ['RTCGQ01LM'], + devices: ['RTCGQ01LM', 'RTCGQ11LM'], cid: 'msOccupancySensing', type: 'attReport', convert: (msg, publish) => { @@ -144,6 +144,13 @@ const parsers = [ } } }, + { + devices: ['RTCGQ11LM'], + cid: 'msIlluminanceMeasurement', + type: 'attReport', + convert: (msg) => {return {illuminance: msg.data.data['measuredValue']}} + }, + // Ignore parsers (these message dont need parsing). { @@ -153,11 +160,23 @@ const parsers = [ convert: () => null }, { - devices: ['WXKG11LM', 'MCCGQ11LM'], + devices: ['WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM'], cid: 'genBasic', type: 'devChange', convert: () => null }, + { + devices: ['RTCGQ11LM'], + cid: 'msIlluminanceMeasurement', + type: 'devChange', + convert: () => null + }, + { + devices: ['RTCGQ11LM'], + cid: 'msOccupancySensing', + type: 'devChange', + convert: () => null + }, ]; module.exports = parsers; diff --git a/lib/devices.js b/lib/devices.js index 9b6650f84..771db50e6 100644 --- a/lib/devices.js +++ b/lib/devices.js @@ -80,6 +80,13 @@ const devices = { supports: 'occupancy', homeassistant: [homeassistant.binary_sensor_occupancy] }, + 'lumi.sensor_motion.aq2': { + model: 'RTCGQ11LM', + vendor: 'Xiaomi', + description: 'Aqara human body movement and illuminance sensor', + supports: 'occupancy and illuminance', + homeassistant: [homeassistant.binary_sensor_occupancy, homeassistant.sensor_illuminance] + }, 'lumi.sensor_magnet': { model: 'MCCGQ01LM', vendor: 'Xiaomi', diff --git a/support/docgen.js b/support/docgen.js index b3dfa5396..c40475262 100644 --- a/support/docgen.js +++ b/support/docgen.js @@ -10,12 +10,6 @@ const plannedToSupport = [ supports: '-', vendor: 'Xiaomi', }, - { - model: 'RTCGQ11LM', - description: 'Aqara human body movement and illuminance sensor', - supports: '-', - vendor: 'Xiaomi', - }, { model: 'SJCGQ11LM', description: 'Aqara water leak sensor',