Skip to content

Commit

Permalink
New devices: Heiman Water Sensor, Heiman Door Sensor (#133)
Browse files Browse the repository at this point in the history
* New devices: Heiman Water Sensor, Heiman Door Sensor

* Update devices.js

* Update fromZigbee.js

* Update fromZigbee.js

* Improved support for HEIMAN devices

* Fixed ; and style

* Style fix

* Updates
  • Loading branch information
merlinschumacher authored and Koenkk committed Dec 9, 2018
1 parent e89e1d8 commit ecb3190
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 3 deletions.
33 changes: 31 additions & 2 deletions converters/fromZigbee.js
Expand Up @@ -672,11 +672,40 @@ const converters = {
return {smoke: msg.data.zoneStatus === 1};
},
},
HS1SA_smoke: {
heiman_smoke: {
cid: 'ssIasZone',
type: 'statusChange',
convert: (model, msg, publish, options) => {
return {smoke: msg.data.zoneStatus === 33};
const zoneStatus = msg.data.zoneStatus;
return {
smoke: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm: Smoke
tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status
battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator
};
},
},
heiman_water_leak: {
cid: 'ssIasZone',
type: 'statusChange',
convert: (model, msg, publish, options) => {
const zoneStatus = msg.data.zoneStatus;
return {
water_leak: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm: Water leak
tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status
battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator
};
},
},
heiman_contact: {
cid: 'ssIasZone',
type: 'statusChange',
convert: (model, msg, publish, options) => {
const zoneStatus = msg.data.zoneStatus;
return {
contact: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm: Contact detection
tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status
battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator
};
},
},
JTQJBF01LMBW_gas: {
Expand Down
38 changes: 37 additions & 1 deletion devices.js
Expand Up @@ -1651,7 +1651,7 @@ const devices = [
vendor: 'HEIMAN',
description: 'Smoke detector',
supports: 'smoke',
fromZigbee: [fz.HS1SA_smoke],
fromZigbee: [fz.heiman_smoke],
toZigbee: [],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
Expand All @@ -1663,6 +1663,42 @@ const devices = [
execute(device, actions, callback, 1000);
},
},
{
zigbeeModel: ['SmokeSensor-N'],
model: 'HS3SA',
vendor: 'HEIMAN',
description: 'Smoke detector',
supports: 'smoke',
fromZigbee: [fz.heiman_smoke],
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',
vendor: 'HEIMAN',
description: 'Door sensor',
supports: 'contact',
fromZigbee: [fz.heiman_contact],
toZigbee: [],
},
{
zigbeeModel: ['WaterSensor-N'],
model: 'HS1WL',
vendor: 'HEIMAN',
description: 'Water leakage sensor',
supports: 'water leak',
fromZigbee: [fz.heiman_water_leak],
toZigbee: [],
},

// Calex
{
Expand Down

0 comments on commit ecb3190

Please sign in to comment.