Skip to content

Commit

Permalink
Add support for Visonic MCT-350 contact sensor. (#336)
Browse files Browse the repository at this point in the history
* Add support for Visonic MCT-350 contact sensor.

* Update devices.js

* Update fromZigbee.js
  • Loading branch information
j4c3 authored and Koenkk committed Mar 11, 2019
1 parent a661780 commit d95913a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -2063,6 +2063,18 @@ const converters = {
return {action: 'circle_click'};
},
},
visonic_contact: {
cid: 'ssIasZone',
type: 'statusChange',
convert: (model, msg, publish, options) => {
const zoneStatus = msg.data.zoneStatus;
return {
contact: !((zoneStatus & 1) > 0), // Bit 1 = Alarm: Contact detection
tamper: (zoneStatus & 1<<2) > 0, // Bit 3 = Tamper status
battery_low: (zoneStatus & 1<<3) > 0, // Bit 4 = Battery LOW indicator
};
},
},

// Ignore converters (these message dont need parsing).
ignore_light_brightness_change: {
Expand Down
11 changes: 11 additions & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -3136,6 +3136,17 @@ const devices = [
execute(device, actions, callback);
},
},

// Visonic
{
zigbeeModel: ['MCT-350 SMA'],
model: 'MCT-350 SMA',
vendor: 'Visonic',
description: 'Magnetic door & window contact sensor',
supports: 'contact',
fromZigbee: [fz.visonic_contact, fz.ignore_power_change],
toZigbee: [],
},
];

module.exports = devices.map((device) =>
Expand Down

0 comments on commit d95913a

Please sign in to comment.