const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters'); const zigbeeHerdsmanUtils = require('zigbee-herdsman-converters/lib/utils'); const exposes = zigbeeHerdsmanConverters['exposes'] || require("zigbee-herdsman-converters/lib/exposes"); const ea = exposes.access; const e = exposes.presets; const fz = zigbeeHerdsmanConverters.fromZigbeeConverters || zigbeeHerdsmanConverters.fromZigbee; const tz = zigbeeHerdsmanConverters.toZigbeeConverters || zigbeeHerdsmanConverters.toZigbee; const definition = { zigbeeModel: ['3323-D'], // The model ID from: Device with modelID 'lumi.sens' is not supported. model: '3323-D', // Vendor model number, look on the device for a model number vendor: 'Centralite', // Vendor of the device (only used for documentation and startup logging) description: 'Centralite Micro Door Sensor', // Description of the device, copy from vendor site. (only used for documentation and startup logging) fromZigbee: [fz.ias_contact_alarm_1, fz.temperature], // We will add this later toZigbee: [], // Should be empty, unless device can be controlled (e.g. lights, switches). configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['msTemperatureMeasurement']); await reporting.temperature(endpoint); }, exposes: [e.contact(), e.battery_low(), e.tamper(), e.temperature()], // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend }; module.exports = definition;