Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Smartthings devices #344

Merged
merged 17 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -1637,6 +1637,37 @@ const converters = {
};
},
},
st_leak: {
cid: 'ssIasZone',
type: 'attReport',
convert: (model, msg, publish, options) => {
const zoneStatus = msg.data.data.zoneStatus;
return {
water_leak: (zoneStatus & 1) > 0, // Bit 1 = wet
};
},
},
st_leak_change: {
cid: 'ssIasZone',
type: 'devChange',
convert: (model, msg, publish, options) => {
const zoneStatus = msg.data.data.zoneStatus;
return {
water_leak: (zoneStatus & 1) > 0, // Bit 1 = wet
};
},
},
st_contact_status_change: {
cid: 'ssIasZone',
type: 'statusChange',
convert: (model, msg, publish, options) => {
const zoneStatus = msg.data.zoneStatus;
return {
contact: !((zoneStatus & 1) > 0), // Bit 0 = Alarm: Contact detection
battery_low: (zoneStatus & 1<<3) > 0, // Bit 3 = Battery LOW indicator
};
},
},
thermostat_dev_change: {
cid: 'hvacThermostat',
type: 'devChange',
Expand Down
82 changes: 81 additions & 1 deletion devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ const devices = [
supports: 'occupancy and temperature',
fromZigbee: [
fz.generic_temperature, fz.ignore_temperature_change, fz.ias_zone_motion_dev_change,
fz.ias_zone_motion_status_change, fz.generic_batteryvoltage_3000_2500,
fz.ias_zone_motion_status_change, fz.generic_batteryvoltage_3000_2500, fz.ignore_power_change,
],
toZigbee: [],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
Expand Down Expand Up @@ -2211,6 +2211,86 @@ const devices = [
execute(device, actions, callback);
},
},
{
zigbeeModel: ['multiv4'],
model: 'F-MLT-US-2',
vendor: 'SmartThings',
description: 'Multipurpose sensor (2016 model)',
supports: 'contact',
fromZigbee: [
fz.generic_temperature, fz.ignore_temperature_change, fz.st_contact_status_change,
fz.generic_batteryvoltage_3000_2500, fz.ias_contact_dev_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),
(cb) => device.bind('msTemperatureMeasurement', coordinator, cb),
(cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb),
(cb) => device.bind('genPowerCfg', coordinator, cb),
(cb) => device.report('genPowerCfg', 'batteryVoltage', 0, 1000, 0, cb),
];
execute(device, actions, callback);
},
},
{
/**
* Note: humidity not (yet) implemented, as this seems to use proprietary cluster
* see Smartthings device handler (profileID: 0x9194, clusterId: 0xFC45
* https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/861ec6b88eb45273e341436a23d35274dc367c3b/
* devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy#L153-L156
*/
zigbeeModel: ['3310-S'],
model: '3310-S',
vendor: 'SmartThings',
description: 'Temperature and humidity sensor',
supports: 'temperature',
fromZigbee: [
fz.generic_temperature, fz.ignore_temperature_change,
fz.generic_batteryvoltage_3000_2500,
],
toZigbee: [],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
const actions = [
(cb) => device.bind('msTemperatureMeasurement', coordinator, cb),
(cb) => device.report('msTemperatureMeasurement', 'measuredValue', 150, 300, 0.5, cb),
(cb) => device.bind('genPowerCfg', coordinator, cb),
(cb) => device.report('genPowerCfg', 'batteryVoltage', 0, 1000, 0, cb),
];
execute(device, actions, callback);
},
},
{
zigbeeModel: ['3315-S'],
model: '3315-S',
vendor: 'SmartThings',
description: 'Water sensor',
supports: 'water and temperature',
fromZigbee: [
fz.generic_temperature, fz.ignore_temperature_change, fz.ignore_power_change,
fz.st_leak, fz.st_leak_change, fz.generic_batteryvoltage_3000_2500,
],
toZigbee: [],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
const actions = [
(cb) => device.bind('msTemperatureMeasurement', coordinator, cb),
(cb) => device.report('msTemperatureMeasurement', 'measuredValue', 300, 600, 1, cb),
(cb) => device.bind('genPowerCfg', coordinator, cb),
(cb) => device.report('genPowerCfg', 'batteryVoltage', 0, 1000, 0, cb),
(cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb),
(cb) => device.report('ssIasZone', 'zoneStatus', 0, 1000, null, cb),
(cb) => device.functional('ssIasZone', 'enrollRsp', {
enrollrspcode: 1,
zoneid: 255,
}, cb),
];
execute(device, actions, callback);
},
},

// Trust
{
Expand Down