UNPKG

zigbee-herdsman-converters

Version:

Collection of device converters to be used with zigbee-herdsman

185 lines (183 loc) • 8.07 kB
const exposes = require('../lib/exposes'); const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee}; const reporting = require('../lib/reporting'); const extend = require('../lib/extend'); const e = exposes.presets; module.exports = [ { zigbeeModel: ['4512700'], model: '4512700', vendor: 'Namron', description: 'ZigBee dimmer 400W', extend: extend.light_onoff_brightness({noConfigure: true}), configure: async (device, coordinatorEndpoint, logger) => { await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger); const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']); await reporting.onOff(endpoint); }, }, { zigbeeModel: ['4512704'], model: '4512704', vendor: 'Namron', description: 'Zigbee switch 400W', extend: extend.switch(), configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1) || device.getEndpoint(3); await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']); await reporting.onOff(endpoint); }, }, { zigbeeModel: ['1402755'], model: '1402755', vendor: 'Namron', description: 'ZigBee LED dimmer', extend: extend.light_onoff_brightness({noConfigure: true}), configure: async (device, coordinatorEndpoint, logger) => { await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger); const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']); await reporting.onOff(endpoint); }, }, { zigbeeModel: ['4512703'], model: '4512703', vendor: 'Namron', description: 'Zigbee 4 channel switch K8 (white)', fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.command_move, fz.command_stop], exposes: [e.battery(), e.action([ 'on_l1', 'off_l1', 'brightness_move_up_l1', 'brightness_move_down_l1', 'brightness_stop_l1', 'on_l2', 'off_l2', 'brightness_move_up_l2', 'brightness_move_down_l2', 'brightness_stop_l2', 'on_l3', 'off_l3', 'brightness_move_up_l3', 'brightness_move_down_l3', 'brightness_stop_l3', 'on_l4', 'off_l4', 'brightness_move_up_l4', 'brightness_move_down_l4', 'brightness_stop_l4', ])], toZigbee: [], meta: {multiEndpoint: true}, endpoint: (device) => { return {l1: 1, l2: 2, l3: 3, l4: 4}; }, }, { zigbeeModel: ['4512721'], model: '4512721', vendor: 'Namron', description: 'Zigbee 4 channel switch K8 (black)', fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.command_move, fz.command_stop], toZigbee: [], meta: {multiEndpoint: true}, exposes: [e.battery(), e.action([ 'on_l1', 'off_l1', 'brightness_move_up_l1', 'brightness_move_down_l1', 'brightness_stop_l1', 'on_l2', 'off_l2', 'brightness_move_up_l2', 'brightness_move_down_l2', 'brightness_stop_l2', 'on_l3', 'off_l3', 'brightness_move_up_l3', 'brightness_move_down_l3', 'brightness_stop_l3', 'on_l4', 'off_l4', 'brightness_move_up_l4', 'brightness_move_down_l4', 'brightness_stop_l4'])], endpoint: (device) => { return {l1: 1, l2: 2, l3: 3, l4: 4}; }, }, { zigbeeModel: ['4512701'], model: '4512701', vendor: 'Namron', description: 'Zigbee 1 channel switch K2', fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.command_move, fz.command_stop], exposes: [e.battery(), e.action(['on', 'off', 'brightness_move_up', 'brightness_move_down', 'brightness_stop'])], toZigbee: [], }, { zigbeeModel: ['4512702'], model: '4512702', vendor: 'Namron', description: 'Zigbee 1 channel switch K4', fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.command_move, fz.command_stop, fz.command_step], exposes: [e.battery(), e.action([ 'on', 'off', 'brightness_move_up', 'brightness_move_down', 'brightness_stop', 'brightness_step_up', 'brightness_step_down'])], toZigbee: [], }, { zigbeeModel: ['4512719'], model: '4512719', vendor: 'Namron', description: 'Zigbee 2 channel switch K4 white', fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.command_move, fz.command_stop], meta: {multiEndpoint: true}, exposes: [e.battery(), e.action(['on_l1', 'off_l1', 'brightness_move_up_l1', 'brightness_move_down_l1', 'brightness_stop_l1', 'on_l2', 'off_l2', 'brightness_move_up_l2', 'brightness_move_down_l2', 'brightness_stop_l2'])], toZigbee: [], endpoint: (device) => { return {l1: 1, l2: 2}; }, }, { zigbeeModel: ['4512729'], model: '4512729', vendor: 'Namron', description: 'Zigbee 2 channel switch K4 white', fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.command_move, fz.command_stop], meta: {multiEndpoint: true}, exposes: [e.battery(), e.action(['on_l1', 'off_l1', 'brightness_move_up_l1', 'brightness_move_down_l1', 'brightness_stop_l1', 'on_l2', 'off_l2', 'brightness_move_up_l2', 'brightness_move_down_l2', 'brightness_stop_l2'])], toZigbee: [], endpoint: (device) => { return {l1: 1, l2: 2}; }, }, { zigbeeModel: ['4512706'], model: '4512706', vendor: 'Namron', description: 'Remote control', fromZigbee: [fz.command_on, fz.command_off, fz.command_step, fz.command_step_color_temperature, fz.command_recall, fz.command_move_to_color_temp, fz.battery], exposes: [e.battery(), e.action(['on', 'off', 'brightness_step_up', 'brightness_step_down', 'color_temperature_step_up', 'color_temperature_step_down', 'recall_*', 'color_temperature_move'])], toZigbee: [], meta: {multiEndpoint: true}, endpoint: (device) => { return {l1: 1, l2: 2, l3: 3, l4: 4}; }, }, { zigbeeModel: ['4512705'], model: '4512705', vendor: 'Namron', description: 'Zigbee 4 channel remote control', fromZigbee: [fz.command_on, fz.command_off, fz.battery, fz.command_move, fz.command_stop, fz.command_recall], toZigbee: [], exposes: [e.battery(), e.action([ 'on_l1', 'off_l1', 'brightness_move_up_l1', 'brightness_move_down_l1', 'brightness_stop_l1', 'on_l2', 'off_l2', 'brightness_move_up_l2', 'brightness_move_down_l2', 'brightness_stop_l2', 'on_l3', 'off_l3', 'brightness_move_up_l3', 'brightness_move_down_l3', 'brightness_stop_l3', 'on_l4', 'off_l4', 'brightness_move_up_l4', 'brightness_move_down_l4', 'brightness_stop_l4', 'recall_*'])], meta: {multiEndpoint: true}, endpoint: (device) => { return {l1: 1, l2: 2, l3: 3, l4: 4}; }, }, { zigbeeModel: ['3802962'], model: '3802962', vendor: 'Namron', description: 'LED 9W RGBW E27', meta: {turnsOffAtBrightness1: true}, extend: extend.light_onoff_brightness_colortemp_color(), }, { zigbeeModel: ['3802964'], model: '3802964', vendor: 'Namron', description: 'LED 5,3W CCT E14', extend: extend.light_onoff_brightness_colortemp(), }, { zigbeeModel: ['89665'], model: '89665', vendor: 'Namron', description: 'LED Strip RGB+W (5m) IP20', meta: {turnsOffAtBrightness1: true}, extend: extend.light_onoff_brightness_colortemp_color(), }, ];