zigbee-herdsman-converters
Version:
Collection of device converters to be used with zigbee-herdsman
41 lines (39 loc) • 1.73 kB
JavaScript
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const reporting = require('../lib/reporting');
const e = exposes.presets;
module.exports = [
{
zigbeeModel: ['TS0215'],
model: 'S9ZGBRC01',
vendor: 'Smart9',
description: 'Smart remote controller',
fromZigbee: [fz.command_arm, fz.command_emergency, fz.battery],
toZigbee: [],
exposes: [e.battery(), e.action(['disarm', 'arm_day_zones', 'arm_night_zones', 'arm_all_zones', 'exit_delay', 'emergency'])],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
},
onEvent: async (type, data, device) => {
// Since arm command has a response zigbee-herdsman doesn't send a default response.
// This causes the remote to repeat the arm command, so send a default response here.
if (data.type === 'commandArm' && data.cluster === 'ssIasAce') {
await data.endpoint.defaultResponse(0, 0, 1281, data.meta.zclTransactionSequenceNumber);
}
},
},
{
zigbeeModel: ['5p1vj8r'],
model: '5p1vj8r',
vendor: 'Smart9',
description: 'Smoke sensor',
fromZigbee: [fz.tuya_smoke],
toZigbee: [],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']);
},
exposes: [e.smoke(), e.battery_low()],
},
];