UNPKG

zigbee-herdsman-converters

Version:

Collection of device converters to be used with zigbee-herdsman

42 lines (40 loc) 1.7 kB
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 extend = require('../lib/extend'); const e = exposes.presets; module.exports = [ { zigbeeModel: ['SPW35Z-D0'], model: 'ZHS-15', vendor: 'Schwaiger', description: 'Power socket on/off with power consumption monitoring', fromZigbee: [fz.on_off, fz.electrical_measurement], toZigbee: [tz.on_off], configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement']); await reporting.onOff(endpoint); await reporting.readEletricalMeasurementMultiplierDivisors(endpoint); await reporting.rmsVoltage(endpoint); await reporting.rmsCurrent(endpoint); await reporting.activePower(endpoint); }, exposes: [e.switch(), e.power(), e.current(), e.voltage()], }, { zigbeeModel: ['ZBT-RGBWLight-GLS0844'], model: 'HAL300', vendor: 'Schwaiger', description: 'Tint LED bulb E27 806 lumen, dimmable, color, white 1800-6500K', extend: extend.light_onoff_brightness_colortemp_color(), }, { zigbeeModel: ['ZBT-DIMLight-Candle0800'], model: 'HAL600', vendor: 'Schwaiger', description: 'LED candle bulb E14 470 lumen, dimmable, color, white 2700K', extend: extend.light_onoff_brightness(), }, ];