Skip to content

Commit

Permalink
HS3CG - Heiman gas sensor Koenkk#257 (Koenkk#265)
Browse files Browse the repository at this point in the history
* Update devices.js

* Update fromZigbee.js

* Update fromZigbee.js

* Update devices.js

* Update fromZigbee.js

* Update fromZigbee.js
  • Loading branch information
Mad-Andy authored and qosmio committed Dec 25, 2019
1 parent 0064d17 commit 8f470b9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,17 @@ const converters = {
return results;
},
},
heiman_gas: {
cid: 'ssIasZone',
type: 'statusChange',
convert: (model, msg, publish, options) => {
const zoneStatus = msg.data.zoneStatus;
return {
gas: (zoneStatus & 1) > 0, // Bit 1 = Alarm: Gas
battery_low: (zoneStatus & 1<<3) > 0, // Bit 4 = Battery LOW indicator
};
},
},
heiman_water_leak: {
cid: 'ssIasZone',
type: 'statusChange',
Expand Down Expand Up @@ -4286,6 +4297,11 @@ const converters = {
type: 'devChange',
convert: (model, msg, publish, options) => null,
},
ignore_iaszone_change: {
cid: 'ssIasZone',
type: 'devChange',
convert: (model, msg, publish, options) => null,
},
};

module.exports = converters;
18 changes: 18 additions & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -7668,6 +7668,24 @@ const devices = [
execute(device, actions, callback, 1000);
},
},
{
zigbeeModel: ['GASSensor-N'],
model: 'HS3CG',
vendor: 'HEIMAN',
description: 'Combustible gas sensor',
supports: 'gas',
fromZigbee: [fz.heiman_gas, fz.ignore_iaszone_change],
toZigbee: [],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
const actions = [
(cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb),
(cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb),
];

execute(device, actions, callback, 1000);
},
},
{
zigbeeModel: ['DoorSensor-N'],
model: 'HS1DS',
Expand Down

0 comments on commit 8f470b9

Please sign in to comment.