Added support for occupancy sensor and door sensor.

Changed the temp and humidity sensor topic for humidity from relative_humidity to just humidity
This commit is contained in:
Andrew Linden
2017-12-08 11:29:34 +02:00
parent c446539c95
commit 59926ffeea
2 changed files with 12 additions and 1 deletions
+2
View File
@@ -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
+10 -1
View File
@@ -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) {