Skip to content

Commit

Permalink
Support JTYJ-GD-01LM/BW. #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed May 16, 2018
1 parent 5ee79b2 commit f750bb3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/converters/zigbee2mqtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const store = {}

const parsers = [
{
devices: ['WXKG01LM', 'RTCGQ01LM', 'WSDCGQ01LM', 'MCCGQ01LM', 'WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM', 'WSDCGQ11LM', 'SJCGQ11LM', 'MFKZQ01LM'],
devices: ['WXKG01LM', 'RTCGQ01LM', 'WSDCGQ01LM', 'MCCGQ01LM', 'WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM', 'WSDCGQ11LM', 'SJCGQ11LM', 'MFKZQ01LM', 'JTYJ-GD-01LM/BW'],
cid: 'genBasic',
type: 'attReport',
convert: (msg) => {
Expand Down Expand Up @@ -321,6 +321,12 @@ const parsers = [
}
}
},
{
devices: ['JTYJ-GD-01LM/BW'],
cid: 'ssIasZone',
type: 'statusChange',
convert: (msg) => {return {smoke: msg.data.zoneStatus === 1}}
},

// Ignore parsers (these message dont need parsing).
{
Expand All @@ -330,7 +336,7 @@ const parsers = [
convert: () => null
},
{
devices: ['WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM', 'WSDCGQ11LM', 'SJCGQ11LM', 'MCCGQ01LM', 'RTCGQ01LM', 'WXKG01LM', 'WSDCGQ01LM'],
devices: ['WXKG11LM', 'MCCGQ11LM', 'RTCGQ11LM', 'WSDCGQ11LM', 'SJCGQ11LM', 'MCCGQ01LM', 'RTCGQ01LM', 'WXKG01LM', 'WSDCGQ01LM', 'JTYJ-GD-01LM/BW'],
cid: 'genBasic',
type: 'devChange',
convert: () => null
Expand Down
6 changes: 6 additions & 0 deletions lib/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ const devices = {
supports: 'on/off, power measurement',
vendor: 'Xiaomi',
},
'lumi.sensor_smoke': {
model: 'JTYJ-GD-01LM/BW',
description: 'MiJia Honeywell smoke detector',
supports: 'smoke',
vendor: 'Xiaomi',
},

// IKEA
'TRADFRI bulb E27 WS opal 980lm': {
Expand Down
12 changes: 12 additions & 0 deletions lib/homeassistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ const configurations = {
json_attributes: ['battery']
}
},
'binary_sensor_smoke': {
type: 'binary_sensor',
object_id: 'smoke',
discovery_payload: {
payload_on: true,
payload_off: false,
value_template: '{{ value_json.smoke }}',
device_class: 'smoke',
json_attributes: ['battery']
}
},

// Sensor
'sensor_illuminance': {
Expand Down Expand Up @@ -197,6 +208,7 @@ const mapping = {
'LED1536G5': [configurations.light_brightness_colortemp],
'7146060PH': [configurations.light_brightness_colortemp_xy],
'F7C033': [configurations.light_brightness],
'JTYJ-GD-01LM/BW': [configurations.binary_sensor_smoke],
};

// A map of all discoverd devices
Expand Down

0 comments on commit f750bb3

Please sign in to comment.