From e90ba363d745f04d950b3124d158aa556222aea9 Mon Sep 17 00:00:00 2001 From: DurandA Date: Fri, 11 May 2018 15:43:03 +0200 Subject: [PATCH] Add WSDCGQ11LM support --- README.md | 2 +- xiaomi-adapter.js | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 358e93e..9d55698 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ After doing this, you should be able to go into _Settings -> Add-ons_ on the gat | ref | description | supported | |------------|--------------------------------------------------|----------------------| | WSDCGQ01LM | Mijia Smart Home Temperature and Humidity Sensor | :heavy_check_mark: | -| WSDCGQ11LM | Aqara Temperature and Humidity Sensor | :warning: not tested | +| WSDCGQ11LM | Aqara Temperature and Humidity Sensor | :heavy_check_mark: | | RTCGQ11LM | Aqara Human Body Sensor | :x: | | MCCGQ11LM | Aqara Window and Door Sensor | :x: | | WXKG01LM | Mijia Smart Wireless Switch | :x: | diff --git a/xiaomi-adapter.js b/xiaomi-adapter.js index c94e13b..2eb30db 100644 --- a/xiaomi-adapter.js +++ b/xiaomi-adapter.js @@ -26,7 +26,7 @@ try { Property = gwa.Property; } -const wsdcgq01lm = { +const WSDCGQ01LM = { type: 'thing', name: 'Xiaomi Mijia Smart Home Temperature and Humidity Sensor', properties: { @@ -41,9 +41,29 @@ const wsdcgq01lm = { } }; +const WSDCGQ11LM = { + type: 'thing', + name: 'Xiaomi Aqara Temperature and Humidity Sensor', + properties: { + temperature: { + type: 'number', + unit: 'celcius' + }, + humidity: { + type: 'number', + unit: 'percent' + }, + pressure: { + type: 'number', + unit: 'hectopascal' + } + } +}; + const THINGS = { 4151: { // Xiaomi - 'lumi.sens': wsdcgq01lm + 'lumi.sens': WSDCGQ01LM, + 'lumi.weather': WSDCGQ11LM } }; @@ -114,6 +134,7 @@ class XiaomiAdapter extends Adapter { break; case 'msPressureMeasurement': let pressure = parseFloat(data.data['16']) / 10.0; + device.properties.get('pressure').setValue(pressure); break; case 'msOccupancySensing': // motion sensor break;