Skip to content

Commit

Permalink
Support RTCGQ11LM. Koenkk#4
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Apr 21, 2018
1 parent a210e6f commit 3e74e28
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
25 changes: 22 additions & 3 deletions lib/converters/zigbee2mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const store = {}

const parsers = [
{
devices: ['WXKG01LM', 'RTCGQ01LM', 'WSDCGQ01LM', 'MCCGQ01LM', 'WXKG11LM', 'MCCGQ11LM'],
devices: ['WXKG01LM', 'RTCGQ01LM', 'WSDCGQ01LM', 'MCCGQ01LM', 'WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM'],
cid: 'genBasic',
type: 'attReport',
disablePublish: true,
Expand Down Expand Up @@ -84,7 +84,7 @@ const parsers = [
convert: (msg) => {return {humidity: parseFloat(msg.data.data['measuredValue']) / 100.0}}
},
{
devices: ['RTCGQ01LM'],
devices: ['RTCGQ01LM', 'RTCGQ11LM'],
cid: 'msOccupancySensing',
type: 'attReport',
convert: (msg, publish) => {
Expand Down Expand Up @@ -144,6 +144,13 @@ const parsers = [
}
}
},
{
devices: ['RTCGQ11LM'],
cid: 'msIlluminanceMeasurement',
type: 'attReport',
convert: (msg) => {return {illuminance: msg.data.data['measuredValue']}}
},


// Ignore parsers (these message dont need parsing).
{
Expand All @@ -153,11 +160,23 @@ const parsers = [
convert: () => null
},
{
devices: ['WXKG11LM', 'MCCGQ11LM'],
devices: ['WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM'],
cid: 'genBasic',
type: 'devChange',
convert: () => null
},
{
devices: ['RTCGQ11LM'],
cid: 'msIlluminanceMeasurement',
type: 'devChange',
convert: () => null
},
{
devices: ['RTCGQ11LM'],
cid: 'msOccupancySensing',
type: 'devChange',
convert: () => null
},
];

module.exports = parsers;
7 changes: 7 additions & 0 deletions lib/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ const devices = {
supports: 'occupancy',
homeassistant: [homeassistant.binary_sensor_occupancy]
},
'lumi.sensor_motion.aq2': {
model: 'RTCGQ11LM',
vendor: 'Xiaomi',
description: 'Aqara human body movement and illuminance sensor',
supports: 'occupancy and illuminance',
homeassistant: [homeassistant.binary_sensor_occupancy, homeassistant.sensor_illuminance]
},
'lumi.sensor_magnet': {
model: 'MCCGQ01LM',
vendor: 'Xiaomi',
Expand Down
6 changes: 0 additions & 6 deletions support/docgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ const plannedToSupport = [
supports: '-',
vendor: 'Xiaomi',
},
{
model: 'RTCGQ11LM',
description: 'Aqara human body movement and illuminance sensor',
supports: '-',
vendor: 'Xiaomi',
},
{
model: 'SJCGQ11LM',
description: 'Aqara water leak sensor',
Expand Down

0 comments on commit 3e74e28

Please sign in to comment.