Skip to content

Commit

Permalink
Support SJCGQ11LM. #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Apr 22, 2018
1 parent 8109bf6 commit b80d16c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/converters/zigbee2mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,17 @@ const parsers = [
type: 'attReport',
convert: (msg) => {return {click: WXKG02LM[msg.endpoints[0].epId]}}
},

{
devices: ['SJCGQ11LM'],
cid: 'genBasic',
type: 'attReport',
convert: (msg) => {
return {
battery: toPercentage(msg.data.data['65281']['1'], battery.min, battery.max),
water_leak: msg.data.data['65281']['100'] === 1,
};
}
},

// Ignore parsers (these message dont need parsing).
{
Expand All @@ -178,7 +188,7 @@ const parsers = [
convert: () => null
},
{
devices: ['WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM', 'WSDCGQ11LM'],
devices: ['WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM', 'WSDCGQ11LM', 'SJCGQ11LM'],
cid: 'genBasic',
type: 'devChange',
convert: () => null
Expand Down
18 changes: 18 additions & 0 deletions lib/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ const homeassistant = {
json_attributes: ['battery']
}
},
'binary_sensor_water_leak': {
type: 'binary_sensor',
object_id: 'water_leak',
discovery_payload: {
payload_on: true,
payload_off: false,
value_template: '{{ value_json.water_leak }}',
device_class: 'moisture',
json_attributes: ['battery']
}
},
'light_brightness_colortemp_xy': {
type: 'light',
object_id: 'light',
Expand Down Expand Up @@ -157,6 +168,13 @@ const devices = {
supports: 'open and closed state',
homeassistant: [homeassistant.binary_sensor_state]
},
'lumi.sensor_wleak.aq1': {
model: 'SJCGQ11LM',
vendor: 'Xiaomi',
description: 'Aqara water leak sensor',
supports: 'water leak true/false',
homeassistant: [homeassistant.binary_sensor_water_leak]
},
'TRADFRI bulb E27 WS opal 980lm': {
model: 'LED1545G12',
vendor: 'IKEA',
Expand Down

0 comments on commit b80d16c

Please sign in to comment.