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 support for xfinity uei xhk1 ue #1873

Closed
18 changes: 18 additions & 0 deletions converters/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,23 @@ const armMode = {
2: 'arm_night_zones',
3: 'arm_all_zones',
4: 'invalid_code',
5: 'not_ready', // Added as per Table 8-15 of the ZigBee Cluster Library Specification
6: 'already_disarmed', // Added as per Table 8-15 of the ZigBee Cluster Library Specification
};

// Zigbee IAS ACE Panel Status parameters as per Table 8-16 of the ZigBee Cluster Library Specification
const panStat = {
0: 'disarmed',
1: 'armed_stay',
2: 'armed_night',
3: 'armed_away',
4: 'exit_delay',
5: 'entry_delay',
6: 'not_ready',
7: 'in_alarm',
8: 'arming_stay',
9: 'arming_night',
10: 'arming_away',
};

const zclStatus = {
Expand Down Expand Up @@ -357,6 +374,7 @@ module.exports = {
TuyaDataPoints,
lockSourceName,
armMode,
panStat,
TuyaFanModes,
TuyaThermostatSystemModes2,
zclStatus,
Expand Down
20 changes: 20 additions & 0 deletions converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,26 @@ const converters = {
entity.commandResponse('ssIasAce', 'panelStatusChanged', payload);
},
},
// set the status of keypad in accordance with the assigned Zigbee standard IAS status'
set_status: {
key: ['set_status'],
convertSet: async (entity, key, value, meta) => {
const panel_status = utils.getKeyByValue(common.panStat, value.panelstatus, undefined);
const seconds_remain = value.secondsremain = 0;
const audible_notif = value.audiblenotif = 0;
const alarm_status = value.alarmstatus = 0;

if (panelStatus === undefined) {
throw new Error(
`Unsupported status: '${value.panelstatus}', should be one of: ${Object.values(common.panStat)}`,
);
}

globalStore.putValue(entity, 'panelStatus', panel_status);
const payload = {panelstatus: panel_status, secondsremain: seconds_remain, audiblenotif: audible_notif, alarmstatus: alarm_status};
entity.commandResponse('ssIasAce', 'panelStatusChanged', payload);
},
},
ballast_config: {
key: ['ballast_config'],
// zcl attribute names are camel case, but we want to use snake case in the outside communication
Expand Down
33 changes: 33 additions & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -8511,6 +8511,39 @@ const devices = [
}
},
},
{
zigbeeModel: ['URC4450BC0-X-R'],
model: 'URC4450BC0-X-R',
vendor: 'Xfinity',
description: 'Alarm Keypad',
supports: 'action, arm',
meta: {configureKey: 1, commandArmIncludeTransaction: true},
fromZigbee: [fz.command_arm, fz.temperature, fz.battery, fz.ias_occupancy_alarm_1, fz.identify, fz.ias_contact_alarm_1],
exposes: [e.battery(), e.voltage(), e.occupancy(), e.battery_low(), e.tamper(), e.presence(), exposes.numeric('action_code', 'r'),
exposes.numeric('action_zone', 'r'), e.temperature(), e.action([
'disarm', 'arm_day_zones', 'identify', 'arm_night_zones', 'arm_all_zones', 'invalid_code', 'emergency',
dettrick marked this conversation as resolved.
Show resolved Hide resolved
])],
toZigbee: [tz.arm_mode, tz.set_status],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
const clusters = ['msTemperatureMeasurement', 'genPowerCfg', 'ssIasZone', 'ssIasAce', 'genBasic', 'genIdentify'];
await bind(endpoint, coordinatorEndpoint, clusters);
await configureReporting.temperature(endpoint);
await configureReporting.batteryVoltage(endpoint);
},
onEvent: async (type, data, device) => {
if (type === 'message' && data.type === 'commandGetPanelStatus' && data.cluster === 'ssIasAce' &&
globalStore.hasValue(device.getEndpoint(1), 'panelStatus')) {
const payload = {
panelstatus: globalStore.getValue(device.getEndpoint(1), 'panelStatus'),
secondsremain: 0x00, audiblenotif: 0x00, alarmstatus: 0x00,
};
await device.getEndpoint(1).commandResponse(
'ssIasAce', 'getPanelStatusRsp', payload, {}, data.meta.zclTransactionSequenceNumber,
);
}
},
},
{
zigbeeModel: ['3420'],
model: '3420-G',
Expand Down