const fz = require('zigbee-herdsman-converters/converters/fromZigbee'); const tz = require('zigbee-herdsman-converters/converters/toZigbee'); const exposes = require('zigbee-herdsman-converters/lib/exposes'); const reporting = require('zigbee-herdsman-converters/lib/reporting'); const e = exposes.presets; const ea = exposes.access; const definition = { zigbeeModel: ['CB432'], model: 'CB432', vendor: 'OWON', description: '32A/63A power circuit breaker', fromZigbee: [fz.metering, fz.on_off,fz.power_on_behavior], toZigbee: [tz.on_off,tz.power_on_behavior], exposes: [e.switch(), e.power(), e.energy(), e.power_on_behavior()], meta: {publishDuplicateTransaction: true}, configure: async (device, coordinatorEndpoint) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'seMetering']); await reporting.onOff(endpoint); await reporting.readMeteringMultiplierDivisor(endpoint); await reporting.instantaneousDemand(endpoint, {min: 5, max: 3600, change: 5}); // divider 1000: 5W await reporting.currentSummDelivered(endpoint, {min: 5, max: 3600, change: 100}); // divider 1000: 0,1kWh await endpoint.read('genOnOff', ['onOff', 'startUpOnOff']); }, }; module.exports = definition;