zigbee-herdsman-converters
Version:
Collection of device converters to be used with zigbee-herdsman
25 lines (23 loc) • 994 B
JavaScript
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const tz = require('../converters/toZigbee');
const reporting = require('../lib/reporting');
const e = exposes.presets;
module.exports = [
{
zigbeeModel: ['160-01'],
model: '160-01',
vendor: 'Plugwise',
description: 'Plug power socket on/off with power consumption monitoring',
fromZigbee: [fz.on_off, fz.metering],
toZigbee: [tz.on_off],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']);
await reporting.onOff(endpoint);
await reporting.readMeteringMultiplierDivisor(endpoint);
await reporting.instantaneousDemand(endpoint);
},
exposes: [e.switch(), e.power(), e.energy()],
},
];