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

Preset -> exposes + SMSZB-120 updates #2895

Merged
merged 13 commits into from
Aug 16, 2021
2 changes: 1 addition & 1 deletion converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -6237,7 +6237,7 @@ const converters = {
return {action: `scene_${scenes[msg.data.level]}`};
},
},
smszb120_fw: {
develco_fw: {
cluster: 'genBasic',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
Expand Down
19 changes: 19 additions & 0 deletions converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,25 @@ const converters = {
);
},
},
squawk: {
key: ['squawk'],
convertSet: async (entity, key, value, meta) => {
const state = {'system_is_armed': 0, 'system_is_disarmed': 1};
const level = {'low': 0, 'medium': 1, 'high': 2, 'very_high': 3};
const values = {
state: value.state,
level: value.level || 'very_high',
strobe: value.hasOwnProperty('strobe') ? value.strobe : false,
};
const info = (state[values.state]) + ((values.strobe ? 1 : 0) << 4) + (level[values.level] << 6);
await entity.command(
'ssIasWd',
'squawk',
{squawkinfo: info},
utils.getOptions(meta.mapped, entity),
);
},
},
cover_state: {
key: ['state'],
convertSet: async (entity, key, value, meta) => {
Expand Down
4 changes: 2 additions & 2 deletions devices/develco.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module.exports = [
vendor: 'Develco',
description: 'Smoke detector with siren',
fromZigbee: [fz.temperature, fz.battery, fz.ias_smoke_alarm_1_develco, fz.ignore_basic_report,
fz.smszb120_fw, fz.ias_enroll, fz.ias_wd],
fz.develco_fw, fz.ias_enroll, fz.ias_wd],
toZigbee: [tz.warning, tz.ias_max_duration, tz.warning_simple],
ota: ota.zigbeeOTA,
meta: {battery: {voltageToPercentage: '3V_2100'}},
Expand All @@ -163,7 +163,7 @@ module.exports = [
endpoint: (device) => {
return {default: 35};
},
exposes: [e.temperature(), e.battery(), e.smoke(), e.battery_low(), e.test(), e.warning(),
exposes: [e.temperature(), e.battery(), e.smoke(), e.battery_low(), e.test(),
exposes.numeric('max_duration', ea.ALL).withUnit('s').withValueMin(0).withValueMax(600).withDescription('Duration of Siren'),
exposes.binary('alarm', ea.SET, 'START', 'OFF').withDescription('Manual Start of Siren')],
},
Expand Down
4 changes: 4 additions & 0 deletions lib/exposes.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,5 +554,9 @@ module.exports = {
.withFeature(new Enum('user_type', access.SET, ['unrestricted', 'year_day_schedule', 'week_day_schedule', 'master', 'non_access']).withDescription('Type of user, unrestrictied: owner (default), (year|week)_day_schedule: user has ability to open lock based on specific time period, master: user has ability to both program and operate the door lock, non_access: user is recognized by the lock but does not have the ability to open the lock'))
.withFeature(new Binary('user_enabled', access.SET, true, false).withDescription('Whether the user is enabled/disabled'))
.withFeature(new Numeric('pin_code', access.SET).withDescription('Pincode to set, set pincode to null to clear')),
squawk: () => new Composite('squawk', 'squawk')
.withFeature(new Enum('state', access.SET, ['system_is_armed', 'system_is_disarmed']).withDescription('Set Squawk state'))
.withFeature(new Enum('level', access.SET, ['low', 'medium', 'high', 'very_high']).withDescription('Sound level'))
.withFeature(new Binary('strobe', access.SET, true, false).withDescription('Turn on/off the strobe (light) for Squawk')),
},
};