diff --git a/README.md b/README.md index afbd4b14..68b4ba51 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ $ cd xiaomi-zb2mqtt * WXKG01LM - Single, double, triple, quad and "more than five" click. Push and hold long click. * WXKG02LM - Left, right and both click * WSDCGQ11LM - Aqara Temperature Hudimity sensor with Temperature, Humidity and Pressure +* RTCGQ11LM - Xiaomi Smart Home Aqara Human Body Sensor +* MCCGQ11LM - Xiaomi Aqara Window Door Sensor ### Notes * You need to flash your CC2531 with CC2531ZNP-Pro-Secure_LinkKeyJoin.hex from here: https://github.com/mtornblad/zstack-1.2.2a.44539/tree/master/CC2531 diff --git a/index.js b/index.js index a1fd1536..07ac3381 100644 --- a/index.js +++ b/index.js @@ -42,19 +42,28 @@ shepherd.on('ind', function(msg) { switch (msg.data.cid) { case 'genOnOff': // various switches topic += '/' + msg.endpoints[0].epId; + pl = msg.data.data['onOff']; break; case 'msTemperatureMeasurement': // Aqara Temperature/Humidity topic += "/temperature"; pl = parseFloat(msg.data.data['measuredValue']) / 100.0; break; case 'msRelativeHumidity': - topic += "/relative_humidity"; + topic += "/humidity"; pl = parseFloat(msg.data.data['measuredValue']) / 100.0; break; case 'msPressureMeasurement': topic += "/pressure"; pl = parseFloat(msg.data.data['16']) / 10.0; break; + case 'msOccupancySensing': // motion sensor + topic += "/occupancy"; + pl = msg.data.data['occupancy']; + break; + case 'msIlluminanceMeasurement': + topic += "/illuminance"; + pl = msg.data.data['measuredValue']; + break; } switch (msg.endpoints[0].devId) {