mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-02 10:01:37 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user