Skip to content

Commit

Permalink
Add WSDCGQ11LM support
Browse files Browse the repository at this point in the history
  • Loading branch information
DurandA committed May 11, 2018
1 parent 1d7d568 commit e90ba36
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
25 changes: 23 additions & 2 deletions xiaomi-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ try {
Property = gwa.Property;
}

const wsdcgq01lm = {
const WSDCGQ01LM = {
type: 'thing',
name: 'Xiaomi Mijia Smart Home Temperature and Humidity Sensor',
properties: {
Expand All @@ -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
}
};

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e90ba36

Please sign in to comment.