From 752c9bc0ec4e838d2bb1caaccaf41e1578d81ca1 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 23 May 2018 18:26:50 +0200 Subject: [PATCH 001/676] Initial commit. --- converters/fromZigbee.js | 408 +++++++++++++++++++++++++++++++++++++++ converters/toZigbee.js | 54 ++++++ devices.js | 267 +++++++++++++++++++++++++ 3 files changed, 729 insertions(+) create mode 100644 converters/fromZigbee.js create mode 100644 converters/toZigbee.js create mode 100644 devices.js diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js new file mode 100644 index 0000000000000..da5eee66849de --- /dev/null +++ b/converters/fromZigbee.js @@ -0,0 +1,408 @@ +const clickLookup = { + 1: 'single', + 2: 'double', + 3: 'triple', + 4: 'quadruple', +}; + +const battery3V = { + min: 2500, + max: 3000, +}; + +const WXKG02LM = { + 1: 'left', + 2: 'right', + 3: 'both', +}; + +const QBKG03LM = { + 2: 'l1', + 3: 'l2', +}; + +const occupancyTimeout = 60; // In seconds + +const toPercentage = (value, min, max) => { + if (value > max) { + value = max; + } else if (value < min) { + value = min; + } + + const normalised = (value - min) / (max - min); + return (normalised * 100).toFixed(2); +}; + +const precisionRound = (number, precision) => { + const factor = Math.pow(10, precision); + return Math.round(number * factor) / factor; +}; + + +// Global variable store that can be used by devices. +const store = {}; + +const converters = { + xiaomi_battery_3v: { + cid: 'genBasic', + type: 'attReport', + convert: (msg) => { + let voltage = null; + + if (msg.data.data['65281']) { + voltage = msg.data.data['65281']['1']; + } else if (msg.data.data['65282']) { + voltage = msg.data.data['65282']['1'].elmVal; + } + + if (voltage) { + return {battery: toPercentage(voltage, battery3V.min, battery3V.max)}; + } + }, + }, + WXKG01LM_click: { + cid: 'genOnOff', + type: 'attReport', + convert: (msg, publish) => { + const deviceID = msg.endpoints[0].device.ieeeAddr; + const state = msg.data.data['onOff']; + + // 0 = click down, 1 = click up, else = multiple clicks + if (state === 0) { + store[deviceID] = setTimeout(() => { + publish({click: 'long'}); + store[deviceID] = null; + }, 300); // After 300 milliseconds of not releasing we assume long click. + } else if (state === 1) { + if (store[deviceID]) { + clearTimeout(store[deviceID]); + store[deviceID] = null; + publish({click: 'single'}); + } + } else { + const clicks = msg.data.data['32768']; + const payload = clickLookup[clicks] ? clickLookup[clicks] : 'many'; + publish({click: payload}); + } + }, + }, + xiaomi_temperature: { + cid: 'msTemperatureMeasurement', + type: 'attReport', + convert: (msg) => { + return {temperature: parseFloat(msg.data.data['measuredValue']) / 100.0}; + }, + }, + MFKZQ01LM_action_multistate: { + cid: 'genMultistateInput', + type: 'attReport', + convert: (msg) => { + /* + Source: https://github.com/kirovilya/ioBroker.zigbee + +---+ + | 2 | + +---+---+---+ + | 4 | 0 | 1 | + +---+---+---+ + |M5I| + +---+ + | 3 | + +---+ + Side 5 is with the MI logo, side 3 contains the battery door. + presentValue = 0 = shake + presentValue = 2 = wakeup + presentValue = 3 = fly/fall + presentValue = y + x * 8 + 64 = 90º Flip from side x on top to side y on top + presentValue = x + 128 = 180º flip to side x on top + presentValue = x + 256 = push/slide cube while side x is on top + presentValue = x + 512 = double tap while side x is on top + */ + const value = msg.data.data['presentValue']; + let action = null; + + if (value === 0) action = 'shake'; + else if (value === 2) action = 'wakeup'; + else if (value === 3) action = 'fall'; + else if (value >= 512) action = 'tap'; + else if (value >= 256) action = 'slide'; + else if (value >= 128) action = 'flip180'; + else if (value >= 64) action = 'flip90'; + + return action ? {'action': action} : null; + }, + }, + MFKZQ01LM_action_analog: { + cid: 'genAnalogInput', + type: 'attReport', + convert: (msg) => { + /* + Source: https://github.com/kirovilya/ioBroker.zigbee + presentValue = rotation angel left < 0, rigth > 0 + */ + const value = msg.data.data['presentValue']; + return {action: value < 0 ? 'rotate_left' : 'rotate_right'}; + }, + }, + xiaomi_humidity: { + cid: 'msRelativeHumidity', + type: 'attReport', + convert: (msg) => { + return {humidity: parseFloat(msg.data.data['measuredValue']) / 100.0}; + }, + }, + xiaomi_occupancy: { + cid: 'msOccupancySensing', + type: 'attReport', + convert: (msg, publish, options) => { + // The occupancy sensor only sends a message when motion detected. + // Therefore we need to publish the no_motion detected by ourselves. + const timeout = options.occupancy_timeout ? options.occupancy_timeout : occupancyTimeout; + const deviceID = msg.endpoints[0].device.ieeeAddr; + + // Stop existing timer because motion is detected and set a new one. + if (store[deviceID]) { + clearTimeout(store[deviceID]); + store[deviceID] = null; + } + + store[deviceID] = setTimeout(() => { + publish({occupancy: false}); + store[deviceID] = null; + }, timeout * 1000); + return {occupancy: true}; + }, + }, + xiaomi_contact: { + cid: 'genOnOff', + type: 'attReport', + convert: (msg) => { + return {contact: msg.data.data['onOff'] === 0}; + }, + }, + light_brightness: { + cid: 'genLevelCtrl', + type: 'devChange', + convert: (msg) => { + return {brightness: msg.data.data['currentLevel']}; + }, + }, + light_color_colortemp: { + cid: 'lightingColorCtrl', + type: 'devChange', + convert: (msg) => { + const result = {}; + + if (msg.data.data['colorTemperature']) { + result.color_temp = msg.data.data['colorTemperature']; + } + + if (msg.data.data['currentX'] && msg.data.data['currentY']) { + result.color = { + x: precisionRound(msg.data.data['currentX'] / 65535, 3), + y: precisionRound(msg.data.data['currentY'] / 65535, 3), + }; + } + + return result; + }, + }, + WXKG11LM_click: { + cid: 'genOnOff', + type: 'attReport', + convert: (msg) => { + const data = msg.data.data; + let clicks; + + if (data.onOff) { + clicks = 1; + } else if (data['32768']) { + clicks = data['32768']; + } + + if (clickLookup[clicks]) { + return {click: clickLookup[clicks]}; + } + }, + }, + xiaomi_illuminance: { + cid: 'msIlluminanceMeasurement', + type: 'attReport', + convert: (msg) => { + return {illuminance: msg.data.data['measuredValue']}; + }, + }, + xiaomi_pressure: { + cid: 'msPressureMeasurement', + type: 'attReport', + convert: (msg) => { + return {pressure: msg.data.data['measuredValue']}; + }, + }, + WXKG02LM_click: { + cid: 'genOnOff', + type: 'attReport', + convert: (msg) => { + return {click: WXKG02LM[msg.endpoints[0].epId]}; + }, + }, + WXKG03LM_click: { + cid: 'genOnOff', + type: 'attReport', + convert: () => { + return {click: 'single'}; + }, + }, + SJCGQ11LM_water_leak_basic: { + cid: 'genBasic', + type: 'attReport', + convert: (msg) => { + return {water_leak: msg.data.data['65281']['100'] === 1}; + }, + }, + SJCGQ11LM_water_leak_iaszone: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (msg) => { + return {water_leak: msg.data.zoneStatus === 1}; + }, + }, + xiaomi_state: { + cid: 'genOnOff', + type: 'attReport', + convert: (msg) => { + return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + }, + }, + xiaomi_power: { + cid: 'genAnalogInput', + type: 'attReport', + convert: (msg) => { + return {power: precisionRound(msg.data.data['presentValue'], 2)}; + }, + }, + ZNCZ02LM_state: { + cid: 'genBasic', + type: 'attReport', + convert: (msg) => { + if (msg.data.data['65281']) { + const data = msg.data.data['65281']; + return { + state: data['100'] === 1 ? 'ON' : 'OFF', + power: precisionRound(data['152'], 2), + voltage: precisionRound(data['150'] * 0.1, 1), + consumption: precisionRound(data['149'], 2), + temperature: precisionRound(data['3'], 2), + }; + } + }, + }, + QBKG04LM_state: { + cid: 'genOnOff', + type: 'attReport', + convert: (msg) => { + if (msg.data.data['61440']) { + return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + } + }, + }, + QBKG03LM_state: { + cid: 'genOnOff', + type: 'attReport', + convert: (msg) => { + if (msg.data.data['61440']) { + const key = `state_${QBKG03LM[msg.endpoints[0].epId]}`; + const payload = {}; + payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; + return payload; + } + }, + }, + JTYJGD01LMBW_smoke: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (msg) => { + return {smoke: msg.data.zoneStatus === 1}; + }, + }, + EDP_power: { + cid: 'seMetering', + type: 'attReport', + convert: (msg) => { + return {power: precisionRound(msg.data.data['instantaneousDemand'], 2)}; + }, + }, + CC2530ROUTER_state: { + cid: 'genOnOff', + type: 'attReport', + convert: (msg) => { + return {state: msg.data.data['onOff'] === 1}; + }, + }, + CC2530ROUTER_meta: { + cid: 'genBinaryValue', + type: 'attReport', + convert: (msg) => { + const data = msg.data.data; + return { + description: data['description'], + type: data['inactiveText'], + rssi: data['presentValue'], + }; + }, + }, + + // Ignore converters (these message dont need parsing). + ignore_onoff_change: { + cid: 'genOnOff', + type: 'devChange', + convert: () => null, + }, + ignore_basic_change: { + cid: 'genBasic', + type: 'devChange', + convert: () => null, + }, + ignore_illuminance_change: { + cid: 'msIlluminanceMeasurement', + type: 'devChange', + convert: () => null, + }, + ignore_occupancy_change: { + cid: 'msOccupancySensing', + type: 'devChange', + convert: () => null, + }, + ignore_temperature_change: { + cid: 'msTemperatureMeasurement', + type: 'devChange', + convert: () => null, + }, + ignore_humidity_change: { + cid: 'msRelativeHumidity', + type: 'devChange', + convert: () => null, + }, + ignore_pressure_change: { + cid: 'msPressureMeasurement', + type: 'devChange', + convert: () => null, + }, + ignore_analog_change: { + cid: 'genAnalogInput', + type: 'devChange', + convert: () => null, + }, + ignore_multistate_change: { + cid: 'genMultistateInput', + type: 'devChange', + convert: () => null, + }, + ignore_metering_change: { + cid: 'seMetering', + type: 'devChange', + convert: () => null, + }, +}; + +module.exports = converters; diff --git a/converters/toZigbee.js b/converters/toZigbee.js new file mode 100644 index 0000000000000..888458f6a07ad --- /dev/null +++ b/converters/toZigbee.js @@ -0,0 +1,54 @@ +const converters = { + onoff: { + key: 'state', + convert: (value) => { + return { + cid: 'genOnOff', + cmd: value.toLowerCase(), + zclData: {}, + }; + }, + }, + light_brightness: { + key: 'brightness', + convert: (value) => { + return { + cid: 'genLevelCtrl', + cmd: 'moveToLevel', + zclData: { + level: value, + transtime: 0, + }, + }; + }, + }, + light_colortemp: { + key: 'color_temp', + convert: (value) => { + return { + cid: 'lightingColorCtrl', + cmd: 'moveToColorTemp', + zclData: { + colortemp: value, + transtime: 0, + }, + }; + }, + }, + light_color: { + key: 'color', + convert: (value) => { + return { + cid: 'lightingColorCtrl', + cmd: 'moveToColor', + zclData: { + colorx: value.x * 65535, + colory: value.y * 65535, + transtime: 0, + }, + }; + }, + }, +}; + +module.exports = converters; diff --git a/devices.js b/devices.js new file mode 100644 index 0000000000000..e971ea80375b0 --- /dev/null +++ b/devices.js @@ -0,0 +1,267 @@ +const fz = require('./converters/fromZigbee'); +const tz = require('./converters/toZigbee'); + +const LED1623G12 = { + model: 'LED1623G12', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness], +}; + +const LED1536G5 = { + model: 'LED1536G5', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable, white spectrum, opal white', + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], +}; + +const devices = { + // Xiaomi + 'lumi.sensor_switch': { + model: 'WXKG01LM', + vendor: 'Xiaomi', + description: 'MiJia wireless switch', + supports: 'single, double, triple, quadruple, many and long click', + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG01LM_click, fz.ignore_onoff_change, fz.ignore_basic_change], + toZigbee: [], + }, + 'lumi.sensor_switch.aq2': { + model: 'WXKG11LM', + vendor: 'Xiaomi', + description: 'Aqara wireless switch', + supports: 'single, double, triple, quadruple click', + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG11LM_click, fz.ignore_onoff_change, fz.ignore_basic_change], + toZigbee: [], + }, + 'lumi.sensor_86sw1\u0000lu': { + model: 'WXKG03LM', + vendor: 'Xiaomi', + description: 'Aqara single key wireless wall switch', + supports: 'single click', + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG03LM_click], + toZigbee: [], + }, + 'lumi.sensor_86sw2\u0000Un': { + model: 'WXKG02LM', + vendor: 'Xiaomi', + description: 'Aqara double key wireless wall switch', + supports: 'left, right and both click', + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG02LM_click], + toZigbee: [], + }, + 'lumi.ctrl_neutral1': { + model: 'QBKG04LM', + vendor: 'Xiaomi', + description: 'Aqara single key wired wall switch', + supports: 'on/off', + fromZigbee: [fz.QBKG04LM_state, fz.ignore_onoff_change], + toZigbee: [tz.onoff], + ep: {'': 2}, + }, + 'lumi.ctrl_neutral2': { + model: 'QBKG03LM', + vendor: 'Xiaomi', + description: 'Aqara double key wired wall switch', + supports: 'l1 and l2 on/off', + fromZigbee: [fz.QBKG03LM_state, fz.ignore_onoff_change], + toZigbee: [tz.onoff], + ep: {'l1': 2, 'l2': 3}, + }, + 'lumi.sens': { + model: 'WSDCGQ01LM', + vendor: 'Xiaomi', + description: 'MiJia temperature & humidity sensor ', + supports: 'temperature and humidity', + fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_temperature, fz.xiaomi_humidity, fz.ignore_basic_change], + toZigbee: [], + }, + 'lumi.weather': { + model: 'WSDCGQ11LM', + vendor: 'Xiaomi', + description: 'Aqara temperature, humidity and pressure sensor', + supports: 'temperature, humidity and pressure', + fromZigbee: [ + fz.xiaomi_battery_3v, fz.xiaomi_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, fz.ignore_basic_change, + fz.ignore_temperature_change, fz.ignore_humidity_change, fz.ignore_pressure_change, + ], + toZigbee: [], + }, + 'lumi.sensor_motion': { + model: 'RTCGQ01LM', + vendor: 'Xiaomi', + description: 'MiJia human body movement sensor', + supports: 'occupancy', + fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_occupancy, fz.ignore_basic_change], + toZigbee: [], + }, + 'lumi.sensor_motion.aq2': { + model: 'RTCGQ11LM', + vendor: 'Xiaomi', + description: 'Aqara human body movement and illuminance sensor', + supports: 'occupancy and illuminance', + fromZigbee: [ + fz.xiaomi_battery_3v, fz.xiaomi_occupancy, fz.xiaomi_illuminance, fz.ignore_basic_change, + fz.ignore_illuminance_change, fz.ignore_occupancy_change, + ], + toZigbee: [], + }, + 'lumi.sensor_magnet': { + model: 'MCCGQ01LM', + vendor: 'Xiaomi', + description: 'MiJia door & window contact sensor', + supports: 'contact', + fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.ignore_onoff_change, fz.ignore_basic_change], + toZigbee: [], + }, + 'lumi.sensor_magnet.aq2': { + model: 'MCCGQ11LM', + vendor: 'Xiaomi', + description: 'Aqara door & window contact sensor', + supports: 'contact', + fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.ignore_onoff_change, fz.ignore_basic_change], + toZigbee: [], + }, + 'lumi.sensor_wleak.aq1': { + model: 'SJCGQ11LM', + vendor: 'Xiaomi', + description: 'Aqara water leak sensor', + supports: 'water leak true/false', + fromZigbee: [ + fz.xiaomi_battery_3v, fz.SJCGQ11LM_water_leak_basic, fz.SJCGQ11LM_water_leak_iaszone, + fz.ignore_basic_change, + ], + toZigbee: [], + }, + 'lumi.sensor_cube': { + model: 'MFKZQ01LM', + vendor: 'Xiaomi', + description: 'Mi smart home cube', + supports: 'shake, wakeup, fall, tap, slide, flip180, flip90, rotate_left and rotate_right', + fromZigbee: [ + fz.xiaomi_battery_3v, fz.MFKZQ01LM_action_multistate, fz.MFKZQ01LM_action_analog, + fz.ignore_analog_change, fz.ignore_multistate_change, + ], + toZigbee: [], + }, + 'lumi.plug': { + model: 'ZNCZ02LM', + description: 'Mi power plug ZigBee', + supports: 'on/off, power measurement', + vendor: 'Xiaomi', + fromZigbee: [ + fz.xiaomi_state, fz.xiaomi_power, fz.ZNCZ02LM_state, fz.ignore_onoff_change, + fz.ignore_basic_change, fz.ignore_analog_change, + ], + toZigbee: [tz.onoff], + }, + 'lumi.ctrl_86plug': { + model: 'QBCZ11LM', + description: 'Aqara socket Zigbee', + supports: 'on/off, power measurement', + vendor: 'Xiaomi', + fromZigbee: [fz.xiaomi_state, fz.xiaomi_power, fz.ignore_onoff_change, fz.ignore_analog_change], + toZigbee: [tz.onoff], + }, + 'lumi.sensor_smoke': { + model: 'JTYJ-GD-01LM/BW', + description: 'MiJia Honeywell smoke detector', + supports: 'smoke', + vendor: 'Xiaomi', + fromZigbee: [fz.xiaomi_battery_3v, fz.JTYJGD01LMBW_smoke, fz.ignore_basic_change], + toZigbee: [], + }, + + // IKEA + 'TRADFRI bulb E27 WS opal 980lm': { + model: 'LED1545G12', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E27 980 lumen, dimmable, white spectrum, opal white', + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], + }, + // LED1623G12 uses 2 model IDs, see https://github.com/Koenkk/zigbee2mqtt/issues/21 + 'TRADFRI bulb E27 opal 1000lm': LED1623G12, + 'TRADFRI bulb E27 W opal 1000lm': LED1623G12, + 'TRADFRI bulb GU10 WS 400lm': { + model: 'LED1537R6', + vendor: 'IKEA', + description: 'TRADFRI LED bulb GU10 400 lumen, dimmable, white spectrum', + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], + }, + 'TRADFRI bulb GU10 W 400lm': { + model: 'LED1650R5', + vendor: 'IKEA', + description: 'TRADFRI LED bulb GU10 400 lumen, dimmable', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness], + }, + // LED1536G5 has an E12 and E14 version. + 'TRADFRI bulb E14 WS opal 400lm': LED1536G5, + 'TRADFRI bulb E12 WS opal 400lm': LED1536G5, + 'TRADFRI bulb E26 opal 1000lm': { + model: 'LED1622G12', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E26 1000 lumen, dimmable, opal white', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness], + }, + + // Philips + 'LLC020': { + model: '7146060PH', + vendor: 'Philips', + description: 'Hue Go', + supports: 'on/off, brightness, color temperature, color xy', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color], + }, + + // Belkin + 'MZ100': { + model: 'F7C033', + vendor: 'Belkin', + description: 'WeMo smart LED bulb', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness], + }, + + // EDP + 'ZB-SmartPlug-1.0.0': { + model: 'PLUG EDP RE:DY', + vendor: 'EDP', + description: 're:dy plug', + supports: 'on/off, power measurement', + fromZigbee: [fz.ignore_onoff_change, fz.EDP_power, fz.ignore_metering_change], + toZigbee: [tz.onoff], + report: [{ + 'cid': 'seMetering', + 'attr': 'instantaneousDemand', + 'ep': 85, + 'minInt': 10, + 'maxInt': 60, + 'repChange': 1, + }], + }, + + // Texax Instruments + 'lumi.router': { + model: 'CC2530.ROUTER', + vendor: 'Texas Instruments', + description: '[CC2530 router](http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/)', + supports: 'state, description, type, rssi', + fromZigbee: [fz.CC2530ROUTER_state, fz.CC2530ROUTER_meta], + toZigbee: [], + }, +}; + +module.exports = devices; From dd14a2716abaccf5c8ea344215d5b06b85bb4b49 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Wed, 23 May 2018 22:01:04 +0300 Subject: [PATCH 002/676] Added device model to parser parameters #45 --- converters/fromZigbee.js | 73 +++++++++++++++++++--------------------- devices.js | 1 + 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index da5eee66849de..6eb2966b58d3f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -10,17 +10,6 @@ const battery3V = { max: 3000, }; -const WXKG02LM = { - 1: 'left', - 2: 'right', - 3: 'both', -}; - -const QBKG03LM = { - 2: 'l1', - 3: 'l2', -}; - const occupancyTimeout = 60; // In seconds const toPercentage = (value, min, max) => { @@ -39,6 +28,12 @@ const precisionRound = (number, precision) => { return Math.round(number * factor) / factor; }; +// get object property name (key) by it's value +const getKey = (object, value) => { + for (let key in object) { + if (object[key]==value) return key; + } +}; // Global variable store that can be used by devices. const store = {}; @@ -47,7 +42,7 @@ const converters = { xiaomi_battery_3v: { cid: 'genBasic', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { let voltage = null; if (msg.data.data['65281']) { @@ -64,7 +59,7 @@ const converters = { WXKG01LM_click: { cid: 'genOnOff', type: 'attReport', - convert: (msg, publish) => { + convert: (model, msg, publish) => { const deviceID = msg.endpoints[0].device.ieeeAddr; const state = msg.data.data['onOff']; @@ -90,14 +85,14 @@ const converters = { xiaomi_temperature: { cid: 'msTemperatureMeasurement', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {temperature: parseFloat(msg.data.data['measuredValue']) / 100.0}; }, }, MFKZQ01LM_action_multistate: { cid: 'genMultistateInput', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { /* Source: https://github.com/kirovilya/ioBroker.zigbee +---+ @@ -135,7 +130,7 @@ const converters = { MFKZQ01LM_action_analog: { cid: 'genAnalogInput', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { /* Source: https://github.com/kirovilya/ioBroker.zigbee presentValue = rotation angel left < 0, rigth > 0 @@ -147,14 +142,14 @@ const converters = { xiaomi_humidity: { cid: 'msRelativeHumidity', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {humidity: parseFloat(msg.data.data['measuredValue']) / 100.0}; }, }, xiaomi_occupancy: { cid: 'msOccupancySensing', type: 'attReport', - convert: (msg, publish, options) => { + convert: (model, msg, publish, options) => { // The occupancy sensor only sends a message when motion detected. // Therefore we need to publish the no_motion detected by ourselves. const timeout = options.occupancy_timeout ? options.occupancy_timeout : occupancyTimeout; @@ -176,21 +171,21 @@ const converters = { xiaomi_contact: { cid: 'genOnOff', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {contact: msg.data.data['onOff'] === 0}; }, }, light_brightness: { cid: 'genLevelCtrl', type: 'devChange', - convert: (msg) => { + convert: (model, msg) => { return {brightness: msg.data.data['currentLevel']}; }, }, light_color_colortemp: { cid: 'lightingColorCtrl', type: 'devChange', - convert: (msg) => { + convert: (model, msg) => { const result = {}; if (msg.data.data['colorTemperature']) { @@ -210,7 +205,7 @@ const converters = { WXKG11LM_click: { cid: 'genOnOff', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { const data = msg.data.data; let clicks; @@ -228,63 +223,63 @@ const converters = { xiaomi_illuminance: { cid: 'msIlluminanceMeasurement', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {illuminance: msg.data.data['measuredValue']}; }, }, xiaomi_pressure: { cid: 'msPressureMeasurement', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {pressure: msg.data.data['measuredValue']}; }, }, WXKG02LM_click: { cid: 'genOnOff', type: 'attReport', - convert: (msg) => { - return {click: WXKG02LM[msg.endpoints[0].epId]}; + convert: (model, msg) => { + return {click: getKey(model.ep, msg.endpoints[0].epId)}; }, }, WXKG03LM_click: { cid: 'genOnOff', type: 'attReport', - convert: () => { + convert: (model, msg) => { return {click: 'single'}; }, }, SJCGQ11LM_water_leak_basic: { cid: 'genBasic', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {water_leak: msg.data.data['65281']['100'] === 1}; }, }, SJCGQ11LM_water_leak_iaszone: { cid: 'ssIasZone', type: 'statusChange', - convert: (msg) => { + convert: (model, msg) => { return {water_leak: msg.data.zoneStatus === 1}; }, }, xiaomi_state: { cid: 'genOnOff', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; }, }, xiaomi_power: { cid: 'genAnalogInput', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {power: precisionRound(msg.data.data['presentValue'], 2)}; }, }, ZNCZ02LM_state: { cid: 'genBasic', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { if (msg.data.data['65281']) { const data = msg.data.data['65281']; return { @@ -300,7 +295,7 @@ const converters = { QBKG04LM_state: { cid: 'genOnOff', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { if (msg.data.data['61440']) { return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; } @@ -309,9 +304,9 @@ const converters = { QBKG03LM_state: { cid: 'genOnOff', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { if (msg.data.data['61440']) { - const key = `state_${QBKG03LM[msg.endpoints[0].epId]}`; + const key = `state_${getKey(model.ep, msg.endpoints[0].epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; return payload; @@ -321,28 +316,28 @@ const converters = { JTYJGD01LMBW_smoke: { cid: 'ssIasZone', type: 'statusChange', - convert: (msg) => { + convert: (model, msg) => { return {smoke: msg.data.zoneStatus === 1}; }, }, EDP_power: { cid: 'seMetering', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {power: precisionRound(msg.data.data['instantaneousDemand'], 2)}; }, }, CC2530ROUTER_state: { cid: 'genOnOff', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { return {state: msg.data.data['onOff'] === 1}; }, }, CC2530ROUTER_meta: { cid: 'genBinaryValue', type: 'attReport', - convert: (msg) => { + convert: (model, msg) => { const data = msg.data.data; return { description: data['description'], diff --git a/devices.js b/devices.js index e971ea80375b0..038942cbae96a 100644 --- a/devices.js +++ b/devices.js @@ -52,6 +52,7 @@ const devices = { supports: 'left, right and both click', fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG02LM_click], toZigbee: [], + ep: {'left': 1, 'right': 2, 'both': 3}, }, 'lumi.ctrl_neutral1': { model: 'QBKG04LM', From 12b8f21939b62993d3079fe8cb44bcde65796929 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 24 May 2018 12:02:14 +0200 Subject: [PATCH 003/676] Add travis and eslint config. --- .eslintignore | 2 + .eslintrc.json | 17 + .gitignore | 1 + .travis.yml | 11 + converters/fromZigbee.js | 70 +-- npm-shrinkwrap.json | 1165 ++++++++++++++++++++++++++++++++++++++ package.json | 33 ++ test/verify.js | 45 ++ 8 files changed, 1309 insertions(+), 35 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.json create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 npm-shrinkwrap.json create mode 100644 package.json create mode 100644 test/verify.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000..c383b366cfee0 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +node_modules/* +test/* \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000000000..540026c98fa9c --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,17 @@ +{ + "env": { + "node": true + }, + "extends": ["eslint:recommended", "google"], + "parserOptions": { + "ecmaFeatures": { + "experimentalObjectRestSpread": true + }, + "sourceType": "module" + }, + "rules": { + "require-jsdoc": "off", + "indent": ["error", 4], + "max-len": ["error", { "code": 120 }] + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000..40b878db5b1c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000000..e26538873a403 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: node_js + +node_js: + - "8" + +install: + - npm install + +script: + - npm run verify + - npm run eslint diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 6eb2966b58d3f..3d8734a8e489d 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -42,7 +42,7 @@ const converters = { xiaomi_battery_3v: { cid: 'genBasic', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { let voltage = null; if (msg.data.data['65281']) { @@ -59,7 +59,7 @@ const converters = { WXKG01LM_click: { cid: 'genOnOff', type: 'attReport', - convert: (model, msg, publish) => { + convert: (model, msg, publish, options) => { const deviceID = msg.endpoints[0].device.ieeeAddr; const state = msg.data.data['onOff']; @@ -85,14 +85,14 @@ const converters = { xiaomi_temperature: { cid: 'msTemperatureMeasurement', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {temperature: parseFloat(msg.data.data['measuredValue']) / 100.0}; }, }, MFKZQ01LM_action_multistate: { cid: 'genMultistateInput', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { /* Source: https://github.com/kirovilya/ioBroker.zigbee +---+ @@ -130,7 +130,7 @@ const converters = { MFKZQ01LM_action_analog: { cid: 'genAnalogInput', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { /* Source: https://github.com/kirovilya/ioBroker.zigbee presentValue = rotation angel left < 0, rigth > 0 @@ -142,7 +142,7 @@ const converters = { xiaomi_humidity: { cid: 'msRelativeHumidity', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {humidity: parseFloat(msg.data.data['measuredValue']) / 100.0}; }, }, @@ -171,21 +171,21 @@ const converters = { xiaomi_contact: { cid: 'genOnOff', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {contact: msg.data.data['onOff'] === 0}; }, }, light_brightness: { cid: 'genLevelCtrl', type: 'devChange', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {brightness: msg.data.data['currentLevel']}; }, }, light_color_colortemp: { cid: 'lightingColorCtrl', type: 'devChange', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { const result = {}; if (msg.data.data['colorTemperature']) { @@ -205,7 +205,7 @@ const converters = { WXKG11LM_click: { cid: 'genOnOff', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { const data = msg.data.data; let clicks; @@ -223,63 +223,63 @@ const converters = { xiaomi_illuminance: { cid: 'msIlluminanceMeasurement', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {illuminance: msg.data.data['measuredValue']}; }, }, xiaomi_pressure: { cid: 'msPressureMeasurement', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {pressure: msg.data.data['measuredValue']}; }, }, WXKG02LM_click: { cid: 'genOnOff', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {click: getKey(model.ep, msg.endpoints[0].epId)}; }, }, WXKG03LM_click: { cid: 'genOnOff', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {click: 'single'}; }, }, SJCGQ11LM_water_leak_basic: { cid: 'genBasic', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {water_leak: msg.data.data['65281']['100'] === 1}; }, }, SJCGQ11LM_water_leak_iaszone: { cid: 'ssIasZone', type: 'statusChange', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {water_leak: msg.data.zoneStatus === 1}; }, }, xiaomi_state: { cid: 'genOnOff', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; }, }, xiaomi_power: { cid: 'genAnalogInput', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {power: precisionRound(msg.data.data['presentValue'], 2)}; }, }, ZNCZ02LM_state: { cid: 'genBasic', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { if (msg.data.data['65281']) { const data = msg.data.data['65281']; return { @@ -295,7 +295,7 @@ const converters = { QBKG04LM_state: { cid: 'genOnOff', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { if (msg.data.data['61440']) { return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; } @@ -304,7 +304,7 @@ const converters = { QBKG03LM_state: { cid: 'genOnOff', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { if (msg.data.data['61440']) { const key = `state_${getKey(model.ep, msg.endpoints[0].epId)}`; const payload = {}; @@ -316,28 +316,28 @@ const converters = { JTYJGD01LMBW_smoke: { cid: 'ssIasZone', type: 'statusChange', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {smoke: msg.data.zoneStatus === 1}; }, }, EDP_power: { cid: 'seMetering', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {power: precisionRound(msg.data.data['instantaneousDemand'], 2)}; }, }, CC2530ROUTER_state: { cid: 'genOnOff', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { return {state: msg.data.data['onOff'] === 1}; }, }, CC2530ROUTER_meta: { cid: 'genBinaryValue', type: 'attReport', - convert: (model, msg) => { + convert: (model, msg, publish, options) => { const data = msg.data.data; return { description: data['description'], @@ -351,52 +351,52 @@ const converters = { ignore_onoff_change: { cid: 'genOnOff', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, ignore_basic_change: { cid: 'genBasic', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, ignore_illuminance_change: { cid: 'msIlluminanceMeasurement', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, ignore_occupancy_change: { cid: 'msOccupancySensing', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, ignore_temperature_change: { cid: 'msTemperatureMeasurement', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, ignore_humidity_change: { cid: 'msRelativeHumidity', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, ignore_pressure_change: { cid: 'msPressureMeasurement', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, ignore_analog_change: { cid: 'genAnalogInput', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, ignore_multistate_change: { cid: 'genMultistateInput', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, ignore_metering_change: { cid: 'seMetering', type: 'devChange', - convert: () => null, + convert: (model, msg, publish, options) => null, }, }; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json new file mode 100644 index 0000000000000..df4d8d412d769 --- /dev/null +++ b/npm-shrinkwrap.json @@ -0,0 +1,1165 @@ +{ + "name": "zigbee-shepherd-converters", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "buffer-from": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", + "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "1.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.6", + "typedarray": "0.0.6" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.3", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.4.1", + "concat-stream": "1.6.2", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.1", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.5.0", + "ignore": "3.3.8", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.11.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.10", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "regexpp": "1.1.0", + "require-uncached": "1.0.3", + "semver": "5.5.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + } + }, + "eslint-config-google": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.9.1.tgz", + "integrity": "sha512-5A83D+lH0PA81QMESKbLJd/a3ic8tPZtwUmqNrxMRo54nfFaUvtt89q/+icQ+fd66c2xQHn0KyFkzJDoAUfpZA==", + "dev": true + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "5.5.3", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.23", + "tmp": "0.0.33" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "globals": { + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "dev": true + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", + "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.2.0", + "figures": "2.0.0", + "lodash": "4.17.10", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "dev": true + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + } + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.4.1", + "lodash": "4.17.10", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000000..3a9f5cdb3ea78 --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "name": "zigbee-shepherd-converters", + "version": "0.1.0", + "description": "Collection of device converters to be used with zigbee-shepherd", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/Koenkk/zigbee-shepherd-converters.git" + }, + "keywords": [ + "xiaomi", + "tradfri", + "hue", + "wemo", + "zigbee", + "zigbee-shepherd" + ], + "scripts": { + "verify": "node test/verify.js", + "eslint": "node_modules/.bin/eslint ." + }, + "author": "Koen Kanters", + "license": "MIT", + "bugs": { + "url": "https://github.com/Koenkk/zigbee-shepherd-converters/issues" + }, + "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", + "dependencies": {}, + "devDependencies": { + "eslint": "*", + "eslint-config-google": "*" + } +} diff --git a/test/verify.js b/test/verify.js new file mode 100644 index 0000000000000..2ed8dffa821d8 --- /dev/null +++ b/test/verify.js @@ -0,0 +1,45 @@ +const devices = require('../devices'); +const assert = require('assert'); + +function verifyKeys(expected, actual, id) { + expected.forEach((key) => { + assert.strictEqual(actual.includes(key), true, `${id}: missing key '${key}'`); + }); +} + +Object.keys(devices).forEach((deviceKey) => { + const device = devices[deviceKey]; + + // Verify device attributes. + verifyKeys( + ['model', 'vendor', 'description', 'supports', 'fromZigbee', 'toZigbee'], + Object.keys(device), + device.model, + ); + + // Verify fromConverters + Object.keys(device.fromZigbee).forEach((converterKey) => { + const converter = device.fromZigbee[converterKey]; + + verifyKeys( + ['cid', 'type', 'convert'], + Object.keys(converter), + converterKey, + ); + + assert.strictEqual(4, converter.convert.length, `${converterKey}: convert() invalid arguments length`); + }); + + // Verify toConverters + Object.keys(device.toZigbee).forEach((converterKey) => { + const converter = device.toZigbee[converterKey]; + + verifyKeys( + ['key', 'convert'], + Object.keys(converter), + converterKey, + ); + + assert.strictEqual(1, converter.convert.length, `${converterKey}: convert() invalid arguments length`); + }); +}); From 3e9a060b9f79196fe5fda8e05d80ca174da5f897 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 24 May 2018 12:23:29 +0200 Subject: [PATCH 004/676] NPM publish config. --- .travis.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.travis.yml b/.travis.yml index e26538873a403..dfe71edc69f8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,3 +9,12 @@ install: script: - npm run verify - npm run eslint + +deploy: + provider: npm + email: "koenkanters94@gmail.com" + api_key: + secure: GUsmI/vpO8Gk90AgDZim2kXG5ZPN9fAUhJ2VMP1czDyYEC4M7y/Eg4irWsdA1mLeGzdCNVetyXt2X5JOkb/xuCbfodVk6fZvbTxJiqwt+OAf0QlrWGEpAjfJfwRhiWY8EfdrUViEEvjIGfqmJRQlp+gRD/5bB+VRD5k5zbLoFEdcp9Cd4EH0L8EnldG64ZFtE8hMRX6J2YVlO9VK98yTlAq4l9vEFEjLI+cNrWK8h9X8auju7giRCNnOItWLHMN6rsnF0PBTx0XCy2BoaRBVAsFewHQUTjcs8AeFGATCtf+rbQwRFLSq65BGmApYzoR5wINHz/T2JocJrjH7Pgoj0sdmL5apl5T2jLIfIzmhF2A/N8oiuotFaltj7zqYYVr4gR0N26UJg0jQQQnnufbTGXIQvm8ov2FBZp3i6mor3vCZhEe6eGfOriG7KkTSMsQKAYkLnTMCibSPYk6moD49eDLzwEUU9FYx/hEl/iHvEIWj4CaWrLBFvykAbwgb83tmYNOnsBD5OzDfj4BEYe8ygkIISkxKtdfCFX/ItpN/bBKDL7sYrHzerHNCxzb8+sXV1ioHo5HbLQQCAtaCpooErCexG/ptmTVAe4v6c0Y6WIIo32QfudBaUyYHzIcGFYBJwOa0A3ECAJkNA18kkmGso0KtverqjbY6vaTgCeeyMBk= + on: + tags: true + branch: master From 164f800ae92b40fc984e6d3bd6a77c948b5fd336 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 24 May 2018 12:32:16 +0200 Subject: [PATCH 005/676] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c0eb9aeb5e955..9cd614d798cbc 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ +[![NPM](https://nodei.co/npm/zigbee-shepherd-converters.png)](https://nodei.co/npm/zigbee-shepherd-converters/) + # zigbee-shepherd-converters Collection of device converters to be used with zigbee-shepherd From 015cfedf8d0bd5ce1f8634901e4d63aa80cb4054 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 24 May 2018 12:57:51 +0200 Subject: [PATCH 006/676] add index.js --- index.js | 3 +++ package.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000000000..c988336dc35a3 --- /dev/null +++ b/index.js @@ -0,0 +1,3 @@ +module.exports = { + devices: require('./devices'), +}; diff --git a/package.json b/package.json index 3a9f5cdb3ea78..10630011ce0d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.0", + "version": "0.1.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 7d307b8afacde5402f031b7cfebeb3fe4a9513a0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 24 May 2018 13:01:20 +0200 Subject: [PATCH 007/676] npm shrinkwrap update package version. --- npm-shrinkwrap.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index df4d8d412d769..910249e3e1544 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { From 719a760447ee9bbc7da52d23cced3ce8d6376a97 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 26 May 2018 10:49:25 +0200 Subject: [PATCH 008/676] Support LIGHTIFY LED A19 tunable white. --- devices.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/devices.js b/devices.js index 038942cbae96a..872a01eba4b6d 100644 --- a/devices.js +++ b/devices.js @@ -263,6 +263,16 @@ const devices = { fromZigbee: [fz.CC2530ROUTER_state, fz.CC2530ROUTER_meta], toZigbee: [], }, + + // OSRAM + 'LIGHTIFY A19 Tunable White': { + model: 'AA70155', + vendor: 'OSRAM', + description: 'LIGHTIFY LED A19 tunable white', + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], + }, }; module.exports = devices; From 86aeeb4adbb2a7443323d4ca1f09ada3a8adcf5f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 26 May 2018 10:51:09 +0200 Subject: [PATCH 009/676] Support OSRAM Classic A60 RGBW. --- devices.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devices.js b/devices.js index 872a01eba4b6d..80b6ff7274605 100644 --- a/devices.js +++ b/devices.js @@ -273,6 +273,14 @@ const devices = { fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], }, + 'Classic A60 RGBW': { + model: 'AA69697', + vendor: 'OSRAM', + description: 'Classic A60 RGBW', + supports: 'on/off, brightness, color temperature, color xy', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color], + }, }; module.exports = devices; From bacd81b23f0b2547171a5fc3c8d2856f30f5a3cd Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 26 May 2018 10:51:53 +0200 Subject: [PATCH 010/676] Bump to 0.1.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 910249e3e1544..0546d52b77bdd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 10630011ce0d8..a726f34884d1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.1", + "version": "0.1.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From c9b2fb6459b90168a7d0306550d39be7990226e3 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 26 May 2018 16:09:41 +0200 Subject: [PATCH 011/676] Add Classic A60 TW --- devices.js | 20 ++++++++++++-------- npm-shrinkwrap.json | 2 +- package.json | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/devices.js b/devices.js index 80b6ff7274605..bdd43821e9220 100644 --- a/devices.js +++ b/devices.js @@ -19,6 +19,15 @@ const LED1536G5 = { toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], }; +const AA70155 = { + model: 'AA70155', + vendor: 'OSRAM', + description: 'LIGHTIFY LED A19 tunable white / Classic A60 TW', + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], +}; + const devices = { // Xiaomi 'lumi.sensor_switch': { @@ -265,14 +274,6 @@ const devices = { }, // OSRAM - 'LIGHTIFY A19 Tunable White': { - model: 'AA70155', - vendor: 'OSRAM', - description: 'LIGHTIFY LED A19 tunable white', - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], - }, 'Classic A60 RGBW': { model: 'AA69697', vendor: 'OSRAM', @@ -281,6 +282,9 @@ const devices = { fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color], }, + // AA70155 is model number of both bulbs. + 'LIGHTIFY A19 Tunable White': AA70155, + 'Classic A60 TW': AA70155, }; module.exports = devices; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0546d52b77bdd..c92293733efe3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.2", + "version": "0.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a726f34884d1f..38e7ad5bdb074 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.2", + "version": "0.1.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 00318d479869393891104ab8ad551212258a1971 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 27 May 2018 17:12:26 +0200 Subject: [PATCH 012/676] Suport Hive Active light dimmable. https://github.com/Koenkk/zigbee2mqtt/issues/68 --- devices.js | 10 ++++++++++ npm-shrinkwrap.json | 2 +- package.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index bdd43821e9220..cffd55f8c9cc2 100644 --- a/devices.js +++ b/devices.js @@ -285,6 +285,16 @@ const devices = { // AA70155 is model number of both bulbs. 'LIGHTIFY A19 Tunable White': AA70155, 'Classic A60 TW': AA70155, + + // Hive + 'FWBulb01': { + model: 'HALIGHTDIMWWE27', + vendor: 'Hive', + description: 'Active light dimmable', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness], + }, }; module.exports = devices; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c92293733efe3..9b264c62d5ae0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.3", + "version": "0.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 38e7ad5bdb074..533cf3de79724 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.3", + "version": "0.1.4", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 0aaf54e8676df09d5dea6622f54c8421bdba2fc5 Mon Sep 17 00:00:00 2001 From: Viet Dzung Date: Mon, 28 May 2018 13:55:28 +0700 Subject: [PATCH 013/676] Add Xiaomi button with gyro WXKG12LM --- converters/fromZigbee.js | 26 ++++++++++++++++++++++++++ devices.js | 18 ++++++++++++++++++ package.json | 4 ++-- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3d8734a8e489d..2b8961fe75963 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -139,6 +139,32 @@ const converters = { return {action: value < 0 ? 'rotate_left' : 'rotate_right'}; }, }, + WXKG12LM_action_multistate: { + cid: 'genMultistateInput', + type: 'attReport', + convert: (model, msg, publish, options) => { + /* + presentValue = 1 = Single click + presentValue = 2 = Double click + presentValue = 16 = Hold for more 400ms + presentValue = 17 = Release after hold for more 400ms + presentValue = 18 = Shake + */ + const value = msg.data.data['presentValue']; + let action = null; + + if (value === 1) { + publish({click: 'single'}); + action = null; + } else if (value === 2) { + publish({click: 'double'}); + action = null; + } else if (value === 16) action = 'hold'; + else if (value === 17) action = 'release'; + else if (value === 18) action = 'shake'; + return action ? {'action': action} : null; + }, + }, xiaomi_humidity: { cid: 'msRelativeHumidity', type: 'attReport', diff --git a/devices.js b/devices.js index cffd55f8c9cc2..fd73b66a15131 100644 --- a/devices.js +++ b/devices.js @@ -46,6 +46,24 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG11LM_click, fz.ignore_onoff_change, fz.ignore_basic_change], toZigbee: [], }, + 'lumi.sensor_switch.aq3': { + model: 'WXKG12LM', + vendor: 'Xiaomi', + description: 'Aqara wireless switch with gyro', + supports: 'single, double, shake, hold, release', + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG12LM_action_multistate, + fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_multistate_change], + toZigbee: [], + }, + 'lumi.sensor_swit': { + model: 'WXKG12LM', + vendor: 'Xiaomi', + description: 'Aqara wireless switch with gyro', + supports: 'single, double, shake, hold, release', + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG12LM_action_multistate, + fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_multistate_change], + toZigbee: [], + }, 'lumi.sensor_86sw1\u0000lu': { model: 'WXKG03LM', vendor: 'Xiaomi', diff --git a/package.json b/package.json index 533cf3de79724..a3d50b51715d5 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", "dependencies": {}, "devDependencies": { - "eslint": "*", - "eslint-config-google": "*" + "eslint": "^4.19.1", + "eslint-config-google": "^0.9.1" } } From a50337e61a47b760a95282e4c97e48632ada3a8e Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 28 May 2018 18:16:56 +0200 Subject: [PATCH 014/676] Refactor WXKG12LM --- converters/fromZigbee.js | 28 +++++++++------------------- devices.js | 35 +++++++++++++++++------------------ package.json | 4 ++-- 3 files changed, 28 insertions(+), 39 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 2b8961fe75963..0c67a5c307332 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -139,30 +139,20 @@ const converters = { return {action: value < 0 ? 'rotate_left' : 'rotate_right'}; }, }, - WXKG12LM_action_multistate: { + WXKG12LM_action_click_multistate: { cid: 'genMultistateInput', type: 'attReport', convert: (model, msg, publish, options) => { - /* - presentValue = 1 = Single click - presentValue = 2 = Double click - presentValue = 16 = Hold for more 400ms - presentValue = 17 = Release after hold for more 400ms - presentValue = 18 = Shake - */ const value = msg.data.data['presentValue']; - let action = null; + const lookup = { + 1: {click: 'single'}, // single click + 2: {click: 'double'}, // double click + 16: {action: 'hold'}, // hold for more than 400ms + 17: {action: 'release'}, // release after hold for more than 400ms + 18: {action: 'shake'}, // shake + }; - if (value === 1) { - publish({click: 'single'}); - action = null; - } else if (value === 2) { - publish({click: 'double'}); - action = null; - } else if (value === 16) action = 'hold'; - else if (value === 17) action = 'release'; - else if (value === 18) action = 'shake'; - return action ? {'action': action} : null; + return lookup[value] ? lookup[value] : null; }, }, xiaomi_humidity: { diff --git a/devices.js b/devices.js index fd73b66a15131..85b53ad4b8a29 100644 --- a/devices.js +++ b/devices.js @@ -28,6 +28,18 @@ const AA70155 = { toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], }; +const WXKG12LM = { + model: 'WXKG12LM', + vendor: 'Xiaomi', + description: 'Aqara wireless switch (with gyroscope)', + supports: 'single, double, shake, hold, release', + fromZigbee: [ + fz.xiaomi_battery_3v, fz.WXKG12LM_action_click_multistate, fz.ignore_onoff_change, + fz.ignore_basic_change, fz.ignore_multistate_change, + ], + toZigbee: [], +}; + const devices = { // Xiaomi 'lumi.sensor_switch': { @@ -46,24 +58,11 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG11LM_click, fz.ignore_onoff_change, fz.ignore_basic_change], toZigbee: [], }, - 'lumi.sensor_switch.aq3': { - model: 'WXKG12LM', - vendor: 'Xiaomi', - description: 'Aqara wireless switch with gyro', - supports: 'single, double, shake, hold, release', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG12LM_action_multistate, - fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_multistate_change], - toZigbee: [], - }, - 'lumi.sensor_swit': { - model: 'WXKG12LM', - vendor: 'Xiaomi', - description: 'Aqara wireless switch with gyro', - supports: 'single, double, shake, hold, release', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG12LM_action_multistate, - fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_multistate_change], - toZigbee: [], - }, + // WXKG12LM uses 2 model IDs. + // https://github.com/Koenkk/zigbee-shepherd-converters/pull/3/files#diff-6c9a6acf22f90d1c6e524d9f3c5c1745R58 + // https://github.com/dresden-elektronik/deconz-rest-plugin/issues/448 + 'lumi.sensor_switch.aq3': WXKG12LM, + 'lumi.sensor_swit': WXKG12LM, 'lumi.sensor_86sw1\u0000lu': { model: 'WXKG03LM', vendor: 'Xiaomi', diff --git a/package.json b/package.json index a3d50b51715d5..533cf3de79724 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", "dependencies": {}, "devDependencies": { - "eslint": "^4.19.1", - "eslint-config-google": "^0.9.1" + "eslint": "*", + "eslint-config-google": "*" } } From 657f16016eedb37707af9b3ed8f87298a8162d80 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 28 May 2018 19:27:49 +0200 Subject: [PATCH 015/676] WXKG01LM: add long_release. https://github.com/Koenkk/zigbee2mqtt/issues/71 --- converters/fromZigbee.js | 20 +++++++++++++++----- devices.js | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 0c67a5c307332..8694f658c4d87 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -63,16 +63,26 @@ const converters = { const deviceID = msg.endpoints[0].device.ieeeAddr; const state = msg.data.data['onOff']; + if (!store[deviceID]) { + store[deviceID] = {}; + } + // 0 = click down, 1 = click up, else = multiple clicks if (state === 0) { - store[deviceID] = setTimeout(() => { + store[deviceID].timer = setTimeout(() => { publish({click: 'long'}); - store[deviceID] = null; + store[deviceID].timer = null; + store[deviceID].long = true; }, 300); // After 300 milliseconds of not releasing we assume long click. } else if (state === 1) { - if (store[deviceID]) { - clearTimeout(store[deviceID]); - store[deviceID] = null; + if (store[deviceID].long) { + publish({click: 'long_release'}); + store[deviceID].long = false; + } + + if (store[deviceID].timer) { + clearTimeout(store[deviceID].timer); + store[deviceID].timer = null; publish({click: 'single'}); } } else { diff --git a/devices.js b/devices.js index 85b53ad4b8a29..36533c400a169 100644 --- a/devices.js +++ b/devices.js @@ -46,7 +46,7 @@ const devices = { model: 'WXKG01LM', vendor: 'Xiaomi', description: 'MiJia wireless switch', - supports: 'single, double, triple, quadruple, many and long click', + supports: 'single, double, triple, quadruple, many, long, long_release click', fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG01LM_click, fz.ignore_onoff_change, fz.ignore_basic_change], toZigbee: [], }, From fb1b2a56afcff11fbdab2cfba7a3afca4f610fe1 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 28 May 2018 19:29:52 +0200 Subject: [PATCH 016/676] Xiaomi battery: also return voltage. https://github.com/Koenkk/zigbee2mqtt/issues/71 --- converters/fromZigbee.js | 5 ++++- npm-shrinkwrap.json | 2 +- package.json | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 8694f658c4d87..33d8b309465b9 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -52,7 +52,10 @@ const converters = { } if (voltage) { - return {battery: toPercentage(voltage, battery3V.min, battery3V.max)}; + return { + battery: toPercentage(voltage, battery3V.min, battery3V.max), + voltage: voltage, + }; } }, }, diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9b264c62d5ae0..a861b6f8807c5 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.4", + "version": "0.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 533cf3de79724..616c8cba9a791 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.4", + "version": "0.1.5", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 41c2e116df9fe47cf1c7930b5c86fb2f2e119afd Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 28 May 2018 19:54:14 +0200 Subject: [PATCH 017/676] Add OSRAM Smart+ plug (AB3257001NJ). #62 --- converters/fromZigbee.js | 8 ++++++++ devices.js | 8 ++++++++ npm-shrinkwrap.json | 2 +- package.json | 2 +- 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 33d8b309465b9..992ba9a867210 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -375,6 +375,14 @@ const converters = { }; }, }, + AB3257001NJ_state: { + cid: 'genOnOff', + type: 'attReport', + convert: (model, msg, publish, options) => { + // eslint-disable-next-line no-console + console.log('PLEASE REPORT THIS IN https://github.com/Koenkk/zigbee2mqtt/issues/62', msg.data); + }, + }, // Ignore converters (these message dont need parsing). ignore_onoff_change: { diff --git a/devices.js b/devices.js index 36533c400a169..ee91efbde639d 100644 --- a/devices.js +++ b/devices.js @@ -302,6 +302,14 @@ const devices = { // AA70155 is model number of both bulbs. 'LIGHTIFY A19 Tunable White': AA70155, 'Classic A60 TW': AA70155, + 'Plug 01': { + model: 'AB3257001NJ', + description: 'Smart+ plug', + supports: 'on/off', + vendor: 'OSRAM', + fromZigbee: [fz.AB3257001NJ_state], + toZigbee: [tz.onoff], + }, // Hive 'FWBulb01': { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a861b6f8807c5..03005a871cbbc 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 616c8cba9a791..79c8f3f680316 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.5", + "version": "0.1.6", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 0fc5c7928145b08a7dae76416422f1cb293dd584 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 29 May 2018 19:08:13 +0200 Subject: [PATCH 018/676] WXKG01LM: Add duration for long_release. #71 --- converters/fromZigbee.js | 5 +++-- npm-shrinkwrap.json | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 992ba9a867210..81be81a9700f4 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -75,11 +75,12 @@ const converters = { store[deviceID].timer = setTimeout(() => { publish({click: 'long'}); store[deviceID].timer = null; - store[deviceID].long = true; + store[deviceID].long = Date.now(); }, 300); // After 300 milliseconds of not releasing we assume long click. } else if (state === 1) { if (store[deviceID].long) { - publish({click: 'long_release'}); + const duration = Date.now() - store[deviceID].long; + publish({click: 'long_release', duration: duration}); store[deviceID].long = false; } diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 03005a871cbbc..e2bf51477d764 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.6", + "version": "0.1.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 79c8f3f680316..23bfad75176e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.6", + "version": "0.1.7", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 4824610772f65b88ba4eb2dc6f72ad1379a36e6e Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 30 May 2018 21:58:00 +0200 Subject: [PATCH 019/676] Support light transitions. https://github.com/Koenkk/zigbee2mqtt/issues/72 --- converters/fromZigbee.js | 15 ++++++++++----- converters/toZigbee.js | 25 ++++++++++++++++++------- devices.js | 22 +++++++++++----------- npm-shrinkwrap.json | 2 +- package.json | 2 +- test/verify.js | 4 ++-- 6 files changed, 43 insertions(+), 27 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 81be81a9700f4..fe6f791627809 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -222,11 +222,16 @@ const converters = { result.color_temp = msg.data.data['colorTemperature']; } - if (msg.data.data['currentX'] && msg.data.data['currentY']) { - result.color = { - x: precisionRound(msg.data.data['currentX'] / 65535, 3), - y: precisionRound(msg.data.data['currentY'] / 65535, 3), - }; + if (msg.data.data['currentX'] || msg.data.data['currentY']) { + result.color = {}; + + if (msg.data.data['currentX']) { + result.color.x = precisionRound(msg.data.data['currentX'] / 65535, 3); + } + + if (msg.data.data['currentY']) { + result.color.y = precisionRound(msg.data.data['currentY'] / 65535, 3); + } } return result; diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 888458f6a07ad..94af06648aa0d 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,7 +1,8 @@ const converters = { onoff: { key: 'state', - convert: (value) => { + attr: ['onOff'], + convert: (value, message) => { return { cid: 'genOnOff', cmd: value.toLowerCase(), @@ -11,44 +12,54 @@ const converters = { }, light_brightness: { key: 'brightness', - convert: (value) => { + attr: ['currentLevel'], + convert: (value, message) => { return { cid: 'genLevelCtrl', cmd: 'moveToLevel', zclData: { level: value, - transtime: 0, + transtime: message.hasOwnProperty('transition') ? message.transition : 0, }, }; }, }, light_colortemp: { key: 'color_temp', - convert: (value) => { + attr: ['colorTemperature'], + convert: (value, message) => { return { cid: 'lightingColorCtrl', cmd: 'moveToColorTemp', zclData: { colortemp: value, - transtime: 0, + transtime: message.hasOwnProperty('transition') ? message.transition : 0, }, }; }, }, light_color: { key: 'color', - convert: (value) => { + attr: ['currentX', 'currentY'], + convert: (value, message) => { return { cid: 'lightingColorCtrl', cmd: 'moveToColor', zclData: { colorx: value.x * 65535, colory: value.y * 65535, - transtime: 0, + transtime: message.hasOwnProperty('transition') ? message.transition : 0, }, }; }, }, + + // Ignore converters + ignore_transition: { + key: 'transition', + attr: [], + convert: (value, message) => null, + }, }; module.exports = converters; diff --git a/devices.js b/devices.js index ee91efbde639d..dba85537e936c 100644 --- a/devices.js +++ b/devices.js @@ -7,7 +7,7 @@ const LED1623G12 = { description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }; const LED1536G5 = { @@ -16,7 +16,7 @@ const LED1536G5 = { description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable, white spectrum, opal white', supports: 'on/off, brightness, color temperature', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }; const AA70155 = { @@ -25,7 +25,7 @@ const AA70155 = { description: 'LIGHTIFY LED A19 tunable white / Classic A60 TW', supports: 'on/off, brightness, color temperature', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }; const WXKG12LM = { @@ -209,7 +209,7 @@ const devices = { description: 'TRADFRI LED bulb E27 980 lumen, dimmable, white spectrum, opal white', supports: 'on/off, brightness, color temperature', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }, // LED1623G12 uses 2 model IDs, see https://github.com/Koenkk/zigbee2mqtt/issues/21 'TRADFRI bulb E27 opal 1000lm': LED1623G12, @@ -220,7 +220,7 @@ const devices = { description: 'TRADFRI LED bulb GU10 400 lumen, dimmable, white spectrum', supports: 'on/off, brightness, color temperature', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }, 'TRADFRI bulb GU10 W 400lm': { model: 'LED1650R5', @@ -228,7 +228,7 @@ const devices = { description: 'TRADFRI LED bulb GU10 400 lumen, dimmable', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, // LED1536G5 has an E12 and E14 version. 'TRADFRI bulb E14 WS opal 400lm': LED1536G5, @@ -239,7 +239,7 @@ const devices = { description: 'TRADFRI LED bulb E26 1000 lumen, dimmable, opal white', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, // Philips @@ -249,7 +249,7 @@ const devices = { description: 'Hue Go', supports: 'on/off, brightness, color temperature, color xy', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, // Belkin @@ -259,7 +259,7 @@ const devices = { description: 'WeMo smart LED bulb', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, // EDP @@ -297,7 +297,7 @@ const devices = { description: 'Classic A60 RGBW', supports: 'on/off, brightness, color temperature, color xy', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, // AA70155 is model number of both bulbs. 'LIGHTIFY A19 Tunable White': AA70155, @@ -318,7 +318,7 @@ const devices = { description: 'Active light dimmable', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, }; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e2bf51477d764..ce7a2e6e887cd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.7", + "version": "0.1.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 23bfad75176e7..01d31a654239a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.7", + "version": "0.1.8", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { diff --git a/test/verify.js b/test/verify.js index 2ed8dffa821d8..1a48d5355c8ed 100644 --- a/test/verify.js +++ b/test/verify.js @@ -35,11 +35,11 @@ Object.keys(devices).forEach((deviceKey) => { const converter = device.toZigbee[converterKey]; verifyKeys( - ['key', 'convert'], + ['key', 'convert', 'attr'], Object.keys(converter), converterKey, ); - assert.strictEqual(1, converter.convert.length, `${converterKey}: convert() invalid arguments length`); + assert.strictEqual(2, converter.convert.length, `${converterKey}: convert() invalid arguments length`); }); }); From f5b89bb901e5661b714cc80790d93b1d2f5af5c3 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 30 May 2018 22:21:32 +0200 Subject: [PATCH 020/676] Light transition time in seconds. --- converters/toZigbee.js | 6 +++--- npm-shrinkwrap.json | 2 +- package.json | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 94af06648aa0d..0f15b7ad7df39 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -19,7 +19,7 @@ const converters = { cmd: 'moveToLevel', zclData: { level: value, - transtime: message.hasOwnProperty('transition') ? message.transition : 0, + transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, }; }, @@ -33,7 +33,7 @@ const converters = { cmd: 'moveToColorTemp', zclData: { colortemp: value, - transtime: message.hasOwnProperty('transition') ? message.transition : 0, + transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, }; }, @@ -48,7 +48,7 @@ const converters = { zclData: { colorx: value.x * 65535, colory: value.y * 65535, - transtime: message.hasOwnProperty('transition') ? message.transition : 0, + transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, }; }, diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ce7a2e6e887cd..afa75eb0ef30f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.8", + "version": "0.1.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 01d31a654239a..8ee0e0da3a811 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.8", + "version": "0.1.9", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 4d87d44417277a5e0a9d24b15070096cbef0713c Mon Sep 17 00:00:00 2001 From: James Yoneda Date: Thu, 31 May 2018 00:29:21 -0400 Subject: [PATCH 021/676] Fix for #4 - correct modelID for Xiaomi Aqara double wireless wall switch (WXKG02LM). --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index dba85537e936c..0e804c29b0744 100644 --- a/devices.js +++ b/devices.js @@ -71,7 +71,7 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG03LM_click], toZigbee: [], }, - 'lumi.sensor_86sw2\u0000Un': { + 'lumi.sensor_86sw2.es1': { model: 'WXKG02LM', vendor: 'Xiaomi', description: 'Aqara double key wireless wall switch', From bf1bbd5dd7707696a48ae7801bf4c7fc9c5b4331 Mon Sep 17 00:00:00 2001 From: Jonathan Gilbert Date: Thu, 31 May 2018 20:39:17 +1000 Subject: [PATCH 022/676] Added support for Philips Hue White Single bulb B22 --- devices.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devices.js b/devices.js index 0e804c29b0744..382f410310c29 100644 --- a/devices.js +++ b/devices.js @@ -251,6 +251,14 @@ const devices = { fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, + 'LWB010': { + model: '8718696449691', + vendor: 'Philips', + description: 'Hue White Single bulb B22', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness], + }, // Belkin 'MZ100': { From 8fd7e004ec1a86088879bce22881710661ec1c1c Mon Sep 17 00:00:00 2001 From: Jonathan Gilbert Date: Thu, 31 May 2018 20:43:32 +1000 Subject: [PATCH 023/676] Removed trailing spaces --- devices.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/devices.js b/devices.js index 382f410310c29..cd0aa4e4d73f5 100644 --- a/devices.js +++ b/devices.js @@ -251,13 +251,13 @@ const devices = { fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, - 'LWB010': { - model: '8718696449691', - vendor: 'Philips', - description: 'Hue White Single bulb B22', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness], + 'LWB010': { + model: '8718696449691', + vendor: 'Philips', + description: 'Hue White Single bulb B22', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness], }, // Belkin From 59bc96bb0b5d8c18f999b8302f751d46b9b30fd9 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 31 May 2018 18:54:42 +0200 Subject: [PATCH 024/676] Add tz.ignore_transition for LWB010 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index cd0aa4e4d73f5..d7cd841e5506c 100644 --- a/devices.js +++ b/devices.js @@ -257,7 +257,7 @@ const devices = { description: 'Hue White Single bulb B22', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, // Belkin From 69343f9ba64a96c87b4ac5d16ac35cb08e58417f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 31 May 2018 19:02:09 +0200 Subject: [PATCH 025/676] 2 modelIDs for WXKG02LM --- devices.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/devices.js b/devices.js index d7cd841e5506c..d39185cd8a9ac 100644 --- a/devices.js +++ b/devices.js @@ -40,6 +40,16 @@ const WXKG12LM = { toZigbee: [], }; +const WXKG02LM = { + model: 'WXKG02LM', + vendor: 'Xiaomi', + description: 'Aqara double key wireless wall switch', + supports: 'left, right and both click', + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG02LM_click], + toZigbee: [], + ep: {'left': 1, 'right': 2, 'both': 3}, +}; + const devices = { // Xiaomi 'lumi.sensor_switch': { @@ -71,15 +81,10 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG03LM_click], toZigbee: [], }, - 'lumi.sensor_86sw2.es1': { - model: 'WXKG02LM', - vendor: 'Xiaomi', - description: 'Aqara double key wireless wall switch', - supports: 'left, right and both click', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG02LM_click], - toZigbee: [], - ep: {'left': 1, 'right': 2, 'both': 3}, - }, + // WXKG02LM uses 2 model IDs. + // https://github.com/Koenkk/zigbee-shepherd-converters/pull/5 + 'lumi.sensor_86sw2\u0000Un': WXKG02LM, + 'lumi.sensor_86sw2.es1': WXKG02LM, 'lumi.ctrl_neutral1': { model: 'QBKG04LM', vendor: 'Xiaomi', From ba5744e02b115880b3b72326643dc200ddeb26c9 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 31 May 2018 19:08:29 +0200 Subject: [PATCH 026/676] Bump version to 0.1.10 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index afa75eb0ef30f..b9874c9273091 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.9", + "version": "0.1.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8ee0e0da3a811..b26f3e1acd42b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.9", + "version": "0.1.10", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From a89ce1edf356531973f0e8e82a203cb2d246eaf7 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 1 Jun 2018 21:22:53 +0200 Subject: [PATCH 027/676] Support Innr E27 Bulb RGBW (RB 185 C). --- devices.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/devices.js b/devices.js index d39185cd8a9ac..ef563da5e2363 100644 --- a/devices.js +++ b/devices.js @@ -333,6 +333,16 @@ const devices = { fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, + + // Innr + 'RB 185 C': { + model: 'RB 185 C', + vendor: 'Innr', + description: 'E27 Bulb RGBW', + supports: 'on/off, brightness, color temperature, color xy', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + }, }; module.exports = devices; From a49bbb65bfcb6dd321742b781a2f3d9dc5c3020a Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 1 Jun 2018 21:42:08 +0200 Subject: [PATCH 028/676] Support Philips Hue white and color ambiance E27 (9290012573A). --- devices.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devices.js b/devices.js index ef563da5e2363..19efdf785787c 100644 --- a/devices.js +++ b/devices.js @@ -264,6 +264,14 @@ const devices = { fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, + 'LCT015': { + model: '9290012573A', + vendor: 'Philips', + description: 'Hue white and color ambiance E27', + supports: 'on/off, brightness, color temperature, color xy', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + }, // Belkin 'MZ100': { From e5420af1eee221710917a650970d947043988693 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 1 Jun 2018 21:58:01 +0200 Subject: [PATCH 029/676] Support TRADFRI LED bulb E27 600 lumen, dimmable, color, opal white (LED1624G9) --- devices.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devices.js b/devices.js index 19efdf785787c..d121c44249a59 100644 --- a/devices.js +++ b/devices.js @@ -246,6 +246,14 @@ const devices = { fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, + 'TRADFRI bulb E27 CWS opal 600lm': { + model: 'LED1624G9', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E27 600 lumen, dimmable, color, opal white', + supports: 'on/off, brightness, color temperature, color xy', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_color, tz.ignore_transition], + }, // Philips 'LLC020': { From 9384e44738e6247ae741ddf5d53ce3c202c8b0de Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 1 Jun 2018 22:01:56 +0200 Subject: [PATCH 030/676] 0.1.11 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b9874c9273091..8d2b8e017abb8 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.10", + "version": "0.1.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b26f3e1acd42b..c84f7286bff9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.10", + "version": "0.1.11", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From cc1621df6f637d7b09feaa0959db2f69f5c0dd14 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 1 Jun 2018 22:23:50 +0200 Subject: [PATCH 031/676] LED1624G9 doesn't support color temperature. --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index d121c44249a59..13e86ffd83c43 100644 --- a/devices.js +++ b/devices.js @@ -250,7 +250,7 @@ const devices = { model: 'LED1624G9', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 600 lumen, dimmable, color, opal white', - supports: 'on/off, brightness, color temperature, color xy', + supports: 'on/off, brightness, color xy', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_color, tz.ignore_transition], }, From 042d75cef8aa54bf219f9a44c34d98af84aec2d0 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Sat, 2 Jun 2018 09:51:17 +0300 Subject: [PATCH 032/676] lumi.pluf and lumi.ctrl_86plug.aq1 has same events. may be bug in name "lumi.ctrl_86plug" without "aq1", or it other device? --- converters/fromZigbee.js | 4 ++-- devices.js | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index fe6f791627809..c9e193a1ae290 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -182,7 +182,7 @@ const converters = { convert: (model, msg, publish, options) => { // The occupancy sensor only sends a message when motion detected. // Therefore we need to publish the no_motion detected by ourselves. - const timeout = options.occupancy_timeout ? options.occupancy_timeout : occupancyTimeout; + const timeout = (options && options.occupancy_timeout) ? options.occupancy_timeout : occupancyTimeout; const deviceID = msg.endpoints[0].device.ieeeAddr; // Stop existing timer because motion is detected and set a new one. @@ -311,7 +311,7 @@ const converters = { return {power: precisionRound(msg.data.data['presentValue'], 2)}; }, }, - ZNCZ02LM_state: { + xiaomi_plug_state: { cid: 'genBasic', type: 'attReport', convert: (model, msg, publish, options) => { diff --git a/devices.js b/devices.js index 13e86ffd83c43..3e839c330a47c 100644 --- a/devices.js +++ b/devices.js @@ -185,17 +185,20 @@ const devices = { supports: 'on/off, power measurement', vendor: 'Xiaomi', fromZigbee: [ - fz.xiaomi_state, fz.xiaomi_power, fz.ZNCZ02LM_state, fz.ignore_onoff_change, + fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_analog_change, ], toZigbee: [tz.onoff], }, - 'lumi.ctrl_86plug': { + 'lumi.ctrl_86plug.aq1': { model: 'QBCZ11LM', description: 'Aqara socket Zigbee', supports: 'on/off, power measurement', vendor: 'Xiaomi', - fromZigbee: [fz.xiaomi_state, fz.xiaomi_power, fz.ignore_onoff_change, fz.ignore_analog_change], + fromZigbee: [ + fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, + fz.ignore_basic_change, fz.ignore_analog_change + ], toZigbee: [tz.onoff], }, 'lumi.sensor_smoke': { From 4e3e2c4f02928498fe58b35017eee365664c7099 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Sat, 2 Jun 2018 20:42:10 +0300 Subject: [PATCH 033/676] One config for 'lumi.ctrl_86plug' and 'lumi.ctrl_86plug.aq1' --- devices.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/devices.js b/devices.js index 3e839c330a47c..32b20687ff7f8 100644 --- a/devices.js +++ b/devices.js @@ -50,6 +50,18 @@ const WXKG02LM = { ep: {'left': 1, 'right': 2, 'both': 3}, }; +const QBCZ11LM = { + model: 'QBCZ11LM', + description: 'Aqara socket Zigbee', + supports: 'on/off, power measurement', + vendor: 'Xiaomi', + fromZigbee: [ + fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, + fz.ignore_basic_change, fz.ignore_analog_change + ], + toZigbee: [tz.onoff], +}; + const devices = { // Xiaomi 'lumi.sensor_switch': { @@ -190,17 +202,8 @@ const devices = { ], toZigbee: [tz.onoff], }, - 'lumi.ctrl_86plug.aq1': { - model: 'QBCZ11LM', - description: 'Aqara socket Zigbee', - supports: 'on/off, power measurement', - vendor: 'Xiaomi', - fromZigbee: [ - fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, - fz.ignore_basic_change, fz.ignore_analog_change - ], - toZigbee: [tz.onoff], - }, + 'lumi.ctrl_86plug': QBCZ11LM, + 'lumi.ctrl_86plug.aq1': QBCZ11LM, 'lumi.sensor_smoke': { model: 'JTYJ-GD-01LM/BW', description: 'MiJia Honeywell smoke detector', From 15aeb163be36dc40839cf2031bca5c7d8161bb15 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 2 Jun 2018 19:49:52 +0200 Subject: [PATCH 034/676] Update QBCZ11LM --- devices.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 32b20687ff7f8..c2c910ad409c0 100644 --- a/devices.js +++ b/devices.js @@ -56,8 +56,8 @@ const QBCZ11LM = { supports: 'on/off, power measurement', vendor: 'Xiaomi', fromZigbee: [ - fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, - fz.ignore_basic_change, fz.ignore_analog_change + fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, + fz.ignore_basic_change, fz.ignore_analog_change, ], toZigbee: [tz.onoff], }; @@ -202,6 +202,7 @@ const devices = { ], toZigbee: [tz.onoff], }, + // QBCZ11LM has 2 modelID's: https://github.com/Koenkk/zigbee-shepherd-converters/pull/8 'lumi.ctrl_86plug': QBCZ11LM, 'lumi.ctrl_86plug.aq1': QBCZ11LM, 'lumi.sensor_smoke': { From 04d042c34b91a2a19814774fc7d5832a8fd0ea04 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 2 Jun 2018 19:52:33 +0200 Subject: [PATCH 035/676] Bump version. --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8d2b8e017abb8..4c323e2e753b8 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.11", + "version": "0.1.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c84f7286bff9b..9d5e365d3233b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.11", + "version": "0.1.12", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 4897a1f60e3edc485d20a101ac36b32ad8f40d11 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Sun, 3 Jun 2018 14:45:16 +0300 Subject: [PATCH 036/676] Button events for QBKG03LM: hold, release --- converters/fromZigbee.js | 12 ++++++++++++ devices.js | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index c9e193a1ae290..4e5a88e00d550 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -348,6 +348,18 @@ const converters = { } }, }, + QBKG03LM_buttons: { + cid: 'genOnOff', + type: 'devChange', + convert: (model, msg, publish, options) => { + const key = getKey(model.buttonsEp, msg.endpoints[0].epId); + if (key) { + const payload = {}; + payload['button_'+key] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; + return payload; + } + }, + }, JTYJGD01LMBW_smoke: { cid: 'ssIasZone', type: 'statusChange', diff --git a/devices.js b/devices.js index c2c910ad409c0..a370a7d181b63 100644 --- a/devices.js +++ b/devices.js @@ -111,9 +111,10 @@ const devices = { vendor: 'Xiaomi', description: 'Aqara double key wired wall switch', supports: 'l1 and l2 on/off', - fromZigbee: [fz.QBKG03LM_state, fz.ignore_onoff_change], + fromZigbee: [fz.QBKG03LM_state, fz.QBKG03LM_buttons], toZigbee: [tz.onoff], ep: {'l1': 2, 'l2': 3}, + buttonsEp: {'left': 4, 'right': 5}, }, 'lumi.sens': { model: 'WSDCGQ01LM', From ceaaae89422a9b1a58e187a1281d358fe2121a40 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Sun, 3 Jun 2018 20:23:51 +0300 Subject: [PATCH 037/676] Cube events sides and angel of rotation. May be useful --- converters/fromZigbee.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 4e5a88e00d550..0463ce111a296 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -130,15 +130,15 @@ const converters = { const value = msg.data.data['presentValue']; let action = null; - if (value === 0) action = 'shake'; - else if (value === 2) action = 'wakeup'; - else if (value === 3) action = 'fall'; - else if (value >= 512) action = 'tap'; - else if (value >= 256) action = 'slide'; - else if (value >= 128) action = 'flip180'; - else if (value >= 64) action = 'flip90'; + if (value === 0) action = {'action': 'shake'}; + else if (value === 2) action = {'action': 'wakeup'}; + else if (value === 3) action = {'action': 'fall'}; + else if (value >= 512) action = {'action': 'tap', 'side': value-512}; + else if (value >= 256) action = {'action': 'slide', 'side': value-256}; + else if (value >= 128) action = {'action': 'flip180', 'side': value-128}; + else if (value >= 64) action = {'action': 'flip90', 'from_side': Math.floor((value-64) / 8), 'to_side': value % 8}; - return action ? {'action': action} : null; + return action ? action : null; }, }, MFKZQ01LM_action_analog: { @@ -150,7 +150,10 @@ const converters = { presentValue = rotation angel left < 0, rigth > 0 */ const value = msg.data.data['presentValue']; - return {action: value < 0 ? 'rotate_left' : 'rotate_right'}; + return { + action: value < 0 ? 'rotate_left' : 'rotate_right', + angel: Math.floor(value * 100) / 100 + }; }, }, WXKG12LM_action_click_multistate: { From c4edb6fc262cc0732dcf9b1f94d9a74419aa47fe Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Sun, 3 Jun 2018 20:27:23 +0300 Subject: [PATCH 038/676] Code style --- converters/fromZigbee.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 0463ce111a296..cb9ea232d2598 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -136,7 +136,9 @@ const converters = { else if (value >= 512) action = {'action': 'tap', 'side': value-512}; else if (value >= 256) action = {'action': 'slide', 'side': value-256}; else if (value >= 128) action = {'action': 'flip180', 'side': value-128}; - else if (value >= 64) action = {'action': 'flip90', 'from_side': Math.floor((value-64) / 8), 'to_side': value % 8}; + else if (value >= 64) action = {'action': 'flip90', + 'from_side': Math.floor((value-64) / 8), + 'to_side': value % 8}; return action ? action : null; }, @@ -152,7 +154,7 @@ const converters = { const value = msg.data.data['presentValue']; return { action: value < 0 ? 'rotate_left' : 'rotate_right', - angel: Math.floor(value * 100) / 100 + angel: Math.floor(value * 100) / 100, }; }, }, From 3d14a15cfc626f131f709b17391dc3a7b2670dc0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 4 Jun 2018 18:56:58 +0200 Subject: [PATCH 039/676] Update for QBKG03LM and MFKZQ01LM --- converters/fromZigbee.js | 17 +++++++++-------- devices.js | 3 +-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index cb9ea232d2598..d4ba8b54160eb 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -136,9 +136,9 @@ const converters = { else if (value >= 512) action = {'action': 'tap', 'side': value-512}; else if (value >= 256) action = {'action': 'slide', 'side': value-256}; else if (value >= 128) action = {'action': 'flip180', 'side': value-128}; - else if (value >= 64) action = {'action': 'flip90', - 'from_side': Math.floor((value-64) / 8), - 'to_side': value % 8}; + else if (value >= 64) { + action = {'action': 'flip90', 'from_side': Math.floor((value-64) / 8), 'to_side': value % 8}; + } return action ? action : null; }, @@ -149,12 +149,12 @@ const converters = { convert: (model, msg, publish, options) => { /* Source: https://github.com/kirovilya/ioBroker.zigbee - presentValue = rotation angel left < 0, rigth > 0 + presentValue = rotation angle left < 0, right > 0 */ const value = msg.data.data['presentValue']; return { action: value < 0 ? 'rotate_left' : 'rotate_right', - angel: Math.floor(value * 100) / 100, + angle: Math.floor(value * 100) / 100, }; }, }, @@ -357,10 +357,11 @@ const converters = { cid: 'genOnOff', type: 'devChange', convert: (model, msg, publish, options) => { - const key = getKey(model.buttonsEp, msg.endpoints[0].epId); - if (key) { + const mapping = {4: 'left', 5: 'right'}; + const button = mapping[msg.endpoints[0].epId]; + if (button) { const payload = {}; - payload['button_'+key] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; + payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; return payload; } }, diff --git a/devices.js b/devices.js index a370a7d181b63..c2f5e513e5561 100644 --- a/devices.js +++ b/devices.js @@ -113,8 +113,7 @@ const devices = { supports: 'l1 and l2 on/off', fromZigbee: [fz.QBKG03LM_state, fz.QBKG03LM_buttons], toZigbee: [tz.onoff], - ep: {'l1': 2, 'l2': 3}, - buttonsEp: {'left': 4, 'right': 5}, + ep: {'left': 2, 'right': 3}, }, 'lumi.sens': { model: 'WSDCGQ01LM', From 64f36556f6c06696f460e5aca1b468ce573bea92 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 4 Jun 2018 19:19:51 +0200 Subject: [PATCH 040/676] Bump to 0.2.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4c323e2e753b8..b9de097db9d9e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.12", + "version": "0.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9d5e365d3233b..5935fe00c72b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.1.12", + "version": "0.2.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From ca1dc518a121ec5c8c36575b4bbb978e3592d891 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 4 Jun 2018 19:57:59 +0200 Subject: [PATCH 041/676] BREAKING CHANGE: add array of zigbeeModels in device. --- devices.js | 238 +++++++++++++++++++++++--------------------- index.js | 5 +- npm-shrinkwrap.json | 2 +- package.json | 2 +- test/verify.js | 20 +++- 5 files changed, 147 insertions(+), 120 deletions(-) diff --git a/devices.js b/devices.js index c2f5e513e5561..b6579e4ed69fa 100644 --- a/devices.js +++ b/devices.js @@ -1,70 +1,10 @@ const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); -const LED1623G12 = { - model: 'LED1623G12', - vendor: 'IKEA', - description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], -}; - -const LED1536G5 = { - model: 'LED1536G5', - vendor: 'IKEA', - description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable, white spectrum, opal white', - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], -}; - -const AA70155 = { - model: 'AA70155', - vendor: 'OSRAM', - description: 'LIGHTIFY LED A19 tunable white / Classic A60 TW', - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], -}; - -const WXKG12LM = { - model: 'WXKG12LM', - vendor: 'Xiaomi', - description: 'Aqara wireless switch (with gyroscope)', - supports: 'single, double, shake, hold, release', - fromZigbee: [ - fz.xiaomi_battery_3v, fz.WXKG12LM_action_click_multistate, fz.ignore_onoff_change, - fz.ignore_basic_change, fz.ignore_multistate_change, - ], - toZigbee: [], -}; - -const WXKG02LM = { - model: 'WXKG02LM', - vendor: 'Xiaomi', - description: 'Aqara double key wireless wall switch', - supports: 'left, right and both click', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG02LM_click], - toZigbee: [], - ep: {'left': 1, 'right': 2, 'both': 3}, -}; - -const QBCZ11LM = { - model: 'QBCZ11LM', - description: 'Aqara socket Zigbee', - supports: 'on/off, power measurement', - vendor: 'Xiaomi', - fromZigbee: [ - fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, - fz.ignore_basic_change, fz.ignore_analog_change, - ], - toZigbee: [tz.onoff], -}; - -const devices = { +const devices = [ // Xiaomi - 'lumi.sensor_switch': { + { + zigbeeModel: ['lumi.sensor_switch'], model: 'WXKG01LM', vendor: 'Xiaomi', description: 'MiJia wireless switch', @@ -72,7 +12,8 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG01LM_click, fz.ignore_onoff_change, fz.ignore_basic_change], toZigbee: [], }, - 'lumi.sensor_switch.aq2': { + { + zigbeeModel: ['lumi.sensor_switch.aq2'], model: 'WXKG11LM', vendor: 'Xiaomi', description: 'Aqara wireless switch', @@ -80,12 +21,20 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG11LM_click, fz.ignore_onoff_change, fz.ignore_basic_change], toZigbee: [], }, - // WXKG12LM uses 2 model IDs. - // https://github.com/Koenkk/zigbee-shepherd-converters/pull/3/files#diff-6c9a6acf22f90d1c6e524d9f3c5c1745R58 - // https://github.com/dresden-elektronik/deconz-rest-plugin/issues/448 - 'lumi.sensor_switch.aq3': WXKG12LM, - 'lumi.sensor_swit': WXKG12LM, - 'lumi.sensor_86sw1\u0000lu': { + { + zigbeeModel: ['lumi.sensor_switch.aq3', 'lumi.sensor_swit'], + model: 'WXKG12LM', + vendor: 'Xiaomi', + description: 'Aqara wireless switch (with gyroscope)', + supports: 'single, double, shake, hold, release', + fromZigbee: [ + fz.xiaomi_battery_3v, fz.WXKG12LM_action_click_multistate, fz.ignore_onoff_change, + fz.ignore_basic_change, fz.ignore_multistate_change, + ], + toZigbee: [], + }, + { + zigbeeModel: ['lumi.sensor_86sw1\u0000lu'], model: 'WXKG03LM', vendor: 'Xiaomi', description: 'Aqara single key wireless wall switch', @@ -93,11 +42,18 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG03LM_click], toZigbee: [], }, - // WXKG02LM uses 2 model IDs. - // https://github.com/Koenkk/zigbee-shepherd-converters/pull/5 - 'lumi.sensor_86sw2\u0000Un': WXKG02LM, - 'lumi.sensor_86sw2.es1': WXKG02LM, - 'lumi.ctrl_neutral1': { + { + zigbeeModel: ['lumi.sensor_86sw2\u0000Un', 'lumi.sensor_86sw2.es1'], + model: 'WXKG02LM', + vendor: 'Xiaomi', + description: 'Aqara double key wireless wall switch', + supports: 'left, right and both click', + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG02LM_click], + toZigbee: [], + ep: {'left': 1, 'right': 2, 'both': 3}, + }, + { + zigbeeModel: ['lumi.ctrl_neutral1'], model: 'QBKG04LM', vendor: 'Xiaomi', description: 'Aqara single key wired wall switch', @@ -106,7 +62,8 @@ const devices = { toZigbee: [tz.onoff], ep: {'': 2}, }, - 'lumi.ctrl_neutral2': { + { + zigbeeModel: ['lumi.ctrl_neutral2'], model: 'QBKG03LM', vendor: 'Xiaomi', description: 'Aqara double key wired wall switch', @@ -115,7 +72,8 @@ const devices = { toZigbee: [tz.onoff], ep: {'left': 2, 'right': 3}, }, - 'lumi.sens': { + { + zigbeeModel: ['lumi.sens'], model: 'WSDCGQ01LM', vendor: 'Xiaomi', description: 'MiJia temperature & humidity sensor ', @@ -123,7 +81,8 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_temperature, fz.xiaomi_humidity, fz.ignore_basic_change], toZigbee: [], }, - 'lumi.weather': { + { + zigbeeModel: ['lumi.weather'], model: 'WSDCGQ11LM', vendor: 'Xiaomi', description: 'Aqara temperature, humidity and pressure sensor', @@ -134,7 +93,8 @@ const devices = { ], toZigbee: [], }, - 'lumi.sensor_motion': { + { + zigbeeModel: ['lumi.sensor_motion'], model: 'RTCGQ01LM', vendor: 'Xiaomi', description: 'MiJia human body movement sensor', @@ -142,7 +102,8 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_occupancy, fz.ignore_basic_change], toZigbee: [], }, - 'lumi.sensor_motion.aq2': { + { + zigbeeModel: ['lumi.sensor_motion.aq2'], model: 'RTCGQ11LM', vendor: 'Xiaomi', description: 'Aqara human body movement and illuminance sensor', @@ -153,7 +114,8 @@ const devices = { ], toZigbee: [], }, - 'lumi.sensor_magnet': { + { + zigbeeModel: ['lumi.sensor_magnet'], model: 'MCCGQ01LM', vendor: 'Xiaomi', description: 'MiJia door & window contact sensor', @@ -161,7 +123,8 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.ignore_onoff_change, fz.ignore_basic_change], toZigbee: [], }, - 'lumi.sensor_magnet.aq2': { + { + zigbeeModel: ['lumi.sensor_magnet.aq2'], model: 'MCCGQ11LM', vendor: 'Xiaomi', description: 'Aqara door & window contact sensor', @@ -169,7 +132,8 @@ const devices = { fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.ignore_onoff_change, fz.ignore_basic_change], toZigbee: [], }, - 'lumi.sensor_wleak.aq1': { + { + zigbeeModel: ['lumi.sensor_wleak.aq1'], model: 'SJCGQ11LM', vendor: 'Xiaomi', description: 'Aqara water leak sensor', @@ -180,7 +144,8 @@ const devices = { ], toZigbee: [], }, - 'lumi.sensor_cube': { + { + zigbeeModel: ['lumi.sensor_cube'], model: 'MFKZQ01LM', vendor: 'Xiaomi', description: 'Mi smart home cube', @@ -191,7 +156,8 @@ const devices = { ], toZigbee: [], }, - 'lumi.plug': { + { + zigbeeModel: ['lumi.plug'], model: 'ZNCZ02LM', description: 'Mi power plug ZigBee', supports: 'on/off, power measurement', @@ -202,10 +168,20 @@ const devices = { ], toZigbee: [tz.onoff], }, - // QBCZ11LM has 2 modelID's: https://github.com/Koenkk/zigbee-shepherd-converters/pull/8 - 'lumi.ctrl_86plug': QBCZ11LM, - 'lumi.ctrl_86plug.aq1': QBCZ11LM, - 'lumi.sensor_smoke': { + { + zigbeeModel: ['lumi.ctrl_86plug', 'lumi.ctrl_86plug.aq1'], + model: 'QBCZ11LM', + description: 'Aqara socket Zigbee', + supports: 'on/off, power measurement', + vendor: 'Xiaomi', + fromZigbee: [ + fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, + fz.ignore_basic_change, fz.ignore_analog_change, + ], + toZigbee: [tz.onoff], + }, + { + zigbeeModel: ['lumi.sensor_smoke'], model: 'JTYJ-GD-01LM/BW', description: 'MiJia Honeywell smoke detector', supports: 'smoke', @@ -215,7 +191,8 @@ const devices = { }, // IKEA - 'TRADFRI bulb E27 WS opal 980lm': { + { + zigbeeModel: ['TRADFRI bulb E27 WS opal 980lm'], model: 'LED1545G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 980 lumen, dimmable, white spectrum, opal white', @@ -223,10 +200,17 @@ const devices = { fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }, - // LED1623G12 uses 2 model IDs, see https://github.com/Koenkk/zigbee2mqtt/issues/21 - 'TRADFRI bulb E27 opal 1000lm': LED1623G12, - 'TRADFRI bulb E27 W opal 1000lm': LED1623G12, - 'TRADFRI bulb GU10 WS 400lm': { + { + zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm'], + model: 'LED1623G12', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + }, + { + zigbeeModel: ['TRADFRI bulb GU10 WS 400lm'], model: 'LED1537R6', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable, white spectrum', @@ -234,7 +218,8 @@ const devices = { fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }, - 'TRADFRI bulb GU10 W 400lm': { + { + zigbeeModel: ['TRADFRI bulb GU10 W 400lm'], model: 'LED1650R5', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable', @@ -242,10 +227,17 @@ const devices = { fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, - // LED1536G5 has an E12 and E14 version. - 'TRADFRI bulb E14 WS opal 400lm': LED1536G5, - 'TRADFRI bulb E12 WS opal 400lm': LED1536G5, - 'TRADFRI bulb E26 opal 1000lm': { + { + zigbeeModel: ['TRADFRI bulb E14 WS opal 400lm', 'TRADFRI bulb E12 WS opal 400lm'], + model: 'LED1536G5', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable, white spectrum, opal white', + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + }, + { + zigbeeModel: ['TRADFRI bulb E26 opal 1000lm'], model: 'LED1622G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26 1000 lumen, dimmable, opal white', @@ -253,7 +245,8 @@ const devices = { fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, - 'TRADFRI bulb E27 CWS opal 600lm': { + { + zigbeeModel: ['TRADFRI bulb E27 CWS opal 600lm'], model: 'LED1624G9', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 600 lumen, dimmable, color, opal white', @@ -263,7 +256,8 @@ const devices = { }, // Philips - 'LLC020': { + { + zigbeeModel: ['LLC020'], model: '7146060PH', vendor: 'Philips', description: 'Hue Go', @@ -271,7 +265,8 @@ const devices = { fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, - 'LWB010': { + { + zigbeeModel: ['LWB010'], model: '8718696449691', vendor: 'Philips', description: 'Hue White Single bulb B22', @@ -279,7 +274,8 @@ const devices = { fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, - 'LCT015': { + { + zigbeeModel: ['LCT015'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E27', @@ -289,7 +285,8 @@ const devices = { }, // Belkin - 'MZ100': { + { + zigbeeModel: ['MZ100'], model: 'F7C033', vendor: 'Belkin', description: 'WeMo smart LED bulb', @@ -299,7 +296,8 @@ const devices = { }, // EDP - 'ZB-SmartPlug-1.0.0': { + { + zigbeeModel: ['ZB-SmartPlug-1.0.0'], model: 'PLUG EDP RE:DY', vendor: 'EDP', description: 're:dy plug', @@ -317,7 +315,8 @@ const devices = { }, // Texax Instruments - 'lumi.router': { + { + zigbeeModel: ['lumi.router'], model: 'CC2530.ROUTER', vendor: 'Texas Instruments', description: '[CC2530 router](http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/)', @@ -327,7 +326,8 @@ const devices = { }, // OSRAM - 'Classic A60 RGBW': { + { + zigbeeModel: ['Classic A60 RGBW'], model: 'AA69697', vendor: 'OSRAM', description: 'Classic A60 RGBW', @@ -335,10 +335,18 @@ const devices = { fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, - // AA70155 is model number of both bulbs. - 'LIGHTIFY A19 Tunable White': AA70155, - 'Classic A60 TW': AA70155, - 'Plug 01': { + { + // AA70155 is model number of both bulbs. + zigbeeModel: ['LIGHTIFY A19 Tunable White', 'Classic A60 TW'], + model: 'AA70155', + vendor: 'OSRAM', + description: 'LIGHTIFY LED A19 tunable white / Classic A60 TW', + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + }, + { + zigbeeModel: ['Plug 01'], model: 'AB3257001NJ', description: 'Smart+ plug', supports: 'on/off', @@ -348,7 +356,8 @@ const devices = { }, // Hive - 'FWBulb01': { + { + zigbeeModel: ['FWBulb01'], model: 'HALIGHTDIMWWE27', vendor: 'Hive', description: 'Active light dimmable', @@ -358,7 +367,8 @@ const devices = { }, // Innr - 'RB 185 C': { + { + zigbeeModel: ['RB 185 C'], model: 'RB 185 C', vendor: 'Innr', description: 'E27 Bulb RGBW', @@ -366,6 +376,6 @@ const devices = { fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, -}; +]; module.exports = devices; diff --git a/index.js b/index.js index c988336dc35a3..8debe719e912e 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,6 @@ +const devices = require('./devices'); + module.exports = { - devices: require('./devices'), + devices: devices, + findByZigbeeModel: (model) => devices.find((d) => d.zigbeeModel.includes(model)), }; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b9de097db9d9e..9d2ee40a7eade 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.2.0", + "version": "1.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5935fe00c72b2..cb2a9d2925bf0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "0.2.0", + "version": "1.0.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { diff --git a/test/verify.js b/test/verify.js index 1a48d5355c8ed..bb75aa7eab334 100644 --- a/test/verify.js +++ b/test/verify.js @@ -7,12 +7,13 @@ function verifyKeys(expected, actual, id) { }); } -Object.keys(devices).forEach((deviceKey) => { - const device = devices[deviceKey]; +let foundZigbeeModels = []; +let foundModels = []; +devices.forEach((device) => { // Verify device attributes. verifyKeys( - ['model', 'vendor', 'description', 'supports', 'fromZigbee', 'toZigbee'], + ['model', 'vendor', 'description', 'supports', 'fromZigbee', 'toZigbee', 'zigbeeModel'], Object.keys(device), device.model, ); @@ -42,4 +43,17 @@ Object.keys(devices).forEach((deviceKey) => { assert.strictEqual(2, converter.convert.length, `${converterKey}: convert() invalid arguments length`); }); + + // Check for duplicate zigbee model ids + device.zigbeeModel.forEach((m) => { + if (foundZigbeeModels.includes(m)) { + assert.fail(`Duplicate zigbee model ${m}`); + } + }); + + // Check for duplicate model ids + assert(!foundModels.includes(device.model), `Duplicate model ${device.model}`); + + foundZigbeeModels = foundZigbeeModels.concat(device.zigbeeModel); + foundModels.push(device.model); }); From de0cabd15028cb45a964eff3a4caeb1e6237fb20 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 4 Jun 2018 21:32:26 +0200 Subject: [PATCH 042/676] Support OSRAM Smart+ Plug (AB3257001NJ). https://github.com/Koenkk/zigbee2mqtt/issues/62 --- converters/fromZigbee.js | 10 +--------- devices.js | 41 +++++++++++++++++++++++++++++----------- npm-shrinkwrap.json | 2 +- package.json | 2 +- 4 files changed, 33 insertions(+), 22 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index d4ba8b54160eb..e920bd66422b5 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -302,7 +302,7 @@ const converters = { return {water_leak: msg.data.zoneStatus === 1}; }, }, - xiaomi_state: { + generic_state: { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { @@ -399,14 +399,6 @@ const converters = { }; }, }, - AB3257001NJ_state: { - cid: 'genOnOff', - type: 'attReport', - convert: (model, msg, publish, options) => { - // eslint-disable-next-line no-console - console.log('PLEASE REPORT THIS IN https://github.com/Koenkk/zigbee2mqtt/issues/62', msg.data); - }, - }, // Ignore converters (these message dont need parsing). ignore_onoff_change: { diff --git a/devices.js b/devices.js index b6579e4ed69fa..880a6319cf33e 100644 --- a/devices.js +++ b/devices.js @@ -163,7 +163,7 @@ const devices = [ supports: 'on/off, power measurement', vendor: 'Xiaomi', fromZigbee: [ - fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, + fz.generic_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_analog_change, ], toZigbee: [tz.onoff], @@ -175,7 +175,7 @@ const devices = [ supports: 'on/off, power measurement', vendor: 'Xiaomi', fromZigbee: [ - fz.xiaomi_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, + fz.generic_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_analog_change, ], toZigbee: [tz.onoff], @@ -304,14 +304,15 @@ const devices = [ supports: 'on/off, power measurement', fromZigbee: [fz.ignore_onoff_change, fz.EDP_power, fz.ignore_metering_change], toZigbee: [tz.onoff], - report: [{ - 'cid': 'seMetering', - 'attr': 'instantaneousDemand', - 'ep': 85, - 'minInt': 10, - 'maxInt': 60, - 'repChange': 1, - }], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 85); + + if (device) { + device.report('seMetering', 'instantaneousDemand', 10, 60, 1, (error) => { + callback(!error); + }); + } + }, }, // Texax Instruments @@ -351,8 +352,26 @@ const devices = [ description: 'Smart+ plug', supports: 'on/off', vendor: 'OSRAM', - fromZigbee: [fz.AB3257001NJ_state], + fromZigbee: [fz.ignore_onoff_change, fz.generic_state], toZigbee: [tz.onoff], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const cfgRptRec = { + direction: 0, attrId: 0, dataType: 16, minRepIntval: 1, maxRepIntval: 1000, repChange: 0, + }; + + const device = shepherd.find(ieeeAddr, 3); + if (device) { + device.bind('genOnOff', coordinator, (error) => { + if (error) { + callback(error); + } else { + device.foundation('genOnOff', 'configReport', [cfgRptRec]).then((rsp) => { + callback(rsp[0].status === 0); + }); + } + }); + } + }, }, // Hive diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9d2ee40a7eade..95b896308a2a4 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cb2a9d2925bf0..97dd2a7e9d402 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "1.0.0", + "version": "1.0.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 0e4f60feef71a6802df7ef2edb230488613edd44 Mon Sep 17 00:00:00 2001 From: zybron Date: Tue, 5 Jun 2018 08:41:56 -0400 Subject: [PATCH 043/676] Added Sylvania Lightify and GE Link bulbs --- devices.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/devices.js b/devices.js index 880a6319cf33e..ba003100dc6b8 100644 --- a/devices.js +++ b/devices.js @@ -395,6 +395,34 @@ const devices = [ fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, + + // Sylvania + 'LIGHTIFY RT Tunable White': { + model: '73742', + vendor: 'Sylvania', + description: 'Lightify Recessed Tunable White', + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + }, + 'LIGHTIFY BR Tunable White': { + model: '73807', + vendor: 'Sylvania', + description: 'Lightify BR30 Tunable White', + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + }, + + // GE Link + 'ZLL Light': { + model: '22670', + vendor: 'GE', + description: 'GE Link Smart LED R30', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + }, ]; module.exports = devices; From a8400f119b5be21564b812461a92f3b760a5e79c Mon Sep 17 00:00:00 2001 From: zybron Date: Tue, 5 Jun 2018 09:01:43 -0400 Subject: [PATCH 044/676] Converted devices to model array --- devices.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index ba003100dc6b8..8644b9900d6d5 100644 --- a/devices.js +++ b/devices.js @@ -397,7 +397,8 @@ const devices = [ }, // Sylvania - 'LIGHTIFY RT Tunable White': { + { + zigbeeModel: ['LIGHTIFY RT Tunable White'], model: '73742', vendor: 'Sylvania', description: 'Lightify Recessed Tunable White', @@ -405,7 +406,8 @@ const devices = [ fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, - 'LIGHTIFY BR Tunable White': { + { + zigbeeModel: ['LIGHTIFY BR Tunable White'], model: '73807', vendor: 'Sylvania', description: 'Lightify BR30 Tunable White', @@ -415,7 +417,8 @@ const devices = [ }, // GE Link - 'ZLL Light': { + { + zigbeeModel: ['ZLL Light'], model: '22670', vendor: 'GE', description: 'GE Link Smart LED R30', From be5a9319d783a6dc4300239f33da5a5b58718ee7 Mon Sep 17 00:00:00 2001 From: zybron Date: Tue, 5 Jun 2018 09:40:29 -0400 Subject: [PATCH 045/676] Fix linting --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 8644b9900d6d5..8493dc9c988b4 100644 --- a/devices.js +++ b/devices.js @@ -395,7 +395,7 @@ const devices = [ fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }, - + // Sylvania { zigbeeModel: ['LIGHTIFY RT Tunable White'], From 8b820edcf4d9eba9a0ca63952c7a8f3ba7084f37 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 5 Jun 2018 16:59:53 +0200 Subject: [PATCH 046/676] Update Sylvania and GE light --- devices.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/devices.js b/devices.js index 8493dc9c988b4..600ee79b27930 100644 --- a/devices.js +++ b/devices.js @@ -401,27 +401,27 @@ const devices = [ zigbeeModel: ['LIGHTIFY RT Tunable White'], model: '73742', vendor: 'Sylvania', - description: 'Lightify Recessed Tunable White', + description: 'LIGHTIFY LED adjustable white RT 5/6', supports: 'on/off, brightness, color temperature', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }, { zigbeeModel: ['LIGHTIFY BR Tunable White'], - model: '73807', + model: '73740', vendor: 'Sylvania', - description: 'Lightify BR30 Tunable White', + description: 'LIGHTIFY LED adjustable white BR30', supports: 'on/off, brightness, color temperature', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }, - // GE Link + // GE { zigbeeModel: ['ZLL Light'], model: '22670', vendor: 'GE', - description: 'GE Link Smart LED R30', + description: 'Link smart LED light bulb, BR30 soft white (2700K)', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], From f2becd869a994f56bf1e60c6adf8cdac9829cb26 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 5 Jun 2018 20:17:01 +0200 Subject: [PATCH 047/676] 1.0.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 95b896308a2a4..03680522ba2aa 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 97dd2a7e9d402..5e5a97a1051ff 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "1.0.1", + "version": "1.0.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 15ec7b5c2609cd487c4d4d24db4078297d321acb Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 5 Jun 2018 20:20:19 +0200 Subject: [PATCH 048/676] 1.0.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 03680522ba2aa..5f9718de79772 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5e5a97a1051ff..40e59c47745d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "1.0.2", + "version": "1.0.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 7ddb63520968464b83de3c8357cf0925461677fd Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 8 Jun 2018 20:09:48 +0200 Subject: [PATCH 049/676] Add support for TRADFRI wireless dimmer (ICTC-G-1). --- converters/fromZigbee.js | 65 ++++++++++++++++++++++++++++++++++++++++ devices.js | 19 ++++++++++++ npm-shrinkwrap.json | 5 ++++ package.json | 4 ++- test/verify.js | 13 ++++---- 5 files changed, 100 insertions(+), 6 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index e920bd66422b5..b547686d46e0e 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1,3 +1,5 @@ +const debounce = require('debounce'); + const clickLookup = { 1: 'single', 2: 'double', @@ -38,6 +40,41 @@ const getKey = (object, value) => { // Global variable store that can be used by devices. const store = {}; +const ictcg1 = (model, msg, publish, options, action) => { + const deviceID = msg.endpoints[0].device.ieeeAddr; + + if (!store[deviceID]) { + const _publish = debounce((msg) => publish(msg), 250); + store[deviceID] = {since: false, direction: false, value: 255, publish: _publish}; + } + + const s = store[deviceID]; + if (s.since && s.direction) { + // Update value + const duration = Date.now() - s.since; + const delta = Math.round((duration / 10) * (s.direction === 'left' ? -1 : 1)); + const newValue = s.value + delta; + if (newValue >= 0 && newValue <= 255) { + s.value = newValue; + } + } + + if (action === 'move') { + s.since = Date.now(); + s.direction = msg.data.payload.movemode === 1 ? 'left' : 'right'; + } else if (action === 'stop' || action === 'level') { + if (action === 'level') { + s.value = msg.data.payload.level; + } + + s.since = false; + s.direction = false; + } + + s.publish({value: s.value}); +}; + + const converters = { xiaomi_battery_3v: { cid: 'genBasic', @@ -399,6 +436,26 @@ const converters = { }; }, }, + ICTC_G_1_move: { + cmd: 'move', + convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), + }, + ICTC_G_1_moveWithOnOff: { + cmd: 'moveWithOnOff', + convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), + }, + ICTC_G_1_stop: { + cmd: 'stop', + convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'stop'), + }, + ICTC_G_1_stopWithOnOff: { + cmd: 'stopWithOnOff', + convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'stop'), + }, + ICTC_G_1_moveToLevelWithOnOff: { + cmd: 'moveToLevelWithOnOff', + convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'level'), + }, // Ignore converters (these message dont need parsing). ignore_onoff_change: { @@ -451,6 +508,14 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_cmd_readRsp: { + cmd: 'readRsp', + convert: (model, msg, publish, options) => null, + }, + ignore_cmd_discoverRsp: { + cmd: 'discoverRsp', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; diff --git a/devices.js b/devices.js index 600ee79b27930..b38834e71891f 100644 --- a/devices.js +++ b/devices.js @@ -254,6 +254,25 @@ const devices = [ fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.light_color, tz.ignore_transition], }, + { + zigbeeModel: ['TRADFRI wireless dimmer'], + model: 'ICTC-G-1', + vendor: 'IKEA', + description: 'TRADFRI wireless dimmer', + supports: 'value (0-255), fast rotate for instant 0/255', + fromZigbee: [ + fz.ICTC_G_1_move, fz.ICTC_G_1_moveWithOnOff, fz.ICTC_G_1_stop, fz.ICTC_G_1_stopWithOnOff, + fz.ICTC_G_1_moveToLevelWithOnOff, fz.ignore_cmd_readRsp, fz.ignore_cmd_discoverRsp, + ], + toZigbee: [], + onAfIncomingMsg: [1], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + device.bind('genLevelCtrl', coordinator, (error) => { + callback(!error); + }); + }, + }, // Philips { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5f9718de79772..43ef135a33741 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -279,6 +279,11 @@ "which": "1.3.0" } }, + "debounce": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.1.0.tgz", + "integrity": "sha512-ZQVKfRVlwRfD150ndzEK8M90ABT+Y/JQKs4Y7U4MXdpuoUkkrr4DwKbVux3YjylA5bUMUj0Nc3pMxPJX6N2QQQ==" + }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", diff --git a/package.json b/package.json index 40e59c47745d0..d3630fac3eb73 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,9 @@ "url": "https://github.com/Koenkk/zigbee-shepherd-converters/issues" }, "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", - "dependencies": {}, + "dependencies": { + "debounce": "*" + }, "devDependencies": { "eslint": "*", "eslint-config-google": "*" diff --git a/test/verify.js b/test/verify.js index bb75aa7eab334..de6716e328330 100644 --- a/test/verify.js +++ b/test/verify.js @@ -22,11 +22,14 @@ devices.forEach((device) => { Object.keys(device.fromZigbee).forEach((converterKey) => { const converter = device.fromZigbee[converterKey]; - verifyKeys( - ['cid', 'type', 'convert'], - Object.keys(converter), - converterKey, - ); + const keys = Object.keys(converter); + if (keys.includes('cid')) { + verifyKeys(['cid', 'type', 'convert'], keys, converterKey); + } else if (keys.includes('cmd')) { + verifyKeys(['cmd', 'convert'], keys, converterKey); + } else { + assert.fail(`${converterKey}: missing ['cid', 'type'] or ['cmd']`) + } assert.strictEqual(4, converter.convert.length, `${converterKey}: convert() invalid arguments length`); }); From 488c548f823bbabb2d120510027e2e60c2524fae Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 8 Jun 2018 20:14:08 +0200 Subject: [PATCH 050/676] 2.0.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 43ef135a33741..b8de429341581 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "1.0.3", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d3630fac3eb73..e89142f034467 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "1.0.3", + "version": "2.0.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From da1db73a4182cdd80625dcf81cc6b66814c94ae6 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 8 Jun 2018 20:30:01 +0200 Subject: [PATCH 051/676] Value -> brightness --- converters/fromZigbee.js | 2 +- devices.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index b547686d46e0e..2684399cc5bff 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -71,7 +71,7 @@ const ictcg1 = (model, msg, publish, options, action) => { s.direction = false; } - s.publish({value: s.value}); + s.publish({brightness: s.value}); }; diff --git a/devices.js b/devices.js index b38834e71891f..944fbfda3de05 100644 --- a/devices.js +++ b/devices.js @@ -259,7 +259,7 @@ const devices = [ model: 'ICTC-G-1', vendor: 'IKEA', description: 'TRADFRI wireless dimmer', - supports: 'value (0-255), fast rotate for instant 0/255', + supports: 'brightness (0-255), fast rotate for instant 0/255', fromZigbee: [ fz.ICTC_G_1_move, fz.ICTC_G_1_moveWithOnOff, fz.ICTC_G_1_stop, fz.ICTC_G_1_stopWithOnOff, fz.ICTC_G_1_moveToLevelWithOnOff, fz.ignore_cmd_readRsp, fz.ignore_cmd_discoverRsp, From d24231ffb216dafb934b66f1257d0d5bebee0939 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 8 Jun 2018 20:30:41 +0200 Subject: [PATCH 052/676] 2.0.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b8de429341581..0de45b804f288 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.0", + "version": "2.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e89142f034467..1c40534701f1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.0", + "version": "2.0.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 399b6a560042d56b7b184ed5cfe278f158386583 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 8 Jun 2018 20:41:20 +0200 Subject: [PATCH 053/676] Reduce minRepIntval for AB3257001NJ --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 944fbfda3de05..42821f7bcf5e6 100644 --- a/devices.js +++ b/devices.js @@ -375,7 +375,7 @@ const devices = [ toZigbee: [tz.onoff], configure: (ieeeAddr, shepherd, coordinator, callback) => { const cfgRptRec = { - direction: 0, attrId: 0, dataType: 16, minRepIntval: 1, maxRepIntval: 1000, repChange: 0, + direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0, }; const device = shepherd.find(ieeeAddr, 3); From 9189ecc94f2ef42c594b48a4af204c0988c144e3 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 8 Jun 2018 20:41:38 +0200 Subject: [PATCH 054/676] 2.0.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0de45b804f288..994ab539bd36e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1c40534701f1f..835fad0d2d776 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.1", + "version": "2.0.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 043523d6d9e61c8c403bb796a1dc26f2763f59f5 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Sun, 10 Jun 2018 07:05:03 +0300 Subject: [PATCH 055/676] NodeJS 4.* support --- converters/fromZigbee.js | 2 ++ converters/toZigbee.js | 2 ++ devices.js | 2 ++ index.js | 2 ++ test/verify.js | 2 ++ 5 files changed, 10 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 2684399cc5bff..7d750904ec87c 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1,3 +1,5 @@ +"use strict"; + const debounce = require('debounce'); const clickLookup = { diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 0f15b7ad7df39..ba7c3cd6b7b3c 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,3 +1,5 @@ +"use strict"; + const converters = { onoff: { key: 'state', diff --git a/devices.js b/devices.js index 42821f7bcf5e6..4772f85551144 100644 --- a/devices.js +++ b/devices.js @@ -1,3 +1,5 @@ +"use strict"; + const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); diff --git a/index.js b/index.js index 8debe719e912e..315ce393d7b26 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,5 @@ +"use strict"; + const devices = require('./devices'); module.exports = { diff --git a/test/verify.js b/test/verify.js index de6716e328330..9f2547240dde7 100644 --- a/test/verify.js +++ b/test/verify.js @@ -1,3 +1,5 @@ +"use strict"; + const devices = require('../devices'); const assert = require('assert'); From 2763be288e45dd2d9f5d59b9b47a3e67fff82fb2 Mon Sep 17 00:00:00 2001 From: Marius Ciotlos Date: Sun, 10 Jun 2018 08:51:40 +0300 Subject: [PATCH 056/676] Updated battery to match xiaomi_aqara for now --- converters/fromZigbee.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 7d750904ec87c..521c1f2c6dff8 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -10,8 +10,8 @@ const clickLookup = { }; const battery3V = { - min: 2500, - max: 3000, + min: 2800, + max: 3300, }; const occupancyTimeout = 60; // In seconds From 4cf6fd05b124a4d22c0519034be87a5fe13b5b53 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 10 Jun 2018 08:04:07 +0200 Subject: [PATCH 057/676] 2.0.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 994ab539bd36e..9390caf19e91e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.2", + "version": "2.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 835fad0d2d776..45a393b2c65a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.2", + "version": "2.0.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 2480719ca2f41d1c15cdde3461c05b41f50bdacf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Sun, 10 Jun 2018 11:14:12 +0300 Subject: [PATCH 058/676] Update fromZigbee.js --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 521c1f2c6dff8..adf9a2cf5b6f1 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; const debounce = require('debounce'); From ebdbab7a3af395bf39d9d056d96177e3d400d737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Sun, 10 Jun 2018 11:14:30 +0300 Subject: [PATCH 059/676] Update toZigbee.js --- converters/toZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index ba7c3cd6b7b3c..a3cb7d7a8e41c 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; const converters = { onoff: { From 45bfe924a1c0237a000edba0bc45e424f939dce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Sun, 10 Jun 2018 11:14:48 +0300 Subject: [PATCH 060/676] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 315ce393d7b26..e9da87d4fb454 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; const devices = require('./devices'); From 528bb9d0d5503a4bb1572e5d540fc4ee68b32ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Sun, 10 Jun 2018 11:15:06 +0300 Subject: [PATCH 061/676] Update verify.js --- test/verify.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/verify.js b/test/verify.js index 9f2547240dde7..2509f6994406f 100644 --- a/test/verify.js +++ b/test/verify.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; const devices = require('../devices'); const assert = require('assert'); From a4a296e430d01194911d820d3ffd121b6f96848e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Sun, 10 Jun 2018 11:15:27 +0300 Subject: [PATCH 062/676] Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 4772f85551144..7d02d9ef1d1e3 100644 --- a/devices.js +++ b/devices.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); From efef375d8bc5534186b0e711e32314bd5c3e546a Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 10 Jun 2018 12:04:24 +0200 Subject: [PATCH 063/676] 2.0.4 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9390caf19e91e..7fc455f6b5581 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.3", + "version": "2.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 45a393b2c65a8..9138faabff076 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.3", + "version": "2.0.4", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 7cd0f6975a99a2c865ce93712ffadd3fc324468e Mon Sep 17 00:00:00 2001 From: kimonm <40135180+kimonm@users.noreply.github.com> Date: Sun, 10 Jun 2018 11:14:54 -0700 Subject: [PATCH 064/676] Update devices.js Added support for GE 45852 wall dimmer switch, and Sengled Element classic bulb --- devices.js | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/devices.js b/devices.js index 7d02d9ef1d1e3..2706c9079741a 100644 --- a/devices.js +++ b/devices.js @@ -447,6 +447,44 @@ const devices = [ fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }, + { + zigbeeModel: ['45852'], + model: '45852', + vendor: 'GE', + description: 'GE wall switch 45852', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change, fz.generic_state], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const cfgRptRec = { + direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0, + }; + + const device = shepherd.find(ieeeAddr, 1); + if (device) { + device.bind('genOnOff', coordinator, (error) => { + if (error) { + callback(error); + } else { + device.foundation('genOnOff', 'configReport', [cfgRptRec]).then((rsp) => { + callback(rsp[0].status === 0); + }); + } + }); + } + } + }, + + // Sengled + { + zigbeeModel: ['E11-G13'], + model: 'E11-G13', + vendor: 'Sengled', + description: 'Sengled Element Classic bulb', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + }, ]; module.exports = devices; From d7bde0201e1e90a14cef43a55d3a5bd7bfe469d0 Mon Sep 17 00:00:00 2001 From: kimonm <40135180+kimonm@users.noreply.github.com> Date: Sun, 10 Jun 2018 11:38:41 -0700 Subject: [PATCH 065/676] Update devices.js --- devices.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index 2706c9079741a..692051ec33c77 100644 --- a/devices.js +++ b/devices.js @@ -472,9 +472,9 @@ const devices = [ } }); } - } + }, }, - + // Sengled { zigbeeModel: ['E11-G13'], @@ -484,7 +484,7 @@ const devices = [ supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], - }, + }, ]; module.exports = devices; From ffee04fc3a9193c3fc7af335dc4bcadaf0a8a32c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 11 Jun 2018 12:01:31 +0200 Subject: [PATCH 066/676] Update E11-G13 description --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 692051ec33c77..c45aff0c37e63 100644 --- a/devices.js +++ b/devices.js @@ -480,7 +480,7 @@ const devices = [ zigbeeModel: ['E11-G13'], model: 'E11-G13', vendor: 'Sengled', - description: 'Sengled Element Classic bulb', + description: 'Element Classic (A19)', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], From fdedce2592644383dea9f6beb5ee47a3fd314813 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 12 Jun 2018 09:41:59 +0200 Subject: [PATCH 067/676] Update 45852GE description --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index c45aff0c37e63..54ea8c73ca4c7 100644 --- a/devices.js +++ b/devices.js @@ -449,9 +449,9 @@ const devices = [ }, { zigbeeModel: ['45852'], - model: '45852', + model: '45852GE', vendor: 'GE', - description: 'GE wall switch 45852', + description: 'ZigBee plug-in smart dimmer', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change, fz.generic_state], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], From e508296de6bf9dacaadeb3d3a336bc6de197bf8a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 12 Jun 2018 20:47:55 +0200 Subject: [PATCH 068/676] Support TRADFRI driver for wireless control (30 watt) (603.426.56). https://github.com/Koenkk/zigbee2mqtt/issues/104 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 54ea8c73ca4c7..df7582c85402e 100644 --- a/devices.js +++ b/devices.js @@ -275,6 +275,15 @@ const devices = [ }); }, }, + { + zigbeeModel: ['TRADFRI transformer 30W'], + model: '603.426.56', + vendor: 'IKEA', + description: 'TRADFRI driver for wireless control (30 watt)', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + }, // Philips { From 44d710eb652b0f17bd1c1bfd40713266c5d58a86 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 12 Jun 2018 20:48:40 +0200 Subject: [PATCH 069/676] Update TRADFRI wireless dimmer description --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index df7582c85402e..1b67dbb5b1a06 100644 --- a/devices.js +++ b/devices.js @@ -261,7 +261,7 @@ const devices = [ model: 'ICTC-G-1', vendor: 'IKEA', description: 'TRADFRI wireless dimmer', - supports: 'brightness (0-255), fast rotate for instant 0/255', + supports: 'brightness [0-255], quick rotate for instant 0/255', fromZigbee: [ fz.ICTC_G_1_move, fz.ICTC_G_1_moveWithOnOff, fz.ICTC_G_1_stop, fz.ICTC_G_1_stopWithOnOff, fz.ICTC_G_1_moveToLevelWithOnOff, fz.ignore_cmd_readRsp, fz.ignore_cmd_discoverRsp, From f65bbd240e1d9bf6b14be9daa26fe4958e7dce44 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 12 Jun 2018 20:49:41 +0200 Subject: [PATCH 070/676] 2.0.5 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7fc455f6b5581..c140941b28f38 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.4", + "version": "2.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9138faabff076..00a19d7661e80 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.4", + "version": "2.0.5", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From e502ad7ec4a7c4fe136ea4381fbf37cf5b719659 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 13 Jun 2018 20:02:17 +0200 Subject: [PATCH 071/676] Add generic configuration for lights. --- devices.js | 111 ++++++++++++++++++++++++----------------------------- 1 file changed, 51 insertions(+), 60 deletions(-) diff --git a/devices.js b/devices.js index 1b67dbb5b1a06..38484fa6d1da8 100644 --- a/devices.js +++ b/devices.js @@ -3,6 +3,37 @@ const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); +const generic = { + light_onoff_brightness: () => { + return { + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + }; + }, + light_onoff_brightness_colortemp: () => { + return { + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + }; + }, + light_onoff_brightness_colorxy: () => { + return { + supports: 'on/off, brightness, color xy', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_color, tz.ignore_transition], + }; + }, + light_onoff_brightness_colortemp_colorxy: () => { + return { + supports: 'on/off, brightness, color temperature, color xy', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + }; + }, +}; + const devices = [ // Xiaomi { @@ -198,63 +229,49 @@ const devices = [ model: 'LED1545G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 980 lumen, dimmable, white spectrum, opal white', - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp(), }, { zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm'], model: 'LED1623G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + ...generic.light_onoff_brightness(), }, { zigbeeModel: ['TRADFRI bulb GU10 WS 400lm'], model: 'LED1537R6', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable, white spectrum', - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp(), }, { zigbeeModel: ['TRADFRI bulb GU10 W 400lm'], model: 'LED1650R5', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + ...generic.light_onoff_brightness(), }, { zigbeeModel: ['TRADFRI bulb E14 WS opal 400lm', 'TRADFRI bulb E12 WS opal 400lm'], model: 'LED1536G5', vendor: 'IKEA', description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable, white spectrum, opal white', - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp(), }, { zigbeeModel: ['TRADFRI bulb E26 opal 1000lm'], model: 'LED1622G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26 1000 lumen, dimmable, opal white', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + ...generic.light_onoff_brightness(), }, { zigbeeModel: ['TRADFRI bulb E27 CWS opal 600lm'], model: 'LED1624G9', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 600 lumen, dimmable, color, opal white', - supports: 'on/off, brightness, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_color, tz.ignore_transition], + ...generic.light_onoff_brightness_colorxy(), }, { zigbeeModel: ['TRADFRI wireless dimmer'], @@ -280,9 +297,7 @@ const devices = [ model: '603.426.56', vendor: 'IKEA', description: 'TRADFRI driver for wireless control (30 watt)', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + ...generic.light_onoff_brightness(), }, // Philips @@ -291,27 +306,21 @@ const devices = [ model: '7146060PH', vendor: 'Philips', description: 'Hue Go', - supports: 'on/off, brightness, color temperature, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp_colorxy(), }, { zigbeeModel: ['LWB010'], model: '8718696449691', vendor: 'Philips', description: 'Hue White Single bulb B22', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + ...generic.light_onoff_brightness(), }, { zigbeeModel: ['LCT015'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E27', - supports: 'on/off, brightness, color temperature, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp_colorxy(), }, // Belkin @@ -320,9 +329,7 @@ const devices = [ model: 'F7C033', vendor: 'Belkin', description: 'WeMo smart LED bulb', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + ...generic.light_onoff_brightness(), }, // EDP @@ -362,9 +369,7 @@ const devices = [ model: 'AA69697', vendor: 'OSRAM', description: 'Classic A60 RGBW', - supports: 'on/off, brightness, color temperature, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp_colorxy(), }, { // AA70155 is model number of both bulbs. @@ -372,9 +377,7 @@ const devices = [ model: 'AA70155', vendor: 'OSRAM', description: 'LIGHTIFY LED A19 tunable white / Classic A60 TW', - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp(), }, { zigbeeModel: ['Plug 01'], @@ -410,9 +413,7 @@ const devices = [ model: 'HALIGHTDIMWWE27', vendor: 'Hive', description: 'Active light dimmable', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + ...generic.light_onoff_brightness(), }, // Innr @@ -421,9 +422,7 @@ const devices = [ model: 'RB 185 C', vendor: 'Innr', description: 'E27 Bulb RGBW', - supports: 'on/off, brightness, color temperature, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp_colorxy(), }, // Sylvania @@ -432,18 +431,14 @@ const devices = [ model: '73742', vendor: 'Sylvania', description: 'LIGHTIFY LED adjustable white RT 5/6', - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp(), }, { zigbeeModel: ['LIGHTIFY BR Tunable White'], model: '73740', vendor: 'Sylvania', description: 'LIGHTIFY LED adjustable white BR30', - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + ...generic.light_onoff_brightness_colortemp(), }, // GE @@ -452,9 +447,7 @@ const devices = [ model: '22670', vendor: 'GE', description: 'Link smart LED light bulb, BR30 soft white (2700K)', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + ...generic.light_onoff_brightness(), }, { zigbeeModel: ['45852'], @@ -490,9 +483,7 @@ const devices = [ model: 'E11-G13', vendor: 'Sengled', description: 'Element Classic (A19)', - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + ...generic.light_onoff_brightness(), }, ]; From cec60beab4a4f55a02e92ade714aebf29883e8e3 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 13 Jun 2018 20:03:59 +0200 Subject: [PATCH 072/676] Set correct model number for TRADFRI transformer 30W (ICPSHC24-30EU-IL-1) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 38484fa6d1da8..cb473385ef3f5 100644 --- a/devices.js +++ b/devices.js @@ -294,7 +294,7 @@ const devices = [ }, { zigbeeModel: ['TRADFRI transformer 30W'], - model: '603.426.56', + model: 'ICPSHC24-30EU-IL-1', vendor: 'IKEA', description: 'TRADFRI driver for wireless control (30 watt)', ...generic.light_onoff_brightness(), From b39887ecd17e4374c29752c9b6640f600c185347 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 13 Jun 2018 20:09:57 +0200 Subject: [PATCH 073/676] Support LED1649C5. --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index cb473385ef3f5..db1d2510819fd 100644 --- a/devices.js +++ b/devices.js @@ -273,6 +273,13 @@ const devices = [ description: 'TRADFRI LED bulb E27 600 lumen, dimmable, color, opal white', ...generic.light_onoff_brightness_colorxy(), }, + { + zigbeeModel: ['TRADFRI bulb E14 W op/ch 400lm'], + model: 'LED1649C5', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E14 400 lumen, dimmable warm white, chandelier opal', + ...generic.light_onoff_brightness(), + }, { zigbeeModel: ['TRADFRI wireless dimmer'], model: 'ICTC-G-1', From 3fe24e75a3d5bcaa0b90dcfc423fdc06abd5bd6a Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 13 Jun 2018 20:17:41 +0200 Subject: [PATCH 074/676] Update documentation for QBKG03LM --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index db1d2510819fd..0cdedd7668520 100644 --- a/devices.js +++ b/devices.js @@ -100,7 +100,7 @@ const devices = [ model: 'QBKG03LM', vendor: 'Xiaomi', description: 'Aqara double key wired wall switch', - supports: 'l1 and l2 on/off', + supports: 'left and right on/off', fromZigbee: [fz.QBKG03LM_state, fz.QBKG03LM_buttons], toZigbee: [tz.onoff], ep: {'left': 2, 'right': 3}, From 72c9eb5ef50bc804e62914dfa5126ce37f4e1d01 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 13 Jun 2018 20:19:06 +0200 Subject: [PATCH 075/676] 2.0.6 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c140941b28f38..6654627e4ce01 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.5", + "version": "2.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 00a19d7661e80..c62f2f8c44c4d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.5", + "version": "2.0.6", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 5fa09e80102d64ba9a45cef9e2b4dc952abfe9d5 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 14 Jun 2018 18:13:43 +0200 Subject: [PATCH 076/676] Don't use spread operator. #15 --- devices.js | 84 ++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 63 insertions(+), 21 deletions(-) diff --git a/devices.js b/devices.js index 0cdedd7668520..8d7802f8b204f 100644 --- a/devices.js +++ b/devices.js @@ -229,56 +229,72 @@ const devices = [ model: 'LED1545G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 980 lumen, dimmable, white spectrum, opal white', - ...generic.light_onoff_brightness_colortemp(), + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm'], model: 'LED1623G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, { zigbeeModel: ['TRADFRI bulb GU10 WS 400lm'], model: 'LED1537R6', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable, white spectrum', - ...generic.light_onoff_brightness_colortemp(), + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { zigbeeModel: ['TRADFRI bulb GU10 W 400lm'], model: 'LED1650R5', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, { zigbeeModel: ['TRADFRI bulb E14 WS opal 400lm', 'TRADFRI bulb E12 WS opal 400lm'], model: 'LED1536G5', vendor: 'IKEA', description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable, white spectrum, opal white', - ...generic.light_onoff_brightness_colortemp(), + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { zigbeeModel: ['TRADFRI bulb E26 opal 1000lm'], model: 'LED1622G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26 1000 lumen, dimmable, opal white', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, { zigbeeModel: ['TRADFRI bulb E27 CWS opal 600lm'], model: 'LED1624G9', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 600 lumen, dimmable, color, opal white', - ...generic.light_onoff_brightness_colorxy(), + supports: generic.light_onoff_brightness_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, }, { zigbeeModel: ['TRADFRI bulb E14 W op/ch 400lm'], model: 'LED1649C5', vendor: 'IKEA', description: 'TRADFRI LED bulb E14 400 lumen, dimmable warm white, chandelier opal', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, { zigbeeModel: ['TRADFRI wireless dimmer'], @@ -304,7 +320,9 @@ const devices = [ model: 'ICPSHC24-30EU-IL-1', vendor: 'IKEA', description: 'TRADFRI driver for wireless control (30 watt)', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, // Philips @@ -313,21 +331,27 @@ const devices = [ model: '7146060PH', vendor: 'Philips', description: 'Hue Go', - ...generic.light_onoff_brightness_colortemp_colorxy(), + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { zigbeeModel: ['LWB010'], model: '8718696449691', vendor: 'Philips', description: 'Hue White Single bulb B22', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, { zigbeeModel: ['LCT015'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E27', - ...generic.light_onoff_brightness_colortemp_colorxy(), + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, // Belkin @@ -336,7 +360,9 @@ const devices = [ model: 'F7C033', vendor: 'Belkin', description: 'WeMo smart LED bulb', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, // EDP @@ -376,7 +402,9 @@ const devices = [ model: 'AA69697', vendor: 'OSRAM', description: 'Classic A60 RGBW', - ...generic.light_onoff_brightness_colortemp_colorxy(), + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { // AA70155 is model number of both bulbs. @@ -384,7 +412,9 @@ const devices = [ model: 'AA70155', vendor: 'OSRAM', description: 'LIGHTIFY LED A19 tunable white / Classic A60 TW', - ...generic.light_onoff_brightness_colortemp(), + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { zigbeeModel: ['Plug 01'], @@ -420,7 +450,9 @@ const devices = [ model: 'HALIGHTDIMWWE27', vendor: 'Hive', description: 'Active light dimmable', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, // Innr @@ -429,7 +461,9 @@ const devices = [ model: 'RB 185 C', vendor: 'Innr', description: 'E27 Bulb RGBW', - ...generic.light_onoff_brightness_colortemp_colorxy(), + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, // Sylvania @@ -438,14 +472,18 @@ const devices = [ model: '73742', vendor: 'Sylvania', description: 'LIGHTIFY LED adjustable white RT 5/6', - ...generic.light_onoff_brightness_colortemp(), + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { zigbeeModel: ['LIGHTIFY BR Tunable White'], model: '73740', vendor: 'Sylvania', description: 'LIGHTIFY LED adjustable white BR30', - ...generic.light_onoff_brightness_colortemp(), + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, // GE @@ -454,7 +492,9 @@ const devices = [ model: '22670', vendor: 'GE', description: 'Link smart LED light bulb, BR30 soft white (2700K)', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, { zigbeeModel: ['45852'], @@ -490,7 +530,9 @@ const devices = [ model: 'E11-G13', vendor: 'Sengled', description: 'Element Classic (A19)', - ...generic.light_onoff_brightness(), + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, ]; From 9637b3f5130c4009ba5810fc0a10213f9d5abb56 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 14 Jun 2018 18:14:06 +0200 Subject: [PATCH 077/676] 2.0.7 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6654627e4ce01..c795b49a7af67 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.6", + "version": "2.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c62f2f8c44c4d..672e7ca1766e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.6", + "version": "2.0.7", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From d64a269e58fae4ea6f3e782715517bc4736ca557 Mon Sep 17 00:00:00 2001 From: Ilya Kirov Date: Fri, 15 Jun 2018 15:52:01 +0300 Subject: [PATCH 078/676] Ignore 'genBasic' 'devChange' event Sometimes cube generate 'devChange' events, like here https://community.home-assistant.io/t/zigbee2mqtt-getting-rid-of-your-proprietary-zigbee-bridges-xiaomi-hue-tradfri/52108/180 Suppress them. --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 8d7802f8b204f..a184c5388f758 100644 --- a/devices.js +++ b/devices.js @@ -185,7 +185,7 @@ const devices = [ supports: 'shake, wakeup, fall, tap, slide, flip180, flip90, rotate_left and rotate_right', fromZigbee: [ fz.xiaomi_battery_3v, fz.MFKZQ01LM_action_multistate, fz.MFKZQ01LM_action_analog, - fz.ignore_analog_change, fz.ignore_multistate_change, + fz.ignore_analog_change, fz.ignore_multistate_change, fz.ignore_basic_change, ], toZigbee: [], }, From d7bf90450a729ccea1aa66e8c9ff361817da17b0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 15 Jun 2018 17:02:52 +0200 Subject: [PATCH 079/676] 2.0.8 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c795b49a7af67..dd59e858455c2 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.7", + "version": "2.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 672e7ca1766e8..347763dc006b3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.7", + "version": "2.0.8", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 8b374bbf89541a1390b021d67fc099ed304b6838 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 15 Jun 2018 17:04:58 +0200 Subject: [PATCH 080/676] Experimental support for QBKG11LM and QBKG12LM. https://github.com/Koenkk/zigbee2mqtt/issues/117 --- converters/fromZigbee.js | 33 +++++++++++++++++++++++++++++++-- devices.js | 30 ++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index adf9a2cf5b6f1..370354f8da13d 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -371,7 +371,31 @@ const converters = { } }, }, - QBKG04LM_state: { + QBKG11LM_power: { + cid: 'genBasic', + type: 'attReport', + convert: (model, msg, publish, options) => { + if (msg.data.data['65281']) { + const data = msg.data.data['65281']; + return { + power: precisionRound(data['152'], 2), + consumption: precisionRound(data['149'], 2), + temperature: precisionRound(data['3'], 2), + }; + } + }, + }, + QBKG12LM_power: { + cid: 'genAnalogInput', + type: 'attReport', + convert: (model, msg, publish, options) => { + const key = `power_${getKey(model.ep, msg.endpoints[0].epId)}`; + const payload = {}; + payload[key] = precisionRound(msg.data.data['presentValue'], 2); + return payload; + }, + }, + QBKG04LM_QBKG11LM_state: { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { @@ -380,7 +404,7 @@ const converters = { } }, }, - QBKG03LM_state: { + QBKG03LM_QBKG12LM_state: { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { @@ -500,6 +524,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_multistate_report: { + cid: 'genMultistateInput', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, ignore_multistate_change: { cid: 'genMultistateInput', type: 'devChange', diff --git a/devices.js b/devices.js index a184c5388f758..3ca4bd78f9ebe 100644 --- a/devices.js +++ b/devices.js @@ -91,7 +91,20 @@ const devices = [ vendor: 'Xiaomi', description: 'Aqara single key wired wall switch', supports: 'on/off', - fromZigbee: [fz.QBKG04LM_state, fz.ignore_onoff_change], + fromZigbee: [fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change], + toZigbee: [tz.onoff], + ep: {'': 2}, + }, + { + zigbeeModel: ['lumi.ctrl_ln1.aq1'], + model: 'QBKG11LM', + vendor: 'Xiaomi', + description: 'Aqara single key wired wall switch', + supports: 'on/off, power measurement', + fromZigbee: [ + fz.QBKG04LM_QBKG11LM_state, fz.QBKG11LM_power, fz.ignore_onoff_change, fz.ignore_basic_change, + fz.ignore_multistate_report, fz.ignore_multistate_change, + ], toZigbee: [tz.onoff], ep: {'': 2}, }, @@ -101,10 +114,23 @@ const devices = [ vendor: 'Xiaomi', description: 'Aqara double key wired wall switch', supports: 'left and right on/off', - fromZigbee: [fz.QBKG03LM_state, fz.QBKG03LM_buttons], + fromZigbee: [fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons], toZigbee: [tz.onoff], ep: {'left': 2, 'right': 3}, }, + { + zigbeeModel: ['lumi.ctrl_ln2.aq1'], + model: 'QBKG12LM', + vendor: 'Xiaomi', + description: 'Aqara double key wired wall switch', + supports: 'left and right on/off, power measurement', + fromZigbee: [ + fz.QBKG03LM_QBKG12LM_state, fz.ignore_analog_change, fz.QBKG12LM_power, + fz.ignore_multistate_report, fz.ignore_multistate_change, + ], + toZigbee: [tz.onoff], + ep: {'left': 1, 'right': 2}, + }, { zigbeeModel: ['lumi.sens'], model: 'WSDCGQ01LM', From 3da470afc349aaeabac56cd015707f5e0538183e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 16 Jun 2018 00:25:24 +0200 Subject: [PATCH 081/676] Attempt to fix power_undefined for QBKG12LM. https://github.com/Koenkk/zigbee2mqtt/issues/117 --- converters/fromZigbee.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 370354f8da13d..0c26e9978628c 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -389,7 +389,8 @@ const converters = { cid: 'genAnalogInput', type: 'attReport', convert: (model, msg, publish, options) => { - const key = `power_${getKey(model.ep, msg.endpoints[0].epId)}`; + const mapping = {4: 'left', 5: 'right'}; + const key = `power_${mapping[msg.endpoints[0].epId]}`; const payload = {}; payload[key] = precisionRound(msg.data.data['presentValue'], 2); return payload; From 8e589633ebeb56396446f7866cde53800bdbc8f4 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 00:39:49 +0200 Subject: [PATCH 082/676] Update QBKG12LM converters. https://github.com/Koenkk/zigbee2mqtt/issues/117 --- converters/fromZigbee.js | 23 ++++++++++++++++++----- devices.js | 4 ++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 0c26e9978628c..cda9f705260b7 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -386,14 +386,22 @@ const converters = { }, }, QBKG12LM_power: { - cid: 'genAnalogInput', + cid: 'genBasic', type: 'attReport', convert: (model, msg, publish, options) => { + // TODO + console.log('EP', msg.endpoints[0].epId); + const mapping = {4: 'left', 5: 'right'}; - const key = `power_${mapping[msg.endpoints[0].epId]}`; - const payload = {}; - payload[key] = precisionRound(msg.data.data['presentValue'], 2); - return payload; + if (msg.data.data['65281']) { + const data = msg.data.data['65281']; + const key = mapping[msg.endpoints[0].epId]; + const payload = {}; + payload[`power_${key}`] = precisionRound(data['152'], 2); + payload[`consumption_${key}`] = precisionRound(data['149'], 2); + payload[`temperature_${key}`] = precisionRound(data['3'], 2); + return payload; + } }, }, QBKG04LM_QBKG11LM_state: { @@ -525,6 +533,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_analog_change: { + cid: 'genAnalogInput', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, ignore_multistate_report: { cid: 'genMultistateInput', type: 'attReport', diff --git a/devices.js b/devices.js index 3ca4bd78f9ebe..6ba9abc6db430 100644 --- a/devices.js +++ b/devices.js @@ -125,8 +125,8 @@ const devices = [ description: 'Aqara double key wired wall switch', supports: 'left and right on/off, power measurement', fromZigbee: [ - fz.QBKG03LM_QBKG12LM_state, fz.ignore_analog_change, fz.QBKG12LM_power, - fz.ignore_multistate_report, fz.ignore_multistate_change, + fz.QBKG03LM_QBKG12LM_state, fz.QBKG12LM_power, fz.ignore_analog_change, fz.ignore_basic_change, + fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.ignore_analog_change, ], toZigbee: [tz.onoff], ep: {'left': 1, 'right': 2}, From 47e96ecef82385e4ffc87b4ca2929c1130e177e8 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 00:42:33 +0200 Subject: [PATCH 083/676] Fix ignore_analog_report --- converters/fromZigbee.js | 2 +- devices.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index cda9f705260b7..44e0046fad0d6 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -533,7 +533,7 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, - ignore_analog_change: { + ignore_analog_report: { cid: 'genAnalogInput', type: 'attReport', convert: (model, msg, publish, options) => null, diff --git a/devices.js b/devices.js index 6ba9abc6db430..8610710f7c33c 100644 --- a/devices.js +++ b/devices.js @@ -126,7 +126,7 @@ const devices = [ supports: 'left and right on/off, power measurement', fromZigbee: [ fz.QBKG03LM_QBKG12LM_state, fz.QBKG12LM_power, fz.ignore_analog_change, fz.ignore_basic_change, - fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.ignore_analog_change, + fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.ignore_analog_report, ], toZigbee: [tz.onoff], ep: {'left': 1, 'right': 2}, From 3253e2de8e1a708aad22c27e2ffc8dfdfc22d958 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 16 Jun 2018 01:37:30 +0200 Subject: [PATCH 084/676] Support TRADFRI driver for wireless control (10 watt) --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 8610710f7c33c..a2b911b41959b 100644 --- a/devices.js +++ b/devices.js @@ -341,6 +341,15 @@ const devices = [ }); }, }, + { + zigbeeModel: ['TRADFRI transformer 10W'], + model: 'ICPSHC24-10EU-IL-1', + vendor: 'IKEA', + description: 'TRADFRI driver for wireless control (10 watt)', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, { zigbeeModel: ['TRADFRI transformer 30W'], model: 'ICPSHC24-30EU-IL-1', From 6727a0623141a601f6218ef12aa037dba2cb7520 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 01:38:39 +0200 Subject: [PATCH 085/676] 2.0.9 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index dd59e858455c2..0d4b23f6ac6f0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.8", + "version": "2.0.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 347763dc006b3..621750488d822 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.8", + "version": "2.0.9", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 57a9e52bc6cc7e602cf0d29d7d94bd641c7b9ed1 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 18:07:49 +0200 Subject: [PATCH 086/676] Ignore analog for QBKG11LM. https://github.com/Koenkk/zigbee2mqtt/issues/117 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index a2b911b41959b..3c2b89d92e740 100644 --- a/devices.js +++ b/devices.js @@ -103,7 +103,7 @@ const devices = [ supports: 'on/off, power measurement', fromZigbee: [ fz.QBKG04LM_QBKG11LM_state, fz.QBKG11LM_power, fz.ignore_onoff_change, fz.ignore_basic_change, - fz.ignore_multistate_report, fz.ignore_multistate_change, + fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_analog_change, fz.ignore_analog_report, ], toZigbee: [tz.onoff], ep: {'': 2}, From fc3ff127800cf35a06ecd48f356d5291ddb9ade5 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 18:14:01 +0200 Subject: [PATCH 087/676] Update QBKG12LM_power. https://github.com/Koenkk/zigbee2mqtt/issues/117 --- converters/fromZigbee.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 44e0046fad0d6..96a1a9ace8b6e 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -391,11 +391,9 @@ const converters = { convert: (model, msg, publish, options) => { // TODO console.log('EP', msg.endpoints[0].epId); - - const mapping = {4: 'left', 5: 'right'}; if (msg.data.data['65281']) { const data = msg.data.data['65281']; - const key = mapping[msg.endpoints[0].epId]; + const key = getKey(model.ep, msg.endpoints[0].epId); const payload = {}; payload[`power_${key}`] = precisionRound(data['152'], 2); payload[`consumption_${key}`] = precisionRound(data['149'], 2); From 54f016380faa4739e15dc699aa6984e37b527ebd Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 20:39:23 +0200 Subject: [PATCH 088/676] Remove ep for QBKG11LM --- devices.js | 1 - 1 file changed, 1 deletion(-) diff --git a/devices.js b/devices.js index 3c2b89d92e740..dc3655801f066 100644 --- a/devices.js +++ b/devices.js @@ -106,7 +106,6 @@ const devices = [ fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_analog_change, fz.ignore_analog_report, ], toZigbee: [tz.onoff], - ep: {'': 2}, }, { zigbeeModel: ['lumi.ctrl_neutral2'], From 7686f746f7d67fe2e43ace7bcf4399dc935ab910 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 20:55:42 +0200 Subject: [PATCH 089/676] Add support for IKEA FLOALT panels. --- devices.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/devices.js b/devices.js index dc3655801f066..8cb2ec58ded8b 100644 --- a/devices.js +++ b/devices.js @@ -358,6 +358,33 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['FLOALT panel WS 30x30'], + model: 'L1527', + vendor: 'IKEA', + description: 'FLOALT LED light panel, dimmable, white spectrum (30x30 cm)', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, + { + zigbeeModel: ['FLOALT panel WS 60x60'], + model: 'L1529', + vendor: 'IKEA', + description: 'FLOALT LED light panel, dimmable, white spectrum (60x60 cm)', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, + { + zigbeeModel: ['FLOALT panel WS 30x90'], + model: 'L1528', + vendor: 'IKEA', + description: 'FLOALT LED light panel, dimmable, white spectrum (30x90 cm)', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, // Philips { From 41a7dd11af75ac1625912536ac534151bb5719a5 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 21:00:12 +0200 Subject: [PATCH 090/676] Support LED1546G12 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 8cb2ec58ded8b..fb6a70749a913 100644 --- a/devices.js +++ b/devices.js @@ -258,6 +258,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['TRADFRI bulb E27 WS clear 950lm'], + model: 'LED1546G12', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E27 950 lumen, dimmable, white spectrum, clear', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm'], model: 'LED1623G12', From 4d4749a44f91f1868dae10249e3b76863792ce8b Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 21:05:51 +0200 Subject: [PATCH 091/676] Support E26 variant of LED1545G12 and LED1546G12. --- devices.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/devices.js b/devices.js index fb6a70749a913..172ed71affd8b 100644 --- a/devices.js +++ b/devices.js @@ -250,19 +250,19 @@ const devices = [ // IKEA { - zigbeeModel: ['TRADFRI bulb E27 WS opal 980lm'], + zigbeeModel: ['TRADFRI bulb E27 WS opal 980lm', 'TRADFRI bulb E26 WS opal 980lm'], model: 'LED1545G12', vendor: 'IKEA', - description: 'TRADFRI LED bulb E27 980 lumen, dimmable, white spectrum, opal white', + description: 'TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white', supports: generic.light_onoff_brightness_colortemp().supports, fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { - zigbeeModel: ['TRADFRI bulb E27 WS clear 950lm'], + zigbeeModel: ['TRADFRI bulb E27 WS clear 950lm', 'TRADFRI bulb E26 WS clear 950lm'], model: 'LED1546G12', vendor: 'IKEA', - description: 'TRADFRI LED bulb E27 950 lumen, dimmable, white spectrum, clear', + description: 'TRADFRI LED bulb E26/E27 950 lumen, dimmable, white spectrum, clear', supports: generic.light_onoff_brightness_colortemp().supports, fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, From 8ee4eca2eb34def2fe92b8bd03d9f462caf70b7b Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 21:50:37 +0200 Subject: [PATCH 092/676] Support more Innr devices. --- devices.js | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/devices.js b/devices.js index 172ed71affd8b..f2472f1e5ec3d 100644 --- a/devices.js +++ b/devices.js @@ -535,6 +535,114 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['RB 165'], + model: 'RB 165', + vendor: 'Innr', + description: 'E27 Bulb', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['RB 175 W'], + model: 'RB 175 W', + vendor: 'Innr', + description: 'E27 Bulb warm dimming', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['RS 125'], + model: 'RS 125', + vendor: 'Innr', + description: 'GU10 Spot', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['RB 145'], + model: 'RB 145', + vendor: 'Innr', + description: 'E14 Candle', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['PL 110'], + model: 'PL 110', + vendor: 'Innr', + description: 'Puck Light', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['ST 110'], + model: 'ST 110', + vendor: 'Innr', + description: 'Strip Light', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['UC 110'], + model: 'UC 110', + vendor: 'Innr', + description: 'Under Cabinet Light', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['DL 110 N'], + model: 'DL 110 N', + vendor: 'Innr', + description: 'Spot narrow', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['DL 110 W'], + model: 'DL 110 W', + vendor: 'Innr', + description: 'Spot wide', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['SL 110 N'], + model: 'SL 110 N', + vendor: 'Innr', + description: 'Spot Flex narrow', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['SL 110 M'], + model: 'SL 110 M', + vendor: 'Innr', + description: 'Spot Flex medium', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + { + zigbeeModel: ['SL 110 W'], + model: 'SL 110 W', + vendor: 'Innr', + description: 'Spot Flex wide', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, // Sylvania { From 4ba675cb7dace7e6ca2316f29419ece85812785a Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 16 Jun 2018 21:52:43 +0200 Subject: [PATCH 093/676] 2.0.10 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0d4b23f6ac6f0..4d315c868581d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.9", + "version": "2.0.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 621750488d822..2cd07e292e589 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.9", + "version": "2.0.10", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 916cecb269f185e3b38a999f24db855f3a2a92e6 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 17 Jun 2018 10:42:05 +0200 Subject: [PATCH 094/676] Support LIGHTIFY LED PAR16 50 GU10 tunable white. --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index f2472f1e5ec3d..0ec09dd62f697 100644 --- a/devices.js +++ b/devices.js @@ -486,6 +486,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['PAR16 50 TW'], + model: 'AA68199', + vendor: 'OSRAM', + description: 'LIGHTIFY LED PAR16 50 GU10 tunable white', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['Plug 01'], model: 'AB3257001NJ', From bdacb47884c69a359bb9629fb13abca4e2bf9599 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 17 Jun 2018 16:31:06 +0200 Subject: [PATCH 095/676] Fix QBKG12LM_power converter. https://github.com/Koenkk/zigbee2mqtt/issues/117 --- converters/fromZigbee.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 96a1a9ace8b6e..356f081fe1168 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -389,16 +389,13 @@ const converters = { cid: 'genBasic', type: 'attReport', convert: (model, msg, publish, options) => { - // TODO - console.log('EP', msg.endpoints[0].epId); if (msg.data.data['65281']) { const data = msg.data.data['65281']; - const key = getKey(model.ep, msg.endpoints[0].epId); - const payload = {}; - payload[`power_${key}`] = precisionRound(data['152'], 2); - payload[`consumption_${key}`] = precisionRound(data['149'], 2); - payload[`temperature_${key}`] = precisionRound(data['3'], 2); - return payload; + return { + power: precisionRound(data['152'], 2), + consumption: precisionRound(data['149'], 2), + temperature: precisionRound(data['3'], 2), + }; } }, }, From a30d1cf982473aea16c3de4dcc4fce8c0b16fe8c Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 17 Jun 2018 16:55:50 +0200 Subject: [PATCH 096/676] 2.0.11 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4d315c868581d..61d2f5ba1e8ee 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.10", + "version": "2.0.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2cd07e292e589..b387f1b2d8ece 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.10", + "version": "2.0.11", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 765b6de46dea3ea80c29541fdbdf0834330a7a48 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Mon, 18 Jun 2018 22:12:10 +0300 Subject: [PATCH 097/676] Lights send back it's state when turn on/off --- converters/fromZigbee.js | 7 +++++++ devices.js | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 356f081fe1168..72ffce4605f5f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -249,6 +249,13 @@ const converters = { return {contact: msg.data.data['onOff'] === 0}; }, }, + light_state: { + cid: 'genOnOff', + type: 'devChange', + convert: (model, msg, publish, options) => { + return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + }, + }, light_brightness: { cid: 'genLevelCtrl', type: 'devChange', diff --git a/devices.js b/devices.js index 0ec09dd62f697..8bf8315033d8d 100644 --- a/devices.js +++ b/devices.js @@ -7,28 +7,28 @@ const generic = { light_onoff_brightness: () => { return { supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change], + fromZigbee: [fz.light_brightness, fz.light_state], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], }; }, light_onoff_brightness_colortemp: () => { return { supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }; }, light_onoff_brightness_colorxy: () => { return { supports: 'on/off, brightness, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], toZigbee: [tz.onoff, tz.light_brightness, tz.light_color, tz.ignore_transition], }; }, light_onoff_brightness_colortemp_colorxy: () => { return { supports: 'on/off, brightness, color temperature, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.ignore_onoff_change], + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }; }, From 496111ce69754f8297422853128e9061cf4abadd Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Tue, 19 Jun 2018 23:07:59 +0300 Subject: [PATCH 098/676] New bulb "JIAWEN Wireless Bulb E27 9W RGBW" https://www.gearbest.com/smart-lighting/pp_1049610.html?wid=1433363 It can more than brightness and colortemp... but later --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index 8bf8315033d8d..ef569f788b2a9 100644 --- a/devices.js +++ b/devices.js @@ -721,6 +721,17 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + + // Jiawen + { + zigbeeModel: ['FB56-ZCW08KU1.1'], + model: 'FB56-ZCW08KU1.1', + vendor: 'Feibit Inc co.', + description: 'JIAWEN Wireless Bulb E27 9W RGBW', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, ]; module.exports = devices; From 5eebc5b404eadfa6a5df44ec0d00fc42e25a768b Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 19 Jun 2018 22:10:47 +0200 Subject: [PATCH 099/676] 2.0.12 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 61d2f5ba1e8ee..d882daa2a5dc1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.11", + "version": "2.0.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b387f1b2d8ece..7061a577a8ef7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.11", + "version": "2.0.12", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 81e3ec5b35a3070dd07319428720b69cdc265c2e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 19 Jun 2018 22:18:43 +0200 Subject: [PATCH 100/676] Update JIAWEN Wireless Bulb E27 9W RGBW description --- devices.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/devices.js b/devices.js index ef569f788b2a9..be5a8c128ef24 100644 --- a/devices.js +++ b/devices.js @@ -722,12 +722,12 @@ const devices = [ toZigbee: generic.light_onoff_brightness().toZigbee, }, - // Jiawen + // JIAWEN { zigbeeModel: ['FB56-ZCW08KU1.1'], - model: 'FB56-ZCW08KU1.1', - vendor: 'Feibit Inc co.', - description: 'JIAWEN Wireless Bulb E27 9W RGBW', + model: 'K2RGBW01', + vendor: 'JIAWEN', + description: 'Wireless Bulb E27 9W RGBW', supports: generic.light_onoff_brightness_colortemp().supports, fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, From 67f19c79ad1c05008479e10dd3a622a18e283d23 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Wed, 20 Jun 2018 00:05:05 +0300 Subject: [PATCH 101/676] Update JIAWEN to light_onoff_brightness_colortemp_colorxy converters --- devices.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index be5a8c128ef24..88f8be25c3bb7 100644 --- a/devices.js +++ b/devices.js @@ -728,9 +728,9 @@ const devices = [ model: 'K2RGBW01', vendor: 'JIAWEN', description: 'Wireless Bulb E27 9W RGBW', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, ]; From 14a29a0be725c11cfbce5ce7d4cfb6ecbecb95d8 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 19 Jun 2018 23:14:22 +0200 Subject: [PATCH 102/676] 2.0.13 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d882daa2a5dc1..8ea7b2c2a9fbd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.12", + "version": "2.0.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7061a577a8ef7..50ed91d362aed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.12", + "version": "2.0.13", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 7b210f395466c44626de8ede9076292bd17b046d Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 20 Jun 2018 20:52:27 +0200 Subject: [PATCH 103/676] Dont send occupancy: false when timeout is 0. --- converters/fromZigbee.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 72ffce4605f5f..cc61c5a66768b 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -226,7 +226,8 @@ const converters = { convert: (model, msg, publish, options) => { // The occupancy sensor only sends a message when motion detected. // Therefore we need to publish the no_motion detected by ourselves. - const timeout = (options && options.occupancy_timeout) ? options.occupancy_timeout : occupancyTimeout; + const useOptionsTimeout = options && options.hasOwnProperty('occupancy_timeout'); + const timeout = useOptionsTimeout ? options.occupancy_timeout : occupancyTimeout; const deviceID = msg.endpoints[0].device.ieeeAddr; // Stop existing timer because motion is detected and set a new one. @@ -235,10 +236,13 @@ const converters = { store[deviceID] = null; } - store[deviceID] = setTimeout(() => { - publish({occupancy: false}); - store[deviceID] = null; - }, timeout * 1000); + if (timeout !== 0) { + store[deviceID] = setTimeout(() => { + publish({occupancy: false}); + store[deviceID] = null; + }, timeout * 1000); + } + return {occupancy: true}; }, }, From c769bc97911749aae7ed484f7ddf47b882a4793f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 20 Jun 2018 20:52:44 +0200 Subject: [PATCH 104/676] 2.0.14 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8ea7b2c2a9fbd..4afe465da757d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.13", + "version": "2.0.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 50ed91d362aed..894946c591808 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.13", + "version": "2.0.14", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 571f99903f4573ad38848b7c90ac6c863632b12a Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 24 Jun 2018 19:14:19 +0200 Subject: [PATCH 105/676] Set battery range to 2700-3000. https://github.com/Koenkk/zigbee2mqtt/issues/142 --- converters/fromZigbee.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index cc61c5a66768b..56b4dc04d30ea 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -10,8 +10,8 @@ const clickLookup = { }; const battery3V = { - min: 2800, - max: 3300, + min: 2700, + max: 3000, }; const occupancyTimeout = 60; // In seconds From 7967ea0beb5618130e85ece851627687d45eaaf6 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 24 Jun 2018 19:14:46 +0200 Subject: [PATCH 106/676] 2.0.15 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4afe465da757d..db7426220c196 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.14", + "version": "2.0.15", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 894946c591808..d159c05fd7bdd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.14", + "version": "2.0.15", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 65c724910aba53089ba9e8dea97b65317b0349c8 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 25 Jun 2018 20:09:50 +0200 Subject: [PATCH 107/676] Avoid callback hell. --- devices.js | 83 +++++++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/devices.js b/devices.js index 88f8be25c3bb7..fd7a95a989a9a 100644 --- a/devices.js +++ b/devices.js @@ -34,6 +34,34 @@ const generic = { }, }; +const foundationCfg = {manufSpec: 0, disDefaultRsp: 0}; + +const execute = (device, actions, callback) => { + if (device) { + actions = actions.reverse(); + + const next = () => { + if (actions.length === 0) { + callback(true); + return; + } + + const action = actions.pop(); + action((error) => { + if (error) { + callback(false); + } else { + next(); + } + }); + }; + + next(); + } else { + callback(false); + } +}; + const devices = [ // Xiaomi { @@ -344,9 +372,7 @@ const devices = [ onAfIncomingMsg: [1], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); - device.bind('genLevelCtrl', coordinator, (error) => { - callback(!error); - }); + execute(device, [(cb) => device.bind('genLevelCtrl', coordinator, cb)], callback); }, }, { @@ -446,12 +472,7 @@ const devices = [ toZigbee: [tz.onoff], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 85); - - if (device) { - device.report('seMetering', 'instantaneousDemand', 10, 60, 1, (error) => { - callback(!error); - }); - } + execute(device, [(cb) => device.report('seMetering', 'instantaneousDemand', 10, 60, 1, cb)], callback); }, }, @@ -504,22 +525,14 @@ const devices = [ fromZigbee: [fz.ignore_onoff_change, fz.generic_state], toZigbee: [tz.onoff], configure: (ieeeAddr, shepherd, coordinator, callback) => { - const cfgRptRec = { - direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0, - }; - const device = shepherd.find(ieeeAddr, 3); - if (device) { - device.bind('genOnOff', coordinator, (error) => { - if (error) { - callback(error); - } else { - device.foundation('genOnOff', 'configReport', [cfgRptRec]).then((rsp) => { - callback(rsp[0].status === 0); - }); - } - }); - } + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); }, }, @@ -692,22 +705,14 @@ const devices = [ fromZigbee: [fz.light_brightness, fz.ignore_onoff_change, fz.generic_state], toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], configure: (ieeeAddr, shepherd, coordinator, callback) => { - const cfgRptRec = { - direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0, - }; - + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; const device = shepherd.find(ieeeAddr, 1); - if (device) { - device.bind('genOnOff', coordinator, (error) => { - if (error) { - callback(error); - } else { - device.foundation('genOnOff', 'configReport', [cfgRptRec]).then((rsp) => { - callback(rsp[0].status === 0); - }); - } - }); - } + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); }, }, From 6de0bce9d2f62ab47831476dbfb14c4f6340f7d2 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 25 Jun 2018 20:10:23 +0200 Subject: [PATCH 108/676] 2.0.16 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index db7426220c196..2fd993ebfb1fd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.15", + "version": "2.0.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d159c05fd7bdd..4ffd9382a6759 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.15", + "version": "2.0.16", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From be29481b4bc538b544135eb5fcc83bd2af44d4f4 Mon Sep 17 00:00:00 2001 From: doubleUS <31591364+wilfredsmit@users.noreply.github.com> Date: Mon, 25 Jun 2018 21:12:40 +0200 Subject: [PATCH 109/676] Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index fd7a95a989a9a..35e5afa54008e 100644 --- a/devices.js +++ b/devices.js @@ -431,6 +431,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['LWB006'], + model: '9290011370', + vendor: 'Philips', + description: 'Hue white Hue white A60 E27', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, { zigbeeModel: ['LWB010'], model: '8718696449691', From 884f29d3e8dd8919e2e3fb4ab155245db152f08d Mon Sep 17 00:00:00 2001 From: doubleUS <31591364+wilfredsmit@users.noreply.github.com> Date: Mon, 25 Jun 2018 21:27:08 +0200 Subject: [PATCH 110/676] Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 35e5afa54008e..e894aa122fc17 100644 --- a/devices.js +++ b/devices.js @@ -435,7 +435,7 @@ const devices = [ zigbeeModel: ['LWB006'], model: '9290011370', vendor: 'Philips', - description: 'Hue white Hue white A60 E27', + description: 'Hue white A60 bulb E27', supports: generic.light_onoff_brightness().supports, fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, From 61c8f936403aff1672c9019cbd8920bca1320b55 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 25 Jun 2018 21:56:33 +0200 Subject: [PATCH 111/676] 2.0.17 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2fd993ebfb1fd..2fee18fcc3148 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.16", + "version": "2.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4ffd9382a6759..60e7619894422 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.16", + "version": "2.0.17", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From ddada06a93083c13174a96a3a7f5c7478804352c Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 27 Jun 2018 21:15:57 +0200 Subject: [PATCH 112/676] Create custom devices section. --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index e894aa122fc17..0f4d1a9503f24 100644 --- a/devices.js +++ b/devices.js @@ -485,11 +485,11 @@ const devices = [ }, }, - // Texax Instruments + // Custom devices (DiY) { zigbeeModel: ['lumi.router'], model: 'CC2530.ROUTER', - vendor: 'Texas Instruments', + vendor: 'Custom devices (DiY)', description: '[CC2530 router](http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/)', supports: 'state, description, type, rssi', fromZigbee: [fz.CC2530ROUTER_state, fz.CC2530ROUTER_meta], From 04ef8a29d8e063c10e2caff3a4842a87f09b735c Mon Sep 17 00:00:00 2001 From: Pham Viet Dzung Date: Sat, 23 Jun 2018 18:18:53 +0700 Subject: [PATCH 113/676] Support DNCKATSW001 Light Switch --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index 0f4d1a9503f24..a2d4805a0ff5e 100644 --- a/devices.js +++ b/devices.js @@ -746,6 +746,17 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + + // DNCKAT + { + zigbeeModel: ['DNCKAT_S001'], + model: 'DNCKATSW001', + vendor: 'DNCKAT', + description: 'DNCKAT single key wired wall light switch', + supports: 'on/off', + fromZigbee: [fz.generic_state, fz.ignore_onoff_change], + toZigbee: [tz.onoff], + }, ]; module.exports = devices; From 9586b896688815322d9c31f01afb3799835cfffb Mon Sep 17 00:00:00 2001 From: Pham Viet Dzung Date: Sat, 23 Jun 2018 18:40:38 +0700 Subject: [PATCH 114/676] Support DNCKATSW001 Light Switch, fix eslint --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index a2d4805a0ff5e..49960525fab4e 100644 --- a/devices.js +++ b/devices.js @@ -746,7 +746,7 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, - + // DNCKAT { zigbeeModel: ['DNCKAT_S001'], From 776c3e6934e1f973f0b311a02e887c7e56101d4f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 27 Jun 2018 21:19:39 +0200 Subject: [PATCH 115/676] Add DNCKAT_S001 to custom devices section --- devices.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/devices.js b/devices.js index 49960525fab4e..f820602dfc08a 100644 --- a/devices.js +++ b/devices.js @@ -495,6 +495,15 @@ const devices = [ fromZigbee: [fz.CC2530ROUTER_state, fz.CC2530ROUTER_meta], toZigbee: [], }, + { + zigbeeModel: ['DNCKAT_S001'], + model: 'DNCKATSW001', + vendor: 'Custom devices (DiY)', + description: '[DNCKAT single key wired wall light switch](https://dzungpv.github.io/dnckatsw001/)', + supports: 'on/off', + fromZigbee: [fz.generic_state, fz.ignore_onoff_change], + toZigbee: [tz.onoff], + }, // OSRAM { @@ -746,17 +755,6 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, - - // DNCKAT - { - zigbeeModel: ['DNCKAT_S001'], - model: 'DNCKATSW001', - vendor: 'DNCKAT', - description: 'DNCKAT single key wired wall light switch', - supports: 'on/off', - fromZigbee: [fz.generic_state, fz.ignore_onoff_change], - toZigbee: [tz.onoff], - }, ]; module.exports = devices; From dfed3295de41ddf525f14e5a2dde0c1a5e970753 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 27 Jun 2018 21:23:31 +0200 Subject: [PATCH 116/676] 2.0.18 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2fee18fcc3148..d2eff06839c73 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.17", + "version": "2.0.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 60e7619894422..15d1b3b538dfe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.17", + "version": "2.0.18", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 2dfb138987897963ef18b905e76beba2d17dd183 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 29 Jun 2018 17:05:52 +0200 Subject: [PATCH 117/676] Support Netvox Z809A. https://github.com/Koenkk/zigbee2mqtt/issues/154 --- converters/fromZigbee.js | 17 +++++++++++++++++ devices.js | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 56b4dc04d30ea..3f408dcf8cc8c 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -477,6 +477,18 @@ const converters = { }; }, }, + Z809A_power: { + cid: 'haElectricalMeasurement', + type: 'attReport', + convert: (model, msg, publish, options) => { + return { + power: msg.data.data['activePower'], + current: msg.data.data['rmsCurrent'], + voltage: msg.data.data['rmsVoltage'], + }; + }, + }, + ICTC_G_1_move: { cmd: 'move', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), @@ -559,6 +571,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_electrical_change: { + cid: 'haElectricalMeasurement', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, ignore_cmd_readRsp: { cmd: 'readRsp', convert: (model, msg, publish, options) => null, diff --git a/devices.js b/devices.js index f820602dfc08a..817230cab5bfc 100644 --- a/devices.js +++ b/devices.js @@ -755,6 +755,27 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + + // Netvox + { + zigbeeModel: ['Z809AE3R'], + model: 'Z809A', + vendor: 'Netvox', + description: 'Power socket with power consumption monitoring', + supports: 'on/off, power measurement', + fromZigbee: [fz.generic_state, fz.ignore_onoff_change, fz.ignore_electrical_change, fz.Z809A_power], + toZigbee: [tz.onoff], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.report('haElectricalMeasurement', 'rmsVoltage', 10, 1000, 1, cb), + (cb) => device.report('haElectricalMeasurement', 'rmsCurrent', 10, 1000, 1, cb), + (cb) => device.report('haElectricalMeasurement', 'activePower', 10, 1000, 1, cb), + ]; + + execute(device, actions, callback); + }, + }, ]; module.exports = devices; From 4fcadd7e22a97e589de88a21f1fc36463e184610 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 30 Jun 2018 09:40:09 +0200 Subject: [PATCH 118/676] Add Z809AE3R power_factor. https://github.com/Koenkk/zigbee2mqtt/issues/154 --- converters/fromZigbee.js | 1 + devices.js | 1 + 2 files changed, 2 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3f408dcf8cc8c..65eb4f870e804 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -485,6 +485,7 @@ const converters = { power: msg.data.data['activePower'], current: msg.data.data['rmsCurrent'], voltage: msg.data.data['rmsVoltage'], + power_factor: msg.data.data['powerFactor'], }; }, }, diff --git a/devices.js b/devices.js index 817230cab5bfc..7ccd298f2ff0a 100644 --- a/devices.js +++ b/devices.js @@ -771,6 +771,7 @@ const devices = [ (cb) => device.report('haElectricalMeasurement', 'rmsVoltage', 10, 1000, 1, cb), (cb) => device.report('haElectricalMeasurement', 'rmsCurrent', 10, 1000, 1, cb), (cb) => device.report('haElectricalMeasurement', 'activePower', 10, 1000, 1, cb), + (cb) => device.report('haElectricalMeasurement', 'powerFactor', 10, 1000, 1, cb), ]; execute(device, actions, callback); From fed38483f0a9685171b73d75eb92ff32955f70fa Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 30 Jun 2018 09:41:53 +0200 Subject: [PATCH 119/676] Remove trailing enter. --- converters/fromZigbee.js | 1 - 1 file changed, 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 65eb4f870e804..355f8f63f351f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -489,7 +489,6 @@ const converters = { }; }, }, - ICTC_G_1_move: { cmd: 'move', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), From 223935fd217686ef47ff5507292f716e904ee5fb Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 30 Jun 2018 09:44:07 +0200 Subject: [PATCH 120/676] 2.0.19 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d2eff06839c73..80ada88aada3b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.18", + "version": "2.0.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 15d1b3b538dfe..3337946c357ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.18", + "version": "2.0.19", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 09f3258d7376b812d830e2980bd44a149f69ee4c Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Sat, 30 Jun 2018 09:50:43 +0200 Subject: [PATCH 121/676] Classic B40 TW - LIGHTIFY Classic B40 TW - LIGHTIFY --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 7ccd298f2ff0a..e26373b1efbee 100644 --- a/devices.js +++ b/devices.js @@ -534,6 +534,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['Classic B40 TW - LIGHTIFY'], + model: 'AB32840', + vendor: 'OSRAM', + description: 'LIGHTIFY LED Classic B40 TW tunable white', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['Plug 01'], model: 'AB3257001NJ', From d73f7aa68e8f309ff93e550a06dcd67b5d389ccf Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Sat, 30 Jun 2018 12:59:46 +0200 Subject: [PATCH 122/676] hue LST002 Lightstripe+ --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index e26373b1efbee..d3b4c249d1421 100644 --- a/devices.js +++ b/devices.js @@ -449,6 +449,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['LST002'], + model: 'xxxx', + vendor: 'Philips', + description: 'Hue white and color ambiance LightStripe+', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['LCT015'], model: '9290012573A', From aa802cf0db451432b8c946de35a8433df7bed900 Mon Sep 17 00:00:00 2001 From: iain Date: Sat, 30 Jun 2018 18:41:08 +0100 Subject: [PATCH 123/676] device update to support nanoleaf smrt ivy bulb --- devices.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/devices.js b/devices.js index d3b4c249d1421..680453bbbfb48 100644 --- a/devices.js +++ b/devices.js @@ -795,6 +795,16 @@ const devices = [ execute(device, actions, callback); }, }, + //Nanoleaf + { + zigbeeModel: ['NL08-0800'], + model: 'NL08-0800', + vendor: 'SmartIvy', + description: 'NANOLEAF - Smart Ivy Bulb - E27', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, ]; module.exports = devices; From 08753938f18561e5d2ee79b73d153684786ef985 Mon Sep 17 00:00:00 2001 From: iain Date: Sat, 30 Jun 2018 18:54:23 +0100 Subject: [PATCH 124/676] chore: tests --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 680453bbbfb48..e7cfba3633f51 100644 --- a/devices.js +++ b/devices.js @@ -795,7 +795,7 @@ const devices = [ execute(device, actions, callback); }, }, - //Nanoleaf + // Nanoleaf { zigbeeModel: ['NL08-0800'], model: 'NL08-0800', From acc07b853bd3cb5758a6b311890e43871f1c347e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 30 Jun 2018 23:29:03 +0200 Subject: [PATCH 125/676] Update devices.js --- devices.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index e7cfba3633f51..3da860e4982de 100644 --- a/devices.js +++ b/devices.js @@ -451,9 +451,9 @@ const devices = [ }, { zigbeeModel: ['LST002'], - model: 'xxxx', + model: '915005106701', vendor: 'Philips', - description: 'Hue white and color ambiance LightStripe+', + description: 'Hue white and color ambiance LightStrip plus', supports: generic.light_onoff_brightness_colortemp_colorxy().supports, fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, @@ -547,7 +547,7 @@ const devices = [ zigbeeModel: ['Classic B40 TW - LIGHTIFY'], model: 'AB32840', vendor: 'OSRAM', - description: 'LIGHTIFY LED Classic B40 TW tunable white', + description: 'LIGHTIFY LED Classic B40 tunable white', supports: generic.light_onoff_brightness_colortemp().supports, fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, From 1b69f29bd9afb186dcbce8791bea47260b97a7df Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 30 Jun 2018 23:36:00 +0200 Subject: [PATCH 126/676] Update NL08-0800 description. --- devices.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 3da860e4982de..34aad4248b31e 100644 --- a/devices.js +++ b/devices.js @@ -795,12 +795,13 @@ const devices = [ execute(device, actions, callback); }, }, + // Nanoleaf { zigbeeModel: ['NL08-0800'], model: 'NL08-0800', - vendor: 'SmartIvy', - description: 'NANOLEAF - Smart Ivy Bulb - E27', + vendor: 'Nanoleaf', + description: 'Smart Ivy Bulb E27', supports: generic.light_onoff_brightness().supports, fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, From 85750f4f3a37cef77130f66a0ed3555654d4f40c Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 30 Jun 2018 23:40:14 +0200 Subject: [PATCH 127/676] 2.0.20 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 80ada88aada3b..d6a5c9b4c54d0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.19", + "version": "2.0.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3337946c357ae..039a4b280b4c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.19", + "version": "2.0.20", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From c0e8daa0f1368cac5e4bbcbfec193b9faf2895e7 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Fri, 6 Jul 2018 17:02:17 +0200 Subject: [PATCH 128/676] phillips hue ['LTW013'], ['LCT003'], --- devices.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/devices.js b/devices.js index 34aad4248b31e..15f01acd9c240 100644 --- a/devices.js +++ b/devices.js @@ -467,6 +467,24 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['LCT003'], + model: 'TODO', + vendor: 'Philips', + description: 'Hue white and color ambiance GU10', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, + { + zigbeeModel: ['LTW013'], + model: 'TODO', + vendor: 'Philips', + description: 'Hue white GU10', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, // Belkin { From 5390a99fd0f959196fd78c7cc8f37b3bdfd8c985 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 7 Jul 2018 12:42:35 +0200 Subject: [PATCH 129/676] Update devices.js --- devices.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index 15f01acd9c240..5adf42becf6ee 100644 --- a/devices.js +++ b/devices.js @@ -469,7 +469,7 @@ const devices = [ }, { zigbeeModel: ['LCT003'], - model: 'TODO', + model: '8718696485880', vendor: 'Philips', description: 'Hue white and color ambiance GU10', supports: generic.light_onoff_brightness_colortemp_colorxy().supports, @@ -478,9 +478,9 @@ const devices = [ }, { zigbeeModel: ['LTW013'], - model: 'TODO', + model: '8718696598283', vendor: 'Philips', - description: 'Hue white GU10', + description: 'Hue white ambiance GU10', supports: generic.light_onoff_brightness_colortemp().supports, fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, From 988a6af90bf64958da0579d98fb0adc4064e791b Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 7 Jul 2018 12:43:52 +0200 Subject: [PATCH 130/676] 2.0.21 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d6a5c9b4c54d0..1b78c6f142797 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.20", + "version": "2.0.21", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 039a4b280b4c5..715de8d17907e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.20", + "version": "2.0.21", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 295b18cb98b07aed89d3c15b52bd7d6fdb0399e3 Mon Sep 17 00:00:00 2001 From: theupmachine Date: Sat, 7 Jul 2018 16:18:07 -0500 Subject: [PATCH 131/676] Added Sylvania A19 RGBW bulb --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 5adf42becf6ee..164386e4683f6 100644 --- a/devices.js +++ b/devices.js @@ -739,6 +739,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['LIGHTIFY A19 RGBW'], + model: '73693', + vendor: 'Sylvania', + description: 'LIGHTIFY LED RGBW A19', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, // GE { From 76c1726797c0d0a801405d1ad8eeb4bbf23bed90 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 7 Jul 2018 23:29:47 +0200 Subject: [PATCH 132/676] Fix linting --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 164386e4683f6..a38d40ff30292 100644 --- a/devices.js +++ b/devices.js @@ -739,7 +739,7 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, - { + { zigbeeModel: ['LIGHTIFY A19 RGBW'], model: '73693', vendor: 'Sylvania', From 45b840ace57c2910582b789b27dc86b1d3a0bede Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 7 Jul 2018 23:32:39 +0200 Subject: [PATCH 133/676] 2.0.22 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 1b78c6f142797..dbd0ba3f0b9d8 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.21", + "version": "2.0.22", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 715de8d17907e..f8440d463e4b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.21", + "version": "2.0.22", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 8a269cd74b657a127da4183e92615dd9ec1ea47b Mon Sep 17 00:00:00 2001 From: beatmag Date: Tue, 10 Jul 2018 22:21:13 +1000 Subject: [PATCH 134/676] added Nue in wall/ceiling switch --- devices.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/devices.js b/devices.js index a38d40ff30292..fd1d5a1cf5887 100644 --- a/devices.js +++ b/devices.js @@ -833,6 +833,18 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + + // Nue in Wall-Ceiling Switch + { + zigbeeModel: ['FB56+ZSW05HG1.2'], + model: 'FB56+ZSW05HG1.2', + vendor: 'FeiBit', + description: 'Switch', + supports: 'on/off', + fromZigbee: [fz.feibit_devChange], + toZigbee: [tz.onoff], + }, + ]; module.exports = devices; From 06429de2efd94e3d598b013fd45955a730f9d2b7 Mon Sep 17 00:00:00 2001 From: beatmag Date: Tue, 10 Jul 2018 22:21:56 +1000 Subject: [PATCH 135/676] added Nue in wall-ceilng switch convertor --- converters/fromZigbee.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 355f8f63f351f..edc481b77eb83 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -509,6 +509,13 @@ const converters = { cmd: 'moveToLevelWithOnOff', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'level'), }, + feibit_devChange: { + cid: 'genOnOff', + type: 'devChange', + convert: (model, msg, publish, options) => { + return {contact: msg.data.data['onOff'] === 0}; + }, + }, // Ignore converters (these message dont need parsing). ignore_onoff_change: { From b3a9ba373bc04c7bf0143d00f94221c5b5a5e481 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 23 Jun 2018 20:22:35 +0200 Subject: [PATCH 136/676] Experimental support for Hue Dimmer Switch. https://github.com/Koenkk/zigbee2mqtt/issues/36 --- devices.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/devices.js b/devices.js index fd1d5a1cf5887..0511c8e4dbf0b 100644 --- a/devices.js +++ b/devices.js @@ -485,6 +485,30 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['RWL020'], + model: '324131092621', + vendor: 'Philips', + description: 'Hue Dimmer Switch', + supports: 'TODO', + fromZigbee: [], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + + if (device) { + device.bind('genOnOff', coordinator, (error) => { + if (error) { + callback(error); + } else { + device.bind('genLevelCtrl', coordinator, (error) => { + callback(error); + }); + } + }); + } + }, + }, // Belkin { From d6dfd0fafd61bf35877c6d3d64385d2fd45f0f13 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 28 Jun 2018 19:58:55 +0200 Subject: [PATCH 137/676] 324131092621 add on/off converters, bind genScenes. https://github.com/Koenkk/zigbee2mqtt/issues/36 --- converters/fromZigbee.js | 14 ++++++++++++++ devices.js | 18 ++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index edc481b77eb83..1f57c6e1647d0 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -489,6 +489,20 @@ const converters = { }; }, }, + _324131092621_on: { + cid: 'genOnOff', + type: 'cmdOn', + convert: (model, msg, publish, options) => { + return {action: 'on'}; + }, + }, + _324131092621_off: { + cid: 'genOnOff', + type: 'cmdOffWithEffect', + convert: (model, msg, publish, options) => { + return {action: 'off'}; + }, + }, ICTC_G_1_move: { cmd: 'move', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), diff --git a/devices.js b/devices.js index 0511c8e4dbf0b..ffe9dc6e96b47 100644 --- a/devices.js +++ b/devices.js @@ -491,22 +491,16 @@ const devices = [ vendor: 'Philips', description: 'Hue Dimmer Switch', supports: 'TODO', - fromZigbee: [], + fromZigbee: [fz._324131092621_on, fz._324131092621_off], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.bind('genScenes', coordinator, cb), + ]; - if (device) { - device.bind('genOnOff', coordinator, (error) => { - if (error) { - callback(error); - } else { - device.bind('genLevelCtrl', coordinator, (error) => { - callback(error); - }); - } - }); - } + execute(device, actions, callback); }, }, From 07f684d8f3681091eab5e4585034b71e4866fd54 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 30 Jun 2018 17:35:08 +0200 Subject: [PATCH 138/676] Update 324131092621. https://github.com/Koenkk/zigbee2mqtt/issues/36 --- devices.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/devices.js b/devices.js index ffe9dc6e96b47..3558ecae7fc09 100644 --- a/devices.js +++ b/devices.js @@ -486,18 +486,22 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { - zigbeeModel: ['RWL020'], + zigbeeModel: ['RWL020', 'RWL021'], model: '324131092621', vendor: 'Philips', - description: 'Hue Dimmer Switch', - supports: 'TODO', + description: 'Hue dimmer Switch', + supports: 'on/off', fromZigbee: [fz._324131092621_on, fz._324131092621_off], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); + const ep2 = shepherd.find(ieeeAddr, 2); + const actions = [ (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.bind('genScenes', coordinator, cb), + (cb) => device.bind('manuSpecificCluster1', coordinator, cb), + (cb) => ep2.bind('genOnOff', coordinator, cb), + (cb) => ep2.bind('manuSpecificCluster1', coordinator, cb), ]; execute(device, actions, callback); From f148af72d831c2951d07101664784c0e85037bf7 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 2 Jul 2018 17:53:48 +0200 Subject: [PATCH 139/676] Implement 324131092621 dimming. https://github.com/Koenkk/zigbee2mqtt/issues/36 --- converters/fromZigbee.js | 47 ++++++++++++++++++++++++++++++++++++++++ devices.js | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 1f57c6e1647d0..e95c22fd72b88 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -32,6 +32,16 @@ const precisionRound = (number, precision) => { return Math.round(number * factor) / factor; }; +const numberWithinRange = (number, min, max) => { + if (number > max) { + return max; + } else if (number < min) { + return min; + } else { + return number; + } +}; + // get object property name (key) by it's value const getKey = (object, value) => { for (let key in object) { @@ -503,6 +513,43 @@ const converters = { return {action: 'off'}; }, }, + _324131092621_step: { + cid: 'genLevelCtrl', + type: 'cmdStep', + convert: (model, msg, publish, options) => { + const deviceID = msg.endpoints[0].device.ieeeAddr; + const direction = msg.data.data.stepmode === 0 ? 'up' : 'down'; + const mode = msg.data.data.stepsize === 30 ? 'press' : 'hold'; + + // Initialize store + if (!store[deviceID]) { + store[deviceID] = {value: 255, since: null, direction: null}; + } + + if (mode === 'press') { + const newValue = store[deviceID].value + (direction === 'up' ? 50 : -50); + store[deviceID].value = numberWithinRange(newValue, 0, 255); + return {brightness: store[deviceID].value}; + } else if (mode === 'hold') { + store[deviceID].since = Date.now(); + store[deviceID].direction = direction; + } + }, + }, + _324131092621_stop: { + cid: 'genLevelCtrl', + type: 'cmdStop', + convert: (model, msg, publish, options) => { + const deviceID = msg.endpoints[0].device.ieeeAddr; + if (store[deviceID] && store[deviceID].since && store[deviceID].direction) { + const duration = Date.now() - store[deviceID].since; + const delta = (duration / 10) * (store[deviceID].direction === 'up' ? 1 : -1); + const newValue = store[deviceID].value + delta; + store[deviceID].value = numberWithinRange(newValue, 0, 255); + return {brightness: store[deviceID].value}; + } + }, + }, ICTC_G_1_move: { cmd: 'move', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), diff --git a/devices.js b/devices.js index 3558ecae7fc09..1ef3515479ae7 100644 --- a/devices.js +++ b/devices.js @@ -491,7 +491,7 @@ const devices = [ vendor: 'Philips', description: 'Hue dimmer Switch', supports: 'on/off', - fromZigbee: [fz._324131092621_on, fz._324131092621_off], + fromZigbee: [fz._324131092621_on, fz._324131092621_off, fz._324131092621_step, fz._324131092621_stop], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); From 3959d1dc701c4b36832714bab045e3237c04ab12 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 2 Jul 2018 20:38:36 +0200 Subject: [PATCH 140/676] 324131092621 return actions. https://github.com/Koenkk/zigbee2mqtt/issues/36 --- converters/fromZigbee.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index e95c22fd72b88..c8f13db614e57 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -520,6 +520,7 @@ const converters = { const deviceID = msg.endpoints[0].device.ieeeAddr; const direction = msg.data.data.stepmode === 0 ? 'up' : 'down'; const mode = msg.data.data.stepsize === 30 ? 'press' : 'hold'; + const payload = {action: `${direction}-${mode}`}; // Initialize store if (!store[deviceID]) { @@ -529,11 +530,13 @@ const converters = { if (mode === 'press') { const newValue = store[deviceID].value + (direction === 'up' ? 50 : -50); store[deviceID].value = numberWithinRange(newValue, 0, 255); - return {brightness: store[deviceID].value}; + payload.brightness = store[deviceID].value; } else if (mode === 'hold') { store[deviceID].since = Date.now(); store[deviceID].direction = direction; } + + return payload; }, }, _324131092621_stop: { @@ -546,7 +549,7 @@ const converters = { const delta = (duration / 10) * (store[deviceID].direction === 'up' ? 1 : -1); const newValue = store[deviceID].value + delta; store[deviceID].value = numberWithinRange(newValue, 0, 255); - return {brightness: store[deviceID].value}; + return {brightness: store[deviceID].value, action: `${store[deviceID].direction}-hold-release`}; } }, }, From 72c6f19c1fa4a7bbe7df9d505c441a05245f3ed8 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 4 Jul 2018 21:59:00 +0200 Subject: [PATCH 141/676] Update 324131092621. https://www.github.com/Koenkk/zigbee2mqtt/issues/36 --- converters/fromZigbee.js | 24 ++++++++++++++++-------- devices.js | 15 +++++++++------ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index c8f13db614e57..ba4af40539973 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -86,6 +86,15 @@ const ictcg1 = (model, msg, publish, options, action) => { s.publish({brightness: s.value}); }; +const holdUpdateBrightness324131092621 = (deviceID) => { + if (store[deviceID] && store[deviceID].since && store[deviceID].direction) { + const duration = Date.now() - store[deviceID].since; + const delta = (duration / 10) * (store[deviceID].direction === 'up' ? 1 : -1); + const newValue = store[deviceID].value + delta; + store[deviceID].value = numberWithinRange(newValue, 0, 255); + } +}; + const converters = { xiaomi_battery_3v: { @@ -520,7 +529,6 @@ const converters = { const deviceID = msg.endpoints[0].device.ieeeAddr; const direction = msg.data.data.stepmode === 0 ? 'up' : 'down'; const mode = msg.data.data.stepsize === 30 ? 'press' : 'hold'; - const payload = {action: `${direction}-${mode}`}; // Initialize store if (!store[deviceID]) { @@ -530,13 +538,13 @@ const converters = { if (mode === 'press') { const newValue = store[deviceID].value + (direction === 'up' ? 50 : -50); store[deviceID].value = numberWithinRange(newValue, 0, 255); - payload.brightness = store[deviceID].value; } else if (mode === 'hold') { + holdUpdateBrightness324131092621(deviceID); store[deviceID].since = Date.now(); store[deviceID].direction = direction; } - return payload; + return {action: `${direction}-${mode}`, brightness: store[deviceID].value}; }, }, _324131092621_stop: { @@ -544,11 +552,11 @@ const converters = { type: 'cmdStop', convert: (model, msg, publish, options) => { const deviceID = msg.endpoints[0].device.ieeeAddr; - if (store[deviceID] && store[deviceID].since && store[deviceID].direction) { - const duration = Date.now() - store[deviceID].since; - const delta = (duration / 10) * (store[deviceID].direction === 'up' ? 1 : -1); - const newValue = store[deviceID].value + delta; - store[deviceID].value = numberWithinRange(newValue, 0, 255); + + if (store[deviceID]) { + holdUpdateBrightness324131092621(deviceID); + store[deviceID].since = null; + store[deviceID].direction = null; return {brightness: store[deviceID].value, action: `${store[deviceID].direction}-hold-release`}; } }, diff --git a/devices.js b/devices.js index 1ef3515479ae7..dff7a25c58535 100644 --- a/devices.js +++ b/devices.js @@ -495,16 +495,19 @@ const devices = [ toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); - const ep2 = shepherd.find(ieeeAddr, 2); - const actions = [ (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.bind('manuSpecificCluster1', coordinator, cb), - (cb) => ep2.bind('genOnOff', coordinator, cb), - (cb) => ep2.bind('manuSpecificCluster1', coordinator, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), ]; - execute(device, actions, callback); + execute(device, actions, (result) => { + if (result) { + const device = shepherd.find(ieeeAddr, 2); + execute(device, [(cb) => device.bind('genPowerCfg', coordinator, cb)], callback); + } else { + callback(result); + } + }); }, }, From 100ee28ed88a1d3d10944d7744959925db37ad18 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 5 Jul 2018 19:41:36 +0200 Subject: [PATCH 142/676] Bind battery hue dimmer switch. https://github.com/Koenkk/zigbee2mqtt/issues/36 --- converters/fromZigbee.js | 7 ++++++- devices.js | 17 +++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index ba4af40539973..a7b96272f7a15 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -555,9 +555,14 @@ const converters = { if (store[deviceID]) { holdUpdateBrightness324131092621(deviceID); + const payload = { + brightness: store[deviceID].value, + action: `${store[deviceID].direction}-hold-release` + }; + store[deviceID].since = null; store[deviceID].direction = null; - return {brightness: store[deviceID].value, action: `${store[deviceID].direction}-hold-release`}; + return payload; } }, }, diff --git a/devices.js b/devices.js index dff7a25c58535..819c77ee0c8a5 100644 --- a/devices.js +++ b/devices.js @@ -494,16 +494,21 @@ const devices = [ fromZigbee: [fz._324131092621_on, fz._324131092621_off, fz._324131092621_step, fz._324131092621_stop], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); + const ep1 = shepherd.find(ieeeAddr, 1); const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => ep1.bind('genOnOff', coordinator, cb), + (cb) => ep1.bind('genLevelCtrl', coordinator, cb), ]; - execute(device, actions, (result) => { + execute(ep1, actions, (result) => { if (result) { - const device = shepherd.find(ieeeAddr, 2); - execute(device, [(cb) => device.bind('genPowerCfg', coordinator, cb)], callback); + const ep2 = shepherd.find(ieeeAddr, 2); + const actions = [ + (cb) => ep2.bind('genPowerCfg', coordinator, cb), + (cb) => ep2.report('genPowerCfg', 'batteryVoltage', 10, 1000, 1, cb), + ]; + + execute(ep2, actions, callback); } else { callback(result); } From 8c36163d68222519898c32608908b1a1d27e1e2c Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 10 Jul 2018 18:26:26 +0200 Subject: [PATCH 143/676] Update 324131092621 battery. https://github.com/Koenkk/zigbee2mqtt/issues/36 --- converters/fromZigbee.js | 12 ++++++++++++ devices.js | 7 +++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index a7b96272f7a15..b65a8a1aa9a5d 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -566,6 +566,13 @@ const converters = { } }, }, + _324131092621_power: { + cid: 'genPowerCfg', + type: 'attReport', + convert: (model, msg, publish, options) => { + return {battery: precisionRound(msg.data.data['batteryPercentageRemaining'], 2)}; + }, + }, ICTC_G_1_move: { cmd: 'move', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), @@ -650,6 +657,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_power_change: { + cid: 'genPowerCfg', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, ignore_metering_change: { cid: 'seMetering', type: 'devChange', diff --git a/devices.js b/devices.js index 819c77ee0c8a5..d9da14eea7981 100644 --- a/devices.js +++ b/devices.js @@ -491,7 +491,10 @@ const devices = [ vendor: 'Philips', description: 'Hue dimmer Switch', supports: 'on/off', - fromZigbee: [fz._324131092621_on, fz._324131092621_off, fz._324131092621_step, fz._324131092621_stop], + fromZigbee: [ + fz._324131092621_on, fz._324131092621_off, fz._324131092621_step, fz._324131092621_stop, + fz.ignore_power_change, fz._324131092621_power, + ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const ep1 = shepherd.find(ieeeAddr, 1); @@ -505,7 +508,7 @@ const devices = [ const ep2 = shepherd.find(ieeeAddr, 2); const actions = [ (cb) => ep2.bind('genPowerCfg', coordinator, cb), - (cb) => ep2.report('genPowerCfg', 'batteryVoltage', 10, 1000, 1, cb), + (cb) => ep2.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), ]; execute(ep2, actions, callback); From a31f2a91bdaa5a8ec6714ff2e4e4ef38114ac888 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 10 Jul 2018 18:33:15 +0200 Subject: [PATCH 144/676] Update description --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index d9da14eea7981..2890cca2846f2 100644 --- a/devices.js +++ b/devices.js @@ -489,7 +489,7 @@ const devices = [ zigbeeModel: ['RWL020', 'RWL021'], model: '324131092621', vendor: 'Philips', - description: 'Hue dimmer Switch', + description: 'Hue dimmer switch', supports: 'on/off', fromZigbee: [ fz._324131092621_on, fz._324131092621_off, fz._324131092621_step, fz._324131092621_stop, From 26eedf44ad2acb41ccff0c474c9badedf77af995 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 10 Jul 2018 18:35:54 +0200 Subject: [PATCH 145/676] Lint --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index b65a8a1aa9a5d..9c275e7477c80 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -557,7 +557,7 @@ const converters = { holdUpdateBrightness324131092621(deviceID); const payload = { brightness: store[deviceID].value, - action: `${store[deviceID].direction}-hold-release` + action: `${store[deviceID].direction}-hold-release`, }; store[deviceID].since = null; From 8efaa7001e83757830b5f02cbf1ada04c9a7810b Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 10 Jul 2018 18:37:27 +0200 Subject: [PATCH 146/676] 2.0.23 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index dbd0ba3f0b9d8..05df95596f833 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.22", + "version": "2.0.23", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f8440d463e4b6..0640b7ed3038e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.22", + "version": "2.0.23", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 38ddebcacde86ebf1e7627a34a2d34e50691d9f4 Mon Sep 17 00:00:00 2001 From: Tom Usher Date: Wed, 11 Jul 2018 13:15:47 +0100 Subject: [PATCH 147/676] Add support for Gledopto RGB+CCT ZLL controller --- devices.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/devices.js b/devices.js index 2890cca2846f2..c7b888c2770fc 100644 --- a/devices.js +++ b/devices.js @@ -867,17 +867,16 @@ const devices = [ toZigbee: generic.light_onoff_brightness().toZigbee, }, - // Nue in Wall-Ceiling Switch - { - zigbeeModel: ['FB56+ZSW05HG1.2'], - model: 'FB56+ZSW05HG1.2', - vendor: 'FeiBit', - description: 'Switch', - supports: 'on/off', - fromZigbee: [fz.feibit_devChange], - toZigbee: [tz.onoff], + // Gledopto + { + zigbeeModel: ['GLEDOPTO'], + model: 'GL-C-008', + vendor: 'Gledopto', + description: '2.4G Wireless RGB+CCT LED Controller - ZigBee Light Link Compatible', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, - ]; module.exports = devices; From aaad68c50eacd3e82d8388aea721837770a210d4 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 12 Jul 2018 17:38:31 +0200 Subject: [PATCH 148/676] Update GL-C-008 description --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index c7b888c2770fc..a51a76b6108b3 100644 --- a/devices.js +++ b/devices.js @@ -872,7 +872,7 @@ const devices = [ zigbeeModel: ['GLEDOPTO'], model: 'GL-C-008', vendor: 'Gledopto', - description: '2.4G Wireless RGB+CCT LED Controller - ZigBee Light Link Compatible', + description: 'Zigbee LED controller RGB + CCT', supports: generic.light_onoff_brightness_colortemp_colorxy().supports, fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, From d5f65d7aa4d6e63f1a6e35704c0a181783f640bc Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 12 Jul 2018 17:42:18 +0200 Subject: [PATCH 149/676] 2.0.24 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 05df95596f833..7791d4140d2bd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.23", + "version": "2.0.24", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0640b7ed3038e..6a382eb3d322e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.23", + "version": "2.0.24", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 20d6f7e8605f6b1600410cf0f870ca3ad9411a86 Mon Sep 17 00:00:00 2001 From: okueng Date: Fri, 13 Jul 2018 16:12:43 +0200 Subject: [PATCH 150/676] samsung smartthings contact sensor support --- devices.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/devices.js b/devices.js index a51a76b6108b3..f0e3a23f065dd 100644 --- a/devices.js +++ b/devices.js @@ -877,6 +877,16 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + // Samsung SmartThings + { + zigbeeModel: ['PGC313'], + model: 'STSS-MULT-001', + vendor: 'Samsung SmartThings', + description: 'Door and Window contact sensor', + supports: 'contact', + fromZigbee: [fz.samsung_contact], // battery doesnt work yet + toZigbee: [], + }, ]; module.exports = devices; From 1b3df9af2705e4de0e661c18e477f4440bbe37e5 Mon Sep 17 00:00:00 2001 From: okueng Date: Fri, 13 Jul 2018 16:14:24 +0200 Subject: [PATCH 151/676] support of the samsung smartthings contact sensor --- converters/fromZigbee.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 9c275e7477c80..d6844a2bdada6 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -97,6 +97,13 @@ const holdUpdateBrightness324131092621 = (deviceID) => { const converters = { + samsung_contact: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + return {contact: msg.data.zoneStatus === 48 }; + }, + }, xiaomi_battery_3v: { cid: 'genBasic', type: 'attReport', From 69eb69bb40233d06c63ed421562f7fcf0b809ee3 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Sat, 14 Jul 2018 14:53:52 +0200 Subject: [PATCH 152/676] hue LCT010 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index f0e3a23f065dd..7bdb75221061f 100644 --- a/devices.js +++ b/devices.js @@ -459,7 +459,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { - zigbeeModel: ['LCT015'], + zigbeeModel: ['LCT010', 'LCT015'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E27', From 4f06e09df0367ac736252b31326567a5d4e4d863 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 14 Jul 2018 20:03:00 +0200 Subject: [PATCH 153/676] Update STSS-MULT-001 --- devices.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/devices.js b/devices.js index 7bdb75221061f..404d19999552f 100644 --- a/devices.js +++ b/devices.js @@ -877,14 +877,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, - // Samsung SmartThings + + // SmartThings { zigbeeModel: ['PGC313'], model: 'STSS-MULT-001', - vendor: 'Samsung SmartThings', - description: 'Door and Window contact sensor', + vendor: 'SmartThings', + description: 'SmartSense multi sensor', supports: 'contact', - fromZigbee: [fz.samsung_contact], // battery doesnt work yet + fromZigbee: [fz.samsung_contact], toZigbee: [], }, ]; From f1ae7222254ac74932d1d54208bdd0db4a31792a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 14 Jul 2018 20:03:49 +0200 Subject: [PATCH 154/676] Lint --- devices.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/devices.js b/devices.js index 404d19999552f..80d5950975eb7 100644 --- a/devices.js +++ b/devices.js @@ -880,11 +880,11 @@ const devices = [ // SmartThings { - zigbeeModel: ['PGC313'], - model: 'STSS-MULT-001', - vendor: 'SmartThings', - description: 'SmartSense multi sensor', - supports: 'contact', + zigbeeModel: ['PGC313'], + model: 'STSS-MULT-001', + vendor: 'SmartThings', + description: 'SmartSense multi sensor', + supports: 'contact', fromZigbee: [fz.samsung_contact], toZigbee: [], }, From bdf58bb4637a67c6b39ca5b73615b058cb3c91c7 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 14 Jul 2018 20:05:13 +0200 Subject: [PATCH 155/676] Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 80d5950975eb7..7da5d7901c0ee 100644 --- a/devices.js +++ b/devices.js @@ -885,7 +885,7 @@ const devices = [ vendor: 'SmartThings', description: 'SmartSense multi sensor', supports: 'contact', - fromZigbee: [fz.samsung_contact], + fromZigbee: [fz.smartthings_contact], toZigbee: [], }, ]; From 75ca2f47b16692db71ec71b0c5bb2194cf41211c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 14 Jul 2018 20:05:46 +0200 Subject: [PATCH 156/676] Update fromZigbee.js --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index d6844a2bdada6..9dc872704d2b7 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -97,7 +97,7 @@ const holdUpdateBrightness324131092621 = (deviceID) => { const converters = { - samsung_contact: { + smartthings_contact: { cid: 'ssIasZone', type: 'statusChange', convert: (model, msg, publish, options) => { From a1978e0e77d02a73bd748ec7188d2d29d4cc9569 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 14 Jul 2018 20:11:51 +0200 Subject: [PATCH 157/676] Lint --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 7da5d7901c0ee..bffc788796dbe 100644 --- a/devices.js +++ b/devices.js @@ -877,7 +877,7 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, - + // SmartThings { zigbeeModel: ['PGC313'], From dc93a5d999644247a19ae0331ba7aebc44d746d7 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 14 Jul 2018 20:12:17 +0200 Subject: [PATCH 158/676] Lint --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 9dc872704d2b7..7cf33a5df2d89 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -101,7 +101,7 @@ const converters = { cid: 'ssIasZone', type: 'statusChange', convert: (model, msg, publish, options) => { - return {contact: msg.data.zoneStatus === 48 }; + return {contact: msg.data.zoneStatus === 48}; }, }, xiaomi_battery_3v: { From 0bc4164e0cf92806a06181ed4bb3ada1433b298d Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 14 Jul 2018 20:45:22 +0200 Subject: [PATCH 159/676] Use default execute delay of 300ms. https://github.com/Koenkk/zigbee2mqtt/issues/192 --- devices.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/devices.js b/devices.js index bffc788796dbe..1241efa295b1b 100644 --- a/devices.js +++ b/devices.js @@ -36,7 +36,7 @@ const generic = { const foundationCfg = {manufSpec: 0, disDefaultRsp: 0}; -const execute = (device, actions, callback) => { +const execute = (device, actions, callback, delay=300) => { if (device) { actions = actions.reverse(); @@ -46,14 +46,16 @@ const execute = (device, actions, callback) => { return; } - const action = actions.pop(); - action((error) => { - if (error) { - callback(false); - } else { - next(); - } - }); + setTimeout(() => { + const action = actions.pop(); + action((error) => { + if (error) { + callback(false); + } else { + next(); + } + }); + }, delay); }; next(); From ec31dec4c3dd67f5c72f2230b28d892b6031ceb1 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 14 Jul 2018 20:45:41 +0200 Subject: [PATCH 160/676] 2.0.25 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7791d4140d2bd..f10d2bc2e7ab0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.24", + "version": "2.0.25", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6a382eb3d322e..38f7175c2443a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.24", + "version": "2.0.25", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 0bcf6aebeeb4ff9d6f8b1e2acacd119d914e6b6e Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 14 Jul 2018 20:51:43 +0200 Subject: [PATCH 161/676] Update npm key --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index dfe71edc69f8f..defb3bd129121 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ deploy: provider: npm email: "koenkanters94@gmail.com" api_key: - secure: GUsmI/vpO8Gk90AgDZim2kXG5ZPN9fAUhJ2VMP1czDyYEC4M7y/Eg4irWsdA1mLeGzdCNVetyXt2X5JOkb/xuCbfodVk6fZvbTxJiqwt+OAf0QlrWGEpAjfJfwRhiWY8EfdrUViEEvjIGfqmJRQlp+gRD/5bB+VRD5k5zbLoFEdcp9Cd4EH0L8EnldG64ZFtE8hMRX6J2YVlO9VK98yTlAq4l9vEFEjLI+cNrWK8h9X8auju7giRCNnOItWLHMN6rsnF0PBTx0XCy2BoaRBVAsFewHQUTjcs8AeFGATCtf+rbQwRFLSq65BGmApYzoR5wINHz/T2JocJrjH7Pgoj0sdmL5apl5T2jLIfIzmhF2A/N8oiuotFaltj7zqYYVr4gR0N26UJg0jQQQnnufbTGXIQvm8ov2FBZp3i6mor3vCZhEe6eGfOriG7KkTSMsQKAYkLnTMCibSPYk6moD49eDLzwEUU9FYx/hEl/iHvEIWj4CaWrLBFvykAbwgb83tmYNOnsBD5OzDfj4BEYe8ygkIISkxKtdfCFX/ItpN/bBKDL7sYrHzerHNCxzb8+sXV1ioHo5HbLQQCAtaCpooErCexG/ptmTVAe4v6c0Y6WIIo32QfudBaUyYHzIcGFYBJwOa0A3ECAJkNA18kkmGso0KtverqjbY6vaTgCeeyMBk= + secure: PnLrOI+D0WWFRaPXjCSQ/0QrQoCUlzA5ipIoArdEPtXgGiyzFwAUpW5hnWF7ITnsEatYtJVBd59rm9PLspZzlXXTiVk0DVN+pB310Wr30+71BoHfEZipl5Z5RkhhbruaRCU65FgRaJpkwx97pvOEt3H/e3CwmTdw2JA6N0m0m19KLdeaNwRycVxbLow4z2a9pYc2p/YuGHkUwMOtGjd4zWFneRZyY1NzYaH90DQq69Jh7kyJPDSNfeD+gJbDShWo+ph/F6bsnToXLWL+C5qrhOEqLQHoiTThl7wa6y8VmXfL6OKOt4k31G+fUIK/UiJGFoaxrEZmk72VR0oVfo7ue0z0wnu+B8V2X1oM1JDC47hKcIOqMf8IqEXkM54A9cvM3LV25pHr5Z4zN0D51v7udUnZafhwCSJkbFWdbL9A2bReu+2OrLX98GAlwztJcvh0dDPXED1Re83lzOTqODtsrp39gBJb7/JB2Nka9Ye5vBucgonYpbWLh0IMHzQIvue5k8cMlKyNW48zM4ihXWNGX7A/VfQUfJWnmg+bNHk2JPKlqnEKYucfhKKYV+g/FAlqnVBmRpc5ncbnQCFE7w4DuY0h2nQZDyhaXJIvzRHdXyXeCoU8ZXBHuYDcXLCLw+RoqffeDxvg8tN5yWW+JEWuepySnx556vtrQkl9IuwO17g= on: tags: true branch: master From 25bdb459245ecfa9c4ea5ab456aa4a371e5e4468 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 14 Jul 2018 20:51:52 +0200 Subject: [PATCH 162/676] 2.0.26 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index f10d2bc2e7ab0..6f26b496a0160 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.25", + "version": "2.0.26", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 38f7175c2443a..f71cd7b0956ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.25", + "version": "2.0.26", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 5420d54fda900fe9eccace6983f6321c69386db0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 14 Jul 2018 20:52:29 +0200 Subject: [PATCH 163/676] 2.0.27 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6f26b496a0160..1d2d69b8b28d7 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.26", + "version": "2.0.27", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f71cd7b0956ed..5a36fb893b56f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.26", + "version": "2.0.27", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From b2b48ae4ed2bb66fc54b9c59ead129146600aef1 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 14 Jul 2018 20:59:09 +0200 Subject: [PATCH 164/676] Update api key. --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index defb3bd129121..8280989b91a1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: node_js node_js: - - "8" + - '8' install: - npm install @@ -12,9 +12,9 @@ script: deploy: provider: npm - email: "koenkanters94@gmail.com" + email: koenkanters94@gmail.com api_key: - secure: PnLrOI+D0WWFRaPXjCSQ/0QrQoCUlzA5ipIoArdEPtXgGiyzFwAUpW5hnWF7ITnsEatYtJVBd59rm9PLspZzlXXTiVk0DVN+pB310Wr30+71BoHfEZipl5Z5RkhhbruaRCU65FgRaJpkwx97pvOEt3H/e3CwmTdw2JA6N0m0m19KLdeaNwRycVxbLow4z2a9pYc2p/YuGHkUwMOtGjd4zWFneRZyY1NzYaH90DQq69Jh7kyJPDSNfeD+gJbDShWo+ph/F6bsnToXLWL+C5qrhOEqLQHoiTThl7wa6y8VmXfL6OKOt4k31G+fUIK/UiJGFoaxrEZmk72VR0oVfo7ue0z0wnu+B8V2X1oM1JDC47hKcIOqMf8IqEXkM54A9cvM3LV25pHr5Z4zN0D51v7udUnZafhwCSJkbFWdbL9A2bReu+2OrLX98GAlwztJcvh0dDPXED1Re83lzOTqODtsrp39gBJb7/JB2Nka9Ye5vBucgonYpbWLh0IMHzQIvue5k8cMlKyNW48zM4ihXWNGX7A/VfQUfJWnmg+bNHk2JPKlqnEKYucfhKKYV+g/FAlqnVBmRpc5ncbnQCFE7w4DuY0h2nQZDyhaXJIvzRHdXyXeCoU8ZXBHuYDcXLCLw+RoqffeDxvg8tN5yWW+JEWuepySnx556vtrQkl9IuwO17g= + secure: ZXg4VSeWGUtqjXJ8zOSUmf+ETyV12QTXY4FUEMxHVT9V70WMXCcKX4LhfrYHSMy7LkPnG5E2b1GGj36CdqjbNwBCThr1luzS0VXA1wzvr3qzCTgaRpMQWSWNl67ygSUJrZ2q4jJj0UhkpVMluXPepXARTfO3UjS9ILch4U3T0iJ4WHjZMbXJl0LXBYEgdvjLXnQ91nekwTr7HGdTWNvA6u3r+uibZS7Yxu6HFJaJJWqdqtchXUbHrDrXdB6tIWDCYOIYFS0/dzYRikZlE8tZLcLeZKtIMxnc5Y44ncxmvjd58a57/atN+TNfV39vfS4IXkobFhR/KAnTUELgkrqmx8Md0k7d0WbqRmuDqzkY5b9toP6fCfW1UFSPuAygDBJeuWV33GT79IuAHczuMP17siYOVEBXTydu2K2yQEabucQxMIRqh1sEQCq8h0JwX2GtKGytK8lTnmh+b7Jh5u6huIlw2JjTjwAXgKaDyJzwyIQmlxOmwvyM9cNuiQFBWqdHe+0KK9dMv6h5jL/G/gpesNEPJeNUlXre2XktYVyVyiaqoxEYiDUzPTlzOhYbcTGDeLLglVYTV/BUILGDgRHX/Ug8JRk/LLOXtfAGM+r8O+MFguuqHcWOmoYi19ctt8yLHicJB3TVIUOydMRDSLsGQ7/krhzUssZ6Hd8zW6l7RAk= on: tags: true branch: master From e1e0b51676647a471c54a232cc37729eae9768a6 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 14 Jul 2018 21:01:34 +0200 Subject: [PATCH 165/676] 2.0.28 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 1d2d69b8b28d7..9ff0a098145c1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.27", + "version": "2.0.28", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5a36fb893b56f..2a9709900f2fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.27", + "version": "2.0.28", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From af51cb663770bb962ee611371117835ceca2ab4b Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 15 Jul 2018 12:07:14 +0200 Subject: [PATCH 166/676] Fix hue dimmer battery. https://github.com/Koenkk/zigbee2mqtt/issues/36 --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 7cf33a5df2d89..06fbeee8f07fa 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -577,7 +577,7 @@ const converters = { cid: 'genPowerCfg', type: 'attReport', convert: (model, msg, publish, options) => { - return {battery: precisionRound(msg.data.data['batteryPercentageRemaining'], 2)}; + return {battery: precisionRound(msg.data.data['batteryPercentageRemaining'], 2) / 2}; }, }, ICTC_G_1_move: { From 67592ec8e9c23fbd1180a9cd99a8aaa599b65b35 Mon Sep 17 00:00:00 2001 From: tb-killa Date: Sun, 15 Jul 2018 12:47:13 +0200 Subject: [PATCH 167/676] Implement Reset (FactoryReset) for EndDevice PR for https://github.com/Koenkk/zigbee2mqtt/issues/196 --- converters/toZigbee.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index a3cb7d7a8e41c..ec5d83e689bec 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,6 +1,17 @@ 'use strict'; const converters = { + genBasic_resetFactDefault: { + key: 'reset', + attr: [], + convert: (value, message) => { + return { + cid: 'genBasic', + cmd: 'resetFactDefault', + zclData: {}, + }; + }, + }, onoff: { key: 'state', attr: ['onOff'], From 24409f21aeb52bf241965fe7284f79885d45c094 Mon Sep 17 00:00:00 2001 From: okueng Date: Sun, 15 Jul 2018 17:43:31 +0200 Subject: [PATCH 168/676] added support for hue LCT001, LCT007 See the different model ID at : https://developers.meethue.com/documentation/supported-lights --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 1241efa295b1b..8089f9ec7ae5d 100644 --- a/devices.js +++ b/devices.js @@ -460,6 +460,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['LCT001', 'LCT007'], + model: '9290011420', + vendor: 'Philips', + description: 'Hue white and color ambiance E27', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['LCT010', 'LCT015'], model: '9290012573A', From 9934b912a80c391bc2264ff1294fc22a9b609065 Mon Sep 17 00:00:00 2001 From: negative7 Date: Sun, 15 Jul 2018 15:38:04 -0400 Subject: [PATCH 169/676] Add suport for LED1623G12 E26 variants --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 8089f9ec7ae5d..603e6e1f2b79f 100644 --- a/devices.js +++ b/devices.js @@ -298,7 +298,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { - zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm'], + zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm', 'TRADFRI bulb E26 opal 1000lm', 'TRADFRI bulb E26 W opal 1000lm'], model: 'LED1623G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', From b9dbb91a089c0a8bc8c863de936afe2331a6a822 Mon Sep 17 00:00:00 2001 From: negative7 Date: Sun, 15 Jul 2018 16:21:05 -0400 Subject: [PATCH 170/676] Moved LED1622G12 model Even though box for my bulb has LED1623G12 printed and the bulb reports as TRADFRI bulb E26 W opal 1000lm. --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 603e6e1f2b79f..da512ccd5510a 100644 --- a/devices.js +++ b/devices.js @@ -298,7 +298,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { - zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm', 'TRADFRI bulb E26 opal 1000lm', 'TRADFRI bulb E26 W opal 1000lm'], + zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm'], model: 'LED1623G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', @@ -334,7 +334,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { - zigbeeModel: ['TRADFRI bulb E26 opal 1000lm'], + zigbeeModel: ['TRADFRI bulb E26 opal 1000lm', 'TRADFRI bulb E26 W opal 1000lm'], model: 'LED1622G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26 1000 lumen, dimmable, opal white', From 8f1115b4490ca39c2573264cebc7803408f12148 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 17 Jul 2018 18:00:22 +0200 Subject: [PATCH 171/676] Merge 'LCT001', 'LCT007' with 9290012573A --- devices.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/devices.js b/devices.js index da512ccd5510a..e0cc1588a9386 100644 --- a/devices.js +++ b/devices.js @@ -461,16 +461,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { - zigbeeModel: ['LCT001', 'LCT007'], - model: '9290011420', - vendor: 'Philips', - description: 'Hue white and color ambiance E27', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, - }, - { - zigbeeModel: ['LCT010', 'LCT015'], + zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT015'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E27', From dc0849ba01c65900bc394a06037a17ebacf7533f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 17 Jul 2018 18:04:27 +0200 Subject: [PATCH 172/676] 2.0.29 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9ff0a098145c1..69f3486dc2c09 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.28", + "version": "2.0.29", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2a9709900f2fc..0c6c25cb6415a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.28", + "version": "2.0.29", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From e08cc3987c6d1bbaca3c88b12fda9959955525c5 Mon Sep 17 00:00:00 2001 From: skipXtian Date: Wed, 18 Jul 2018 12:22:51 +1000 Subject: [PATCH 173/676] Added support for Singled E11-G23 (A60) --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index e0cc1588a9386..b134e2875a226 100644 --- a/devices.js +++ b/devices.js @@ -824,6 +824,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['E11-G23'], + model: 'E11-G23', + vendor: 'Sengled', + description: 'Element Classic (A60)', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, // JIAWEN { From 4fd27678f041b89ca8e8f52bfaa394668bfa5417 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 18 Jul 2018 22:33:58 +0200 Subject: [PATCH 174/676] 2.0.30 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 69f3486dc2c09..be85af1ad8987 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.29", + "version": "2.0.30", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0c6c25cb6415a..ebdf9aa5ee3d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.29", + "version": "2.0.30", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 186adcdf853c21cf6fc694956373aceddf900e97 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 18 Jul 2018 22:38:19 +0200 Subject: [PATCH 175/676] Update factory_reset converter --- converters/toZigbee.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index ec5d83e689bec..100aa9c212984 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,17 +1,17 @@ 'use strict'; const converters = { - genBasic_resetFactDefault: { - key: 'reset', - attr: [], - convert: (value, message) => { - return { - cid: 'genBasic', - cmd: 'resetFactDefault', - zclData: {}, - }; - }, - }, + factory_reset: { + key: 'reset', + attr: [], + convert: (value, message) => { + return { + cid: 'genBasic', + cmd: 'resetFactDefault', + zclData: {}, + }; + }, + }, onoff: { key: 'state', attr: ['onOff'], From 9a0ffc709ea4a5541321f2b3cd9ac5b0689c9ba5 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 18 Jul 2018 22:41:11 +0200 Subject: [PATCH 176/676] Lint --- converters/toZigbee.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 100aa9c212984..c89e042a06ab5 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -4,11 +4,11 @@ const converters = { factory_reset: { key: 'reset', attr: [], - convert: (value, message) => { - return { - cid: 'genBasic', - cmd: 'resetFactDefault', - zclData: {}, + convert: (value, message) => { + return { + cid: 'genBasic', + cmd: 'resetFactDefault', + zclData: {}, }; }, }, From 91178e20be3c21737067f7447396676d5cbbc6b1 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 18 Jul 2018 22:42:09 +0200 Subject: [PATCH 177/676] 2.0.31 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index be85af1ad8987..3aa51c9dbaf90 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.30", + "version": "2.0.31", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ebdf9aa5ee3d1..01465df55a3e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.30", + "version": "2.0.31", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 226d5f7cd8ab21e3ac20ad0d61d339b6310935d0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 21 Jul 2018 21:25:02 +0200 Subject: [PATCH 178/676] Add debug to execute function. https://github.com/Koenkk/zigbee2mqtt/issues/200 --- devices.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devices.js b/devices.js index b134e2875a226..83a2e0bc5c098 100644 --- a/devices.js +++ b/devices.js @@ -1,5 +1,6 @@ 'use strict'; +const debug = require('debug')('zigbee-shepherd-converters:devices'); const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); @@ -49,6 +50,7 @@ const execute = (device, actions, callback, delay=300) => { setTimeout(() => { const action = actions.pop(); action((error) => { + debug(`Configured '${action.toString()}' with result '${error ? error : 'OK'}'`); if (error) { callback(false); } else { From e9a448b754474e893a4595570ce1498594229e17 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 21 Jul 2018 21:25:44 +0200 Subject: [PATCH 179/676] 2.0.32 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 3aa51c9dbaf90..2312eb549cbea 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.31", + "version": "2.0.32", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 01465df55a3e3..07d9870ef44dd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.31", + "version": "2.0.32", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 9aa222c30d9a2f0077d2901c4d515c6525f22bac Mon Sep 17 00:00:00 2001 From: 1of16 <1of16@users.noreply.github.com> Date: Sun, 22 Jul 2018 14:33:34 +0200 Subject: [PATCH 180/676] OSRAM AC03641 added OSRAM Classic A60 W clear - LIGHTIFY AC03641 added --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 83a2e0bc5c098..5a20eb3c5a94c 100644 --- a/devices.js +++ b/devices.js @@ -607,6 +607,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['Classic A60 W clear - LIGHTIFY'], + model: 'AC03641', + vendor: 'OSRAM', + description: 'Classic A60 W clear - LIGHTIFY', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, { zigbeeModel: ['Plug 01'], model: 'AB3257001NJ', From 5fcd1b46dcb774bf6c561083d9ab75318117994c Mon Sep 17 00:00:00 2001 From: Pfluppe <39125291+Pfluppe@users.noreply.github.com> Date: Sun, 22 Jul 2018 17:19:35 +0200 Subject: [PATCH 181/676] Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 5a20eb3c5a94c..3cd637f718f72 100644 --- a/devices.js +++ b/devices.js @@ -579,6 +579,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['CLA60 RGBW OSRAM'], + model: 'AC03845', + vendor: 'OSRAM', + description: 'Classic E27 Multicolor', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { // AA70155 is model number of both bulbs. zigbeeModel: ['LIGHTIFY A19 Tunable White', 'Classic A60 TW'], From 4f74dfe889762fefe2de2238c503000d413c259a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 22 Jul 2018 18:37:00 +0200 Subject: [PATCH 182/676] Update AC03845 description --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 3cd637f718f72..7dfe9b50baf81 100644 --- a/devices.js +++ b/devices.js @@ -583,7 +583,7 @@ const devices = [ zigbeeModel: ['CLA60 RGBW OSRAM'], model: 'AC03845', vendor: 'OSRAM', - description: 'Classic E27 Multicolor', + description: 'LIGHTIFY LED CLA60 E27 RGBW', supports: generic.light_onoff_brightness_colortemp_colorxy().supports, fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, From a9a5ed79efff47e340f3d19ad2b461579bdb6a56 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 22 Jul 2018 18:42:28 +0200 Subject: [PATCH 183/676] Update AC03641 description --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 7dfe9b50baf81..f14ec51d44b4d 100644 --- a/devices.js +++ b/devices.js @@ -620,7 +620,7 @@ const devices = [ zigbeeModel: ['Classic A60 W clear - LIGHTIFY'], model: 'AC03641', vendor: 'OSRAM', - description: 'Classic A60 W clear - LIGHTIFY', + description: 'LIGHTIFY LED Classic A60 clear', supports: generic.light_onoff_brightness().supports, fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, From a07b0aa2331f71439f8963e1ac098bf627423ea0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 22 Jul 2018 18:45:47 +0200 Subject: [PATCH 184/676] 2.0.33 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2312eb549cbea..44b27dde4edc3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.32", + "version": "2.0.33", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 07d9870ef44dd..fb9dc82961068 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.32", + "version": "2.0.33", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 2c20d6cf38b7ff2556fa2ce54b9e1efd34d6c434 Mon Sep 17 00:00:00 2001 From: jaaps <236261+jaaps@users.noreply.github.com> Date: Fri, 27 Jul 2018 09:58:54 +0200 Subject: [PATCH 185/676] Add Philips Hue Bloom support --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index f14ec51d44b4d..54ceeea602875 100644 --- a/devices.js +++ b/devices.js @@ -426,6 +426,15 @@ const devices = [ }, // Philips + { + zigbeeModel: ['LLC012'], + model: '7299760PH', + vendor: 'Philips', + description: 'Hue Bloom', + supports: generic.light_onoff_brightness_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, + }, { zigbeeModel: ['LLC020'], model: '7146060PH', From 3c3745612b119eb596ad6b30fcd2029ed139ba7f Mon Sep 17 00:00:00 2001 From: jaaps <236261+jaaps@users.noreply.github.com> Date: Fri, 27 Jul 2018 10:03:45 +0200 Subject: [PATCH 186/676] Fix ident --- devices.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/devices.js b/devices.js index 54ceeea602875..c3bd338f9c85c 100644 --- a/devices.js +++ b/devices.js @@ -427,13 +427,13 @@ const devices = [ // Philips { - zigbeeModel: ['LLC012'], - model: '7299760PH', - vendor: 'Philips', - description: 'Hue Bloom', - supports: generic.light_onoff_brightness_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, + zigbeeModel: ['LLC012'], + model: '7299760PH', + vendor: 'Philips', + description: 'Hue Bloom', + supports: generic.light_onoff_brightness_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, }, { zigbeeModel: ['LLC020'], From 3f3d91c403081844e54a8c3897273db4e103e882 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 27 Jul 2018 14:45:49 +0200 Subject: [PATCH 187/676] 2.0.34 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 44b27dde4edc3..824c0876ffa8f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.33", + "version": "2.0.34", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fb9dc82961068..900a1c38921e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.33", + "version": "2.0.34", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From e2c3a7eea41f633b0283d67dbf942093f997fa9d Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 29 Jul 2018 21:24:16 +0200 Subject: [PATCH 188/676] Update FB56+ZSW05HG1.2 --- converters/fromZigbee.js | 7 ------- devices.js | 11 +++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 06fbeee8f07fa..55be32326398d 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -600,13 +600,6 @@ const converters = { cmd: 'moveToLevelWithOnOff', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'level'), }, - feibit_devChange: { - cid: 'genOnOff', - type: 'devChange', - convert: (model, msg, publish, options) => { - return {contact: msg.data.data['onOff'] === 0}; - }, - }, // Ignore converters (these message dont need parsing). ignore_onoff_change: { diff --git a/devices.js b/devices.js index c3bd338f9c85c..8c5c6ae54cec4 100644 --- a/devices.js +++ b/devices.js @@ -907,6 +907,17 @@ const devices = [ toZigbee: generic.light_onoff_brightness().toZigbee, }, + // Nue + { + zigbeeModel: ['FB56+ZSW05HG1.2'], + model: 'FB56+ZSW05HG1.2', + vendor: 'Nue', + description: 'ZigBee one gang smart switch', + supports: 'on/off', + fromZigbee: [fz.generic_state], + toZigbee: [tz.onoff], + }, + // Gledopto { zigbeeModel: ['GLEDOPTO'], From 9cd3ca21e5024f2f7f9b4733ad155a950d97c515 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 29 Jul 2018 21:27:23 +0200 Subject: [PATCH 189/676] 2.0.35 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 824c0876ffa8f..41ea84ea70d58 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.34", + "version": "2.0.35", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 900a1c38921e1..af45fe9a3aacf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.34", + "version": "2.0.35", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From ae2960917026e5bfb4022df938a79bdab46222e4 Mon Sep 17 00:00:00 2001 From: kimonm <40135180+kimonm@users.noreply.github.com> Date: Sun, 29 Jul 2018 18:10:26 -0700 Subject: [PATCH 190/676] Update devices.js Added support for Sylvania Smart+ smart plug --- devices.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/devices.js b/devices.js index 8c5c6ae54cec4..0d84ccca51865 100644 --- a/devices.js +++ b/devices.js @@ -812,6 +812,25 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['PLUG'], + model: '72922-A', + vendor: 'Sylvania', + description: 'SMART+ Smart Plug', + supports: 'on/off', + fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + toZigbee: [tz.onoff], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, // GE { From 10c20e35fae7fc744196aed78c41d0a8ea8042a3 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 31 Jul 2018 21:49:49 +0200 Subject: [PATCH 191/676] 2.0.36 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 41ea84ea70d58..a04ba0d428050 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.35", + "version": "2.0.36", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index af45fe9a3aacf..d3a690c8f7187 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.35", + "version": "2.0.36", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 3d1edb4ec47077b17cf52cbe22c17aafeae41cd9 Mon Sep 17 00:00:00 2001 From: Indrek Ardel Date: Wed, 1 Aug 2018 20:13:16 +0300 Subject: [PATCH 192/676] Add OSRAM SMART+ CLASSIC A 60 TW --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 0d84ccca51865..b5bf8f0a280d8 100644 --- a/devices.js +++ b/devices.js @@ -597,6 +597,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['CLA60 TW OSRAM'], + model: 'AC03642', + vendor: 'OSRAM', + description: 'SMART+ CLASSIC A 60 TW', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { // AA70155 is model number of both bulbs. zigbeeModel: ['LIGHTIFY A19 Tunable White', 'Classic A60 TW'], From a9c0dd4d625b49685a00c202a3b992a6c2113d9e Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 4 Aug 2018 19:02:30 +0200 Subject: [PATCH 193/676] QBKG04LM/QBKG03LM: ignore basic report/devchange. https://github.com/Koenkk/zigbee2mqtt/issues/242 --- converters/fromZigbee.js | 5 +++++ devices.js | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 55be32326398d..fe401c39e887a 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -612,6 +612,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_basic_report: { + cid: 'genBasic', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, ignore_illuminance_change: { cid: 'msIlluminanceMeasurement', type: 'devChange', diff --git a/devices.js b/devices.js index b5bf8f0a280d8..0b37223a2cac1 100644 --- a/devices.js +++ b/devices.js @@ -123,7 +123,9 @@ const devices = [ vendor: 'Xiaomi', description: 'Aqara single key wired wall switch', supports: 'on/off', - fromZigbee: [fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change], + fromZigbee: [ + fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_basic_report, + ], toZigbee: [tz.onoff], ep: {'': 2}, }, @@ -145,7 +147,9 @@ const devices = [ vendor: 'Xiaomi', description: 'Aqara double key wired wall switch', supports: 'left and right on/off', - fromZigbee: [fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons], + fromZigbee: [ + fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons, fz.ignore_basic_change, fz.ignore_basic_report, + ], toZigbee: [tz.onoff], ep: {'left': 2, 'right': 3}, }, From 4e6d61e63a3ad007f649862fe0a45e07d2590ff2 Mon Sep 17 00:00:00 2001 From: Pham Viet Dzung Date: Thu, 2 Aug 2018 10:56:14 +0700 Subject: [PATCH 194/676] Support for DIY devices: DNCKATSW002, DNCKATSW003 and DNCKATSW004 --- converters/fromZigbee.js | 69 ++++++++++++++++++++++++++++++++++++++++ devices.js | 32 ++++++++++++++++++- 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index fe401c39e887a..f8a876a258f27 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -503,6 +503,75 @@ const converters = { }; }, }, + DNCKAT_S002_state: { + cid: 'genOnOff', + type: 'attReport', + convert: (model, msg, publish, options) => { + const key = `state_${getKey(model.ep, msg.endpoints[0].epId)}`; + const payload = {}; + payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; + return payload; + }, + }, + DNCKAT_S002_buttons: { + cid: 'genOnOff', + type: 'devChange', + convert: (model, msg, publish, options) => { + const mapping = {1: 'left', 2: 'right'}; + const button = mapping[msg.endpoints[0].epId]; + if (button) { + const payload = {}; + payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; + return payload; + } + }, + }, + DNCKAT_S003_state: { + cid: 'genOnOff', + type: 'attReport', + convert: (model, msg, publish, options) => { + const key = `state_${getKey(model.ep, msg.endpoints[0].epId)}`; + const payload = {}; + payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; + return payload; + }, + }, + DNCKAT_S003_buttons: { + cid: 'genOnOff', + type: 'devChange', + convert: (model, msg, publish, options) => { + const mapping = {1: 'left', 2: 'center', 3: 'right'}; + const button = mapping[msg.endpoints[0].epId]; + if (button) { + const payload = {}; + payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; + return payload; + } + }, + }, + DNCKAT_S004_state: { + cid: 'genOnOff', + type: 'attReport', + convert: (model, msg, publish, options) => { + const key = `state_${getKey(model.ep, msg.endpoints[0].epId)}`; + const payload = {}; + payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; + return payload; + }, + }, + DNCKAT_S004_buttons: { + cid: 'genOnOff', + type: 'devChange', + convert: (model, msg, publish, options) => { + const mapping = {1: 'bot_left', 2: 'bot_right', 3: 'top_left', 4: 'top_right'}; + const button = mapping[msg.endpoints[0].epId]; + if (button) { + const payload = {}; + payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; + return payload; + } + }, + }, Z809A_power: { cid: 'haElectricalMeasurement', type: 'attReport', diff --git a/devices.js b/devices.js index 0b37223a2cac1..5ae7963821a19 100644 --- a/devices.js +++ b/devices.js @@ -576,11 +576,41 @@ const devices = [ zigbeeModel: ['DNCKAT_S001'], model: 'DNCKATSW001', vendor: 'Custom devices (DiY)', - description: '[DNCKAT single key wired wall light switch](https://dzungpv.github.io/dnckatsw001/)', + description: '[DNCKAT single key wired wall light switch](https://dzungpv.github.io/dnckatsw00x/)', supports: 'on/off', fromZigbee: [fz.generic_state, fz.ignore_onoff_change], toZigbee: [tz.onoff], }, + { + zigbeeModel: ['DNCKAT_S002'], + model: 'DNCKATSW002', + vendor: 'Custom devices (DiY)', + description: '[DNCKAT double key wired wall light switch](https://dzungpv.github.io/dnckatsw00x/)', + supports: 'left and right on/off', + fromZigbee: [fz.DNCKAT_S002_state, fz.DNCKAT_S002_buttons], + toZigbee: [tz.onoff], + ep: {'left': 1, 'right': 2}, + }, + { + zigbeeModel: ['DNCKAT_S003'], + model: 'DNCKATSW003', + vendor: 'Custom devices (DiY)', + description: '[DNCKAT triple key wired wall light switch](https://dzungpv.github.io/dnckatsw00x/)', + supports: 'left, center and right on/off', + fromZigbee: [fz.DNCKAT_S003_state, fz.DNCKAT_S003_buttons], + toZigbee: [tz.onoff], + ep: {'left': 1, 'center': 2, 'right': 3}, + }, + { + zigbeeModel: ['DNCKAT_S004'], + model: 'DNCKATSW004', + vendor: 'Custom devices (DiY)', + description: '[DNCKAT quadruple key wired wall light switch](https://dzungpv.github.io/dnckatsw00x/)', + supports: 'top left, top right, bottom left and bottom right on/off', + fromZigbee: [fz.DNCKAT_S004_state, fz.DNCKAT_S004_buttons], + toZigbee: [tz.onoff], + ep: {'bot_left': 1, 'bot_right': 2, 'top_left': 3, 'top_right': 4}, + }, // OSRAM { From 15ee011a191f389eb02a8143b5c8d106dac12da1 Mon Sep 17 00:00:00 2001 From: Pham Viet Dzung Date: Thu, 2 Aug 2018 11:21:34 +0700 Subject: [PATCH 195/676] Change from githubio to github because it not display configuration correctly --- devices.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/devices.js b/devices.js index 5ae7963821a19..e9c7e9f02d662 100644 --- a/devices.js +++ b/devices.js @@ -576,7 +576,7 @@ const devices = [ zigbeeModel: ['DNCKAT_S001'], model: 'DNCKATSW001', vendor: 'Custom devices (DiY)', - description: '[DNCKAT single key wired wall light switch](https://dzungpv.github.io/dnckatsw00x/)', + description: '[DNCKAT single key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'on/off', fromZigbee: [fz.generic_state, fz.ignore_onoff_change], toZigbee: [tz.onoff], @@ -585,7 +585,7 @@ const devices = [ zigbeeModel: ['DNCKAT_S002'], model: 'DNCKATSW002', vendor: 'Custom devices (DiY)', - description: '[DNCKAT double key wired wall light switch](https://dzungpv.github.io/dnckatsw00x/)', + description: '[DNCKAT double key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'left and right on/off', fromZigbee: [fz.DNCKAT_S002_state, fz.DNCKAT_S002_buttons], toZigbee: [tz.onoff], @@ -595,7 +595,7 @@ const devices = [ zigbeeModel: ['DNCKAT_S003'], model: 'DNCKATSW003', vendor: 'Custom devices (DiY)', - description: '[DNCKAT triple key wired wall light switch](https://dzungpv.github.io/dnckatsw00x/)', + description: '[DNCKAT triple key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'left, center and right on/off', fromZigbee: [fz.DNCKAT_S003_state, fz.DNCKAT_S003_buttons], toZigbee: [tz.onoff], @@ -605,7 +605,7 @@ const devices = [ zigbeeModel: ['DNCKAT_S004'], model: 'DNCKATSW004', vendor: 'Custom devices (DiY)', - description: '[DNCKAT quadruple key wired wall light switch](https://dzungpv.github.io/dnckatsw00x/)', + description: '[DNCKAT quadruple key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'top left, top right, bottom left and bottom right on/off', fromZigbee: [fz.DNCKAT_S004_state, fz.DNCKAT_S004_buttons], toZigbee: [tz.onoff], From 5db1fba308e1fdbeaedbaa9d06e4b9ec5209d2ed Mon Sep 17 00:00:00 2001 From: Viet Dzung Date: Sat, 4 Aug 2018 07:24:36 +0700 Subject: [PATCH 196/676] Remove duplicate code --- converters/fromZigbee.js | 68 +++++++++------------------------------- devices.js | 6 ++-- 2 files changed, 18 insertions(+), 56 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index f8a876a258f27..61607ff83e4bc 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -503,7 +503,7 @@ const converters = { }; }, }, - DNCKAT_S002_state: { + DNCKAT_S00X_state: { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { @@ -513,63 +513,25 @@ const converters = { return payload; }, }, - DNCKAT_S002_buttons: { + DNCKAT_S00X_buttons: { cid: 'genOnOff', type: 'devChange', convert: (model, msg, publish, options) => { - const mapping = {1: 'left', 2: 'right'}; - const button = mapping[msg.endpoints[0].epId]; - if (button) { - const payload = {}; - payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; - return payload; - } - }, - }, - DNCKAT_S003_state: { - cid: 'genOnOff', - type: 'attReport', - convert: (model, msg, publish, options) => { - const key = `state_${getKey(model.ep, msg.endpoints[0].epId)}`; - const payload = {}; - payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; - return payload; - }, - }, - DNCKAT_S003_buttons: { - cid: 'genOnOff', - type: 'devChange', - convert: (model, msg, publish, options) => { - const mapping = {1: 'left', 2: 'center', 3: 'right'}; - const button = mapping[msg.endpoints[0].epId]; - if (button) { - const payload = {}; - payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; - return payload; - } - }, - }, - DNCKAT_S004_state: { - cid: 'genOnOff', - type: 'attReport', - convert: (model, msg, publish, options) => { - const key = `state_${getKey(model.ep, msg.endpoints[0].epId)}`; + const modelID = msg.endpoints[0].device.modelId; + const mapping = {1: 'left', 2: 'right'}; + if (modelID === 'DNCKAT_S002') { + mapping = {1: 'left', 2: 'right'}; + }else if (modelID === 'DNCKAT_S003') { + mapping = {1: 'left', 2: 'center', 3: 'right'}; + }else if (modelID === 'DNCKAT_S004') { + mapping = {1: 'bot_left', 2: 'bot_right', 3: 'top_left', 4: 'top_right'}; + } + const button = mapping[msg.endpoints[0].epId]; + if (button) { const payload = {}; - payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; + payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; return payload; - }, - }, - DNCKAT_S004_buttons: { - cid: 'genOnOff', - type: 'devChange', - convert: (model, msg, publish, options) => { - const mapping = {1: 'bot_left', 2: 'bot_right', 3: 'top_left', 4: 'top_right'}; - const button = mapping[msg.endpoints[0].epId]; - if (button) { - const payload = {}; - payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; - return payload; - } + } }, }, Z809A_power: { diff --git a/devices.js b/devices.js index e9c7e9f02d662..2d34d3d3fcd73 100644 --- a/devices.js +++ b/devices.js @@ -587,7 +587,7 @@ const devices = [ vendor: 'Custom devices (DiY)', description: '[DNCKAT double key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'left and right on/off', - fromZigbee: [fz.DNCKAT_S002_state, fz.DNCKAT_S002_buttons], + fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], toZigbee: [tz.onoff], ep: {'left': 1, 'right': 2}, }, @@ -597,7 +597,7 @@ const devices = [ vendor: 'Custom devices (DiY)', description: '[DNCKAT triple key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'left, center and right on/off', - fromZigbee: [fz.DNCKAT_S003_state, fz.DNCKAT_S003_buttons], + fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], toZigbee: [tz.onoff], ep: {'left': 1, 'center': 2, 'right': 3}, }, @@ -607,7 +607,7 @@ const devices = [ vendor: 'Custom devices (DiY)', description: '[DNCKAT quadruple key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'top left, top right, bottom left and bottom right on/off', - fromZigbee: [fz.DNCKAT_S004_state, fz.DNCKAT_S004_buttons], + fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], toZigbee: [tz.onoff], ep: {'bot_left': 1, 'bot_right': 2, 'top_left': 3, 'top_right': 4}, }, From 13b576e1c4978af3a787579af3bb72b1631d3c91 Mon Sep 17 00:00:00 2001 From: Viet Dzung Date: Sat, 4 Aug 2018 07:59:54 +0700 Subject: [PATCH 197/676] Fix lint error and var --- converters/fromZigbee.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 61607ff83e4bc..105e49b3b8a9e 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -517,21 +517,21 @@ const converters = { cid: 'genOnOff', type: 'devChange', convert: (model, msg, publish, options) => { - const modelID = msg.endpoints[0].device.modelId; - const mapping = {1: 'left', 2: 'right'}; - if (modelID === 'DNCKAT_S002') { - mapping = {1: 'left', 2: 'right'}; - }else if (modelID === 'DNCKAT_S003') { - mapping = {1: 'left', 2: 'center', 3: 'right'}; - }else if (modelID === 'DNCKAT_S004') { - mapping = {1: 'bot_left', 2: 'bot_right', 3: 'top_left', 4: 'top_right'}; - } - const button = mapping[msg.endpoints[0].epId]; - if (button) { - const payload = {}; - payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; - return payload; - } + const modelID = msg.endpoints[0].device.modelId; + let mapping = {1: 'left', 2: 'right'}; + if (modelID === 'DNCKAT_S002') { + mapping = {1: 'left', 2: 'right'}; + } else if (modelID === 'DNCKAT_S003') { + mapping = {1: 'left', 2: 'center', 3: 'right'}; + } else if (modelID === 'DNCKAT_S004') { + mapping = {1: 'bot_left', 2: 'bot_right', 3: 'top_left', 4: 'top_right'}; + } + const button = mapping[msg.endpoints[0].epId]; + if (button) { + const payload = {}; + payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; + return payload; + } }, }, Z809A_power: { From a2b4bbae913ee4d4e09528e21f07e677858194b4 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 4 Aug 2018 19:42:37 +0200 Subject: [PATCH 198/676] Update DNCKAT_S00X --- converters/fromZigbee.js | 19 ++++--------------- devices.js | 12 ++++++------ 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 105e49b3b8a9e..5399b64fe48f3 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -517,21 +517,10 @@ const converters = { cid: 'genOnOff', type: 'devChange', convert: (model, msg, publish, options) => { - const modelID = msg.endpoints[0].device.modelId; - let mapping = {1: 'left', 2: 'right'}; - if (modelID === 'DNCKAT_S002') { - mapping = {1: 'left', 2: 'right'}; - } else if (modelID === 'DNCKAT_S003') { - mapping = {1: 'left', 2: 'center', 3: 'right'}; - } else if (modelID === 'DNCKAT_S004') { - mapping = {1: 'bot_left', 2: 'bot_right', 3: 'top_left', 4: 'top_right'}; - } - const button = mapping[msg.endpoints[0].epId]; - if (button) { - const payload = {}; - payload[`button_${button}`] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; - return payload; - } + const key = `button_${getKey(model.ep, msg.endpoints[0].epId)}`; + const payload = {}; + payload[key] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; + return payload; }, }, Z809A_power: { diff --git a/devices.js b/devices.js index 2d34d3d3fcd73..690c21f5abe40 100644 --- a/devices.js +++ b/devices.js @@ -146,7 +146,7 @@ const devices = [ model: 'QBKG03LM', vendor: 'Xiaomi', description: 'Aqara double key wired wall switch', - supports: 'left and right on/off', + supports: 'release/hold, on/off', fromZigbee: [ fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons, fz.ignore_basic_change, fz.ignore_basic_report, ], @@ -158,7 +158,7 @@ const devices = [ model: 'QBKG12LM', vendor: 'Xiaomi', description: 'Aqara double key wired wall switch', - supports: 'left and right on/off, power measurement', + supports: 'on/off, power measurement', fromZigbee: [ fz.QBKG03LM_QBKG12LM_state, fz.QBKG12LM_power, fz.ignore_analog_change, fz.ignore_basic_change, fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.ignore_analog_report, @@ -586,7 +586,7 @@ const devices = [ model: 'DNCKATSW002', vendor: 'Custom devices (DiY)', description: '[DNCKAT double key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', - supports: 'left and right on/off', + supports: 'hold/release, on/off', fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], toZigbee: [tz.onoff], ep: {'left': 1, 'right': 2}, @@ -596,7 +596,7 @@ const devices = [ model: 'DNCKATSW003', vendor: 'Custom devices (DiY)', description: '[DNCKAT triple key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', - supports: 'left, center and right on/off', + supports: 'hold/release, on/off', fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], toZigbee: [tz.onoff], ep: {'left': 1, 'center': 2, 'right': 3}, @@ -606,10 +606,10 @@ const devices = [ model: 'DNCKATSW004', vendor: 'Custom devices (DiY)', description: '[DNCKAT quadruple key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', - supports: 'top left, top right, bottom left and bottom right on/off', + supports: 'hold/release, on/off', fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], toZigbee: [tz.onoff], - ep: {'bot_left': 1, 'bot_right': 2, 'top_left': 3, 'top_right': 4}, + ep: {'bottom_left': 1, 'bottom_right': 2, 'top_left': 3, 'top_right': 4}, }, // OSRAM From a64aef593ccdedd955ba336e1520ddb40dad9148 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 4 Aug 2018 19:48:55 +0200 Subject: [PATCH 199/676] 2.0.37 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a04ba0d428050..0269850a105e3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.36", + "version": "2.0.37", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d3a690c8f7187..248cdff7d2699 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.36", + "version": "2.0.37", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From ffd9b510df3569cd36b33e54f35da193921e9d4c Mon Sep 17 00:00:00 2001 From: tb-killa Date: Wed, 8 Aug 2018 13:55:30 +0200 Subject: [PATCH 200/676] add ignore_onoff_change for WXKG03LM --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 690c21f5abe40..f40eca1cd9504 100644 --- a/devices.js +++ b/devices.js @@ -104,7 +104,7 @@ const devices = [ vendor: 'Xiaomi', description: 'Aqara single key wireless wall switch', supports: 'single click', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG03LM_click], + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG03LM_click, fz.ignore_onoff_change], toZigbee: [], }, { From 1f73c4dd38bd925ddd8dfb1bfb435b9be7218b36 Mon Sep 17 00:00:00 2001 From: tb-killa Date: Wed, 8 Aug 2018 16:22:23 +0200 Subject: [PATCH 201/676] Fix to right converter-type ignore_basic_change --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index f40eca1cd9504..18a94e6b7ad1b 100644 --- a/devices.js +++ b/devices.js @@ -104,7 +104,7 @@ const devices = [ vendor: 'Xiaomi', description: 'Aqara single key wireless wall switch', supports: 'single click', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG03LM_click, fz.ignore_onoff_change], + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG03LM_click, fz.ignore_basic_change], toZigbee: [], }, { From a1b82d45598fd2dc95590994052ef27599716ef5 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 9 Aug 2018 18:04:00 +0200 Subject: [PATCH 202/676] Support BY 165. https://github.com/Koenkk/zigbee2mqtt/issues/204 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 18a94e6b7ad1b..ac32a006b1942 100644 --- a/devices.js +++ b/devices.js @@ -754,6 +754,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['BY 165'], + model: 'BY 165', + vendor: 'Innr', + description: 'B22 Bulb dimmable', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, { zigbeeModel: ['PL 110'], model: 'PL 110', From c7057612402f79a9b6ef25cbe9a657f5e6ab583f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 9 Aug 2018 18:05:26 +0200 Subject: [PATCH 203/676] 2.0.38 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0269850a105e3..c0a4f58a07366 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.37", + "version": "2.0.38", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 248cdff7d2699..19f646944017f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.37", + "version": "2.0.38", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From b24838d1f85e8bea1207c1e4a64800643553c5a7 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Thu, 9 Aug 2018 19:02:26 +0200 Subject: [PATCH 204/676] osram flex rgbw --- devices.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/devices.js b/devices.js index ac32a006b1942..94fb9dd73d4f5 100644 --- a/devices.js +++ b/devices.js @@ -696,6 +696,16 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['Flex RGBW'], + model: 'ToDo', + vendor: 'OSRAM', + description: 'Flex RGBW', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, + // Hive { From dc25dce3d5666e9ec960af3fbe281a37a8e40f55 Mon Sep 17 00:00:00 2001 From: redmusicxd Date: Sat, 11 Aug 2018 01:52:43 +0300 Subject: [PATCH 205/676] Support Trust ZLED-2709 --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index 94fb9dd73d4f5..6bff6cdc74d4e 100644 --- a/devices.js +++ b/devices.js @@ -1020,6 +1020,17 @@ const devices = [ fromZigbee: [fz.smartthings_contact], toZigbee: [], }, + // Trust + { + zigbeeModel: ['ZLL-DimmableLigh'], + model: 'ZLED-2709', + vendor: 'Trust', + description: 'Smart Dimmable LED Bulb ', + supports: 'generic.light_onoff_brightness().supports', + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + ]; module.exports = devices; From 5bffa7b28f15b711f75593ebe8aff91a53e1009c Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Sat, 11 Aug 2018 12:01:17 +0200 Subject: [PATCH 206/676] hue LTW010 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 6bff6cdc74d4e..6e9c935549b84 100644 --- a/devices.js +++ b/devices.js @@ -502,6 +502,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['LTW010'], + model: 'todo', + vendor: 'Philips', + description: 'Hue white ambiance E27', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['RWL020', 'RWL021'], model: '324131092621', From 7691d5dcd6f10ef3c0c625ecc24c3b06008ebe36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Mon, 13 Aug 2018 11:51:01 +0300 Subject: [PATCH 207/676] Remove default value from parameter for support nodejs 4.* --- devices.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 6e9c935549b84..1aa374f7a896d 100644 --- a/devices.js +++ b/devices.js @@ -37,8 +37,9 @@ const generic = { const foundationCfg = {manufSpec: 0, disDefaultRsp: 0}; -const execute = (device, actions, callback, delay=300) => { +const execute = (device, actions, callback, delay) => { if (device) { + delay = delay || 300; actions = actions.reverse(); const next = () => { From 4e3b26ff5ef2fa2bc341197b2347e7fc99f645dc Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 13 Aug 2018 13:09:57 +0200 Subject: [PATCH 208/676] 2.0.39 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c0a4f58a07366..0e88d3529017f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.38", + "version": "2.0.39", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 19f646944017f..9bb059bdf5813 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.38", + "version": "2.0.39", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 499434640ec6682691d9b56a28f5fcf970be0b7a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 13 Aug 2018 18:56:01 +0200 Subject: [PATCH 209/676] Update devices.js --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 1aa374f7a896d..d61f049040224 100644 --- a/devices.js +++ b/devices.js @@ -505,7 +505,7 @@ const devices = [ }, { zigbeeModel: ['LTW010'], - model: 'todo', + model: '8718696548738', vendor: 'Philips', description: 'Hue white ambiance E27', supports: generic.light_onoff_brightness_colortemp().supports, @@ -708,7 +708,7 @@ const devices = [ }, { zigbeeModel: ['Flex RGBW'], - model: 'ToDo', + model: '4052899926110', vendor: 'OSRAM', description: 'Flex RGBW', supports: generic.light_onoff_brightness_colortemp_colorxy().supports, From 6408876c89dfdb77ed5a0acc8d9f4ce681b96e63 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 13 Aug 2018 19:14:10 +0200 Subject: [PATCH 210/676] Linting --- devices.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/devices.js b/devices.js index d61f049040224..88839c84c6b5d 100644 --- a/devices.js +++ b/devices.js @@ -1030,17 +1030,17 @@ const devices = [ fromZigbee: [fz.smartthings_contact], toZigbee: [], }, + // Trust - { - zigbeeModel: ['ZLL-DimmableLigh'], - model: 'ZLED-2709', - vendor: 'Trust', - description: 'Smart Dimmable LED Bulb ', + { + zigbeeModel: ['ZLL-DimmableLigh'], + model: 'ZLED-2709', + vendor: 'Trust', + description: 'Smart Dimmable LED Bulb ', supports: 'generic.light_onoff_brightness().supports', - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, }, - ]; module.exports = devices; From 8907a83af1c0fce87729d9c073f72718fe46e349 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 13 Aug 2018 20:25:26 +0200 Subject: [PATCH 211/676] light_color allow rgb colors. https://github.com/Koenkk/zigbee2mqtt/issues/272 --- converters/toZigbee.js | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index c89e042a06ab5..47e4730f6f283 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,5 +1,40 @@ 'use strict'; +/** + * From: https://github.com/usolved/cie-rgb-converter/blob/master/cie_rgb_converter.js + * Converts RGB color space to CIE color space + * @param {Number} red + * @param {Number} green + * @param {Number} blue + * @return {Array} Array that contains the CIE color values for x and y + */ +function rgbToXY(red, green, blue) { + // Apply a gamma correction to the RGB values, which makes the color + // more vivid and more the like the color displayed on the screen of your device + red = (red > 0.04045) ? Math.pow((red + 0.055) / (1.0 + 0.055), 2.4) : (red / 12.92); + green = (green > 0.04045) ? Math.pow((green + 0.055) / (1.0 + 0.055), 2.4) : (green / 12.92); + blue = (blue > 0.04045) ? Math.pow((blue + 0.055) / (1.0 + 0.055), 2.4) : (blue / 12.92); + + // RGB values to XYZ using the Wide RGB D65 conversion formula + const X = red * 0.664511 + green * 0.154324 + blue * 0.162028; + const Y = red * 0.283881 + green * 0.668433 + blue * 0.047685; + const Z = red * 0.000088 + green * 0.072310 + blue * 0.986039; + + // Calculate the xy values from the XYZ values + let x = (X / (X + Y + Z)).toFixed(4); + let y = (Y / (X + Y + Z)).toFixed(4); + + if (isNaN(x)) { + x = 0; + } + + if (isNaN(y)) { + y = 0; + } + + return {x: Number.parseFloat(x), y: Number.parseFloat(y)}; +} + const converters = { factory_reset: { key: 'reset', @@ -55,6 +90,11 @@ const converters = { key: 'color', attr: ['currentX', 'currentY'], convert: (value, message) => { + // Check if we need to convert from RGB to XY. + if (value.hasOwnProperty('r') && value.hasOwnProperty('g') && value.hasOwnProperty('b')) { + value = {...value, ...rgbToXY(value.r, value.g, value.b)}; + } + return { cid: 'lightingColorCtrl', cmd: 'moveToColor', From a22b8e370a379f5f722a6fa3cbefacb83dd3a251 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 13 Aug 2018 20:27:39 +0200 Subject: [PATCH 212/676] 2.0.40 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0e88d3529017f..b96f6fa5fb249 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.39", + "version": "2.0.40", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9bb059bdf5813..632668c495df8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.39", + "version": "2.0.40", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 8afaf673ed74d4a0036bce4fe7a17ddb1af8c1e4 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Tue, 14 Aug 2018 15:05:54 +0300 Subject: [PATCH 213/676] Rewrote spead construction for support NodeJS 4.* --- converters/toZigbee.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 47e4730f6f283..99f52876cc5f8 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -92,7 +92,9 @@ const converters = { convert: (value, message) => { // Check if we need to convert from RGB to XY. if (value.hasOwnProperty('r') && value.hasOwnProperty('g') && value.hasOwnProperty('b')) { - value = {...value, ...rgbToXY(value.r, value.g, value.b)}; + const xy = rgbToXY(value.r, value.g, value.b); + value.x = xy.x; + value.y = xy.y; } return { From 7ace8f84e6b91f92e8c3d5f5b68b00ec2c8127f3 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 14 Aug 2018 18:50:46 +0200 Subject: [PATCH 214/676] 2.0.41 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b96f6fa5fb249..edf3b7727267e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.40", + "version": "2.0.41", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 632668c495df8..6b754f851e8af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.40", + "version": "2.0.41", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 72b97387fd2ff2a61276ddf994dd1a0836417087 Mon Sep 17 00:00:00 2001 From: ibloat Date: Wed, 15 Aug 2018 21:52:13 +0900 Subject: [PATCH 215/676] add support for Sengled Element Touch (A19) --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 88839c84c6b5d..fb81a9f5fcf2b 100644 --- a/devices.js +++ b/devices.js @@ -953,6 +953,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['Z01-CIA19NAE26'], + model: 'Z01-CIA19NAE26', + vendor: 'Sengled', + description: 'Element Touch (A19)', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, // JIAWEN { From 84c35a7927a10eed0317daaa6fedeed72ffc9316 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 15 Aug 2018 15:54:36 +0200 Subject: [PATCH 216/676] 2.0.42 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index edf3b7727267e..83dc6c88832dd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.41", + "version": "2.0.42", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6b754f851e8af..6e8e54a294420 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.41", + "version": "2.0.42", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 33190ef93bd2dd8367d09255b7e65009c534c9fc Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 17 Aug 2018 19:04:23 +0200 Subject: [PATCH 217/676] Fix typos in ZLED-2709 --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index fb81a9f5fcf2b..c459a6db7c3ad 100644 --- a/devices.js +++ b/devices.js @@ -1045,8 +1045,8 @@ const devices = [ zigbeeModel: ['ZLL-DimmableLigh'], model: 'ZLED-2709', vendor: 'Trust', - description: 'Smart Dimmable LED Bulb ', - supports: 'generic.light_onoff_brightness().supports', + description: 'Smart Dimmable LED Bulb', + supports: generic.light_onoff_brightness().supports, fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, From 86df7b87abd06f1f462c16c35250d44a0bc87b39 Mon Sep 17 00:00:00 2001 From: Dennis Keitzel Date: Sat, 18 Aug 2018 17:11:34 +0200 Subject: [PATCH 218/676] Ignore basic changes for model WXKG02LM --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index c459a6db7c3ad..859af38c91f43 100644 --- a/devices.js +++ b/devices.js @@ -114,7 +114,7 @@ const devices = [ vendor: 'Xiaomi', description: 'Aqara double key wireless wall switch', supports: 'left, right and both click', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG02LM_click], + fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG02LM_click, fz.ignore_basic_change], toZigbee: [], ep: {'left': 1, 'right': 2, 'both': 3}, }, From dfdab0b86754f33c05169e40f2488177f3fc406f Mon Sep 17 00:00:00 2001 From: kimonm <40135180+kimonm@users.noreply.github.com> Date: Sun, 19 Aug 2018 15:58:13 -0700 Subject: [PATCH 219/676] Add support for Sylvania Smart+ bulb model 74283 Sylvania Smart+ bulb model 74283 ulb supports on/off/brightness. This one: https://www.amazon.com/gp/product/B0727WZ3L2/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 859af38c91f43..b51b00ccfc799 100644 --- a/devices.js +++ b/devices.js @@ -884,6 +884,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM'], + model: '74283', + vendor: 'Sylvania', + description: 'LIGHTIFY A19 ON/OFF/DIM', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, { zigbeeModel: ['PLUG'], model: '72922-A', From 9acf19f5aefc2832b6b90b2c61a3ae39aa9db7df Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 20 Aug 2018 20:23:24 +0200 Subject: [PATCH 220/676] Update 74283 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index b51b00ccfc799..c6b78e338b71c 100644 --- a/devices.js +++ b/devices.js @@ -888,7 +888,7 @@ const devices = [ zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM'], model: '74283', vendor: 'Sylvania', - description: 'LIGHTIFY A19 ON/OFF/DIM', + description: 'LIGHTIFY LED soft white dimmable A19', supports: generic.light_onoff_brightness().supports, fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, From 157c8d32afd849b6bf8d7283a4cbf1111c9e70ab Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 20 Aug 2018 20:25:10 +0200 Subject: [PATCH 221/676] 2.0.43 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 83dc6c88832dd..669559e02e5f8 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.42", + "version": "2.0.43", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6e8e54a294420..50e03e5d2b352 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.42", + "version": "2.0.43", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From c5fd23bafc2b10cedb8236623966e0f5322b623c Mon Sep 17 00:00:00 2001 From: ohmer1 <1868995+ohmer1@users.noreply.github.com> Date: Thu, 23 Aug 2018 21:53:12 -0400 Subject: [PATCH 222/676] Add support for Philips Hue LCT014 and LWB014. --- devices.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index c6b78e338b71c..8cac4d35fa443 100644 --- a/devices.js +++ b/devices.js @@ -467,6 +467,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['LWB014'], + model: '9290011369A', + vendor: 'Philips', + description: 'Hue White Single A19/E26 bulb', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, { zigbeeModel: ['LST002'], model: '915005106701', @@ -477,10 +486,10 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { - zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT015'], + zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT014', 'LCT015'], model: '9290012573A', vendor: 'Philips', - description: 'Hue white and color ambiance E27', + description: 'Hue white and color ambiance E26/E27', supports: generic.light_onoff_brightness_colortemp_colorxy().supports, fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, From e778d95b49d3212dea6a4c8c7124deba54a6ad9d Mon Sep 17 00:00:00 2001 From: ohmer1 <1868995+ohmer1@users.noreply.github.com> Date: Thu, 23 Aug 2018 22:44:12 -0400 Subject: [PATCH 223/676] Fix the LWB014 code. --- devices.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/devices.js b/devices.js index 8cac4d35fa443..8a2ca6d1a0471 100644 --- a/devices.js +++ b/devices.js @@ -450,7 +450,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { - zigbeeModel: ['LWB006'], + zigbeeModel: ['LWB006', 'LWB014'], model: '9290011370', vendor: 'Philips', description: 'Hue white A60 bulb E27', @@ -467,15 +467,6 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, - { - zigbeeModel: ['LWB014'], - model: '9290011369A', - vendor: 'Philips', - description: 'Hue White Single A19/E26 bulb', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, - }, { zigbeeModel: ['LST002'], model: '915005106701', From a463c03ee6218c62e387f908dd37361014b2bcef Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 25 Aug 2018 00:05:00 +0200 Subject: [PATCH 224/676] 2.0.44 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 669559e02e5f8..fe95f007f889f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.43", + "version": "2.0.44", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 50e03e5d2b352..9bc3ce66fe447 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.43", + "version": "2.0.44", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From d59cee1e0ec709e4336ed0cfa2f94ffc35880f8f Mon Sep 17 00:00:00 2001 From: roman Date: Sat, 25 Aug 2018 09:26:25 +0300 Subject: [PATCH 225/676] Add support for Xiaomi Gas leak sensor JTQJ-BF-01LM/BW --- converters/fromZigbee.js | 7 +++++++ devices.js | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 5399b64fe48f3..5cee0f0d11cae 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -477,6 +477,13 @@ const converters = { return {smoke: msg.data.zoneStatus === 1}; }, }, + JTQJBF01LMBW_gas: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + return {gas: msg.data.zoneStatus === 1}; + }, + }, EDP_power: { cid: 'seMetering', type: 'attReport', diff --git a/devices.js b/devices.js index 8a2ca6d1a0471..4f985f8c174ab 100644 --- a/devices.js +++ b/devices.js @@ -1059,6 +1059,17 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + + // Xiaomi Gas leak sensor + { + zigbeeModel: ['lumi.sensor_natgas'], + model: 'JTQJ-BF-01LM/BW', + vendor: 'Xiaomi', + description: 'MiJia Gas Leek Sensor ', + supports: 'alarm_co', + fromZigbee: [fz.JTQJBF01LMBW_gas, fz.ignore_basic_change], + toZigbee: [], + }, ]; module.exports = devices; From 5e552895cc911123d0ecd7a8ec4334b4172caf3c Mon Sep 17 00:00:00 2001 From: roman Date: Sat, 25 Aug 2018 09:37:39 +0300 Subject: [PATCH 226/676] Fix lint checks --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 4f985f8c174ab..5b563b6944060 100644 --- a/devices.js +++ b/devices.js @@ -1061,7 +1061,7 @@ const devices = [ }, // Xiaomi Gas leak sensor - { + { zigbeeModel: ['lumi.sensor_natgas'], model: 'JTQJ-BF-01LM/BW', vendor: 'Xiaomi', From 6b5695f6cd2b61400410369990ff8264bb6f54c6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 25 Aug 2018 22:47:54 +0200 Subject: [PATCH 227/676] Update JTQJ-BF-01LM/BW --- devices.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/devices.js b/devices.js index 5b563b6944060..1e53304ccd1c9 100644 --- a/devices.js +++ b/devices.js @@ -284,6 +284,15 @@ const devices = [ fromZigbee: [fz.xiaomi_battery_3v, fz.JTYJGD01LMBW_smoke, fz.ignore_basic_change], toZigbee: [], }, + { + zigbeeModel: ['lumi.sensor_natgas'], + model: 'JTQJ-BF-01LM/BW', + vendor: 'Xiaomi', + description: 'MiJia gas leak detector ', + supports: 'gas', + fromZigbee: [fz.JTQJBF01LMBW_gas, fz.ignore_basic_change], + toZigbee: [], + }, // IKEA { @@ -1059,17 +1068,6 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, - - // Xiaomi Gas leak sensor - { - zigbeeModel: ['lumi.sensor_natgas'], - model: 'JTQJ-BF-01LM/BW', - vendor: 'Xiaomi', - description: 'MiJia Gas Leek Sensor ', - supports: 'alarm_co', - fromZigbee: [fz.JTQJBF01LMBW_gas, fz.ignore_basic_change], - toZigbee: [], - }, ]; module.exports = devices; From d6faa11460c3798db314f4d6bd36eb32cb3bdbde Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 28 Aug 2018 22:18:02 +0200 Subject: [PATCH 228/676] 2.0.45 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index fe95f007f889f..e879d3b64aecd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.44", + "version": "2.0.45", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9bc3ce66fe447..2cc845dadad28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.44", + "version": "2.0.45", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 04b403828c5885d51e2155e8fff8db0e158ea30c Mon Sep 17 00:00:00 2001 From: TheCellMC Date: Wed, 29 Aug 2018 08:32:09 +0200 Subject: [PATCH 229/676] Update devices.js Added Philips Hue motion sensor --- devices.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/devices.js b/devices.js index 1e53304ccd1c9..1b33b4b9cb815 100644 --- a/devices.js +++ b/devices.js @@ -554,6 +554,31 @@ const devices = [ }); }, }, + { + zigbeeModel: ['SML001'], + model: '9290012607', + vendor: 'Philips', + description: 'Philips Hue motion sensor', + supports: 'motion, light and temperature', + fromZigbee: [fz._324131092621_power,fz.xiaomi_occupancy,fz.xiaomi_temperature,fz.ignore_occupancy_change,fz.xiaomi_illuminance,fz.ignore_illuminance_change,fz.ignore_temperature_change], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 2); + const actions = [ + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('msIlluminanceMeasurement', coordinator, cb), // Need report! + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.bind('msOccupancySensing', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), + (cb) => device.report('msOccupancySensing', 'occupancy', 0, 600, null, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + (cb) => device.report('msIlluminanceMeasurement', 'measuredValue', 0, 600, null, cb), + ]; + execute(device, actions, callback); + }, + }, + + // Belkin { From 066571003dea3d8f1eb3f7e9937ab5ebe3d77df2 Mon Sep 17 00:00:00 2001 From: TheCellMC Date: Wed, 29 Aug 2018 08:36:14 +0200 Subject: [PATCH 230/676] Update Hue motion sensor --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 1b33b4b9cb815..9d441654b0925 100644 --- a/devices.js +++ b/devices.js @@ -558,7 +558,7 @@ const devices = [ zigbeeModel: ['SML001'], model: '9290012607', vendor: 'Philips', - description: 'Philips Hue motion sensor', + description: 'Hue motion sensor', supports: 'motion, light and temperature', fromZigbee: [fz._324131092621_power,fz.xiaomi_occupancy,fz.xiaomi_temperature,fz.ignore_occupancy_change,fz.xiaomi_illuminance,fz.ignore_illuminance_change,fz.ignore_temperature_change], toZigbee: [], From 833a5202729e5883481446008340991658388006 Mon Sep 17 00:00:00 2001 From: TheCellMC Date: Wed, 29 Aug 2018 09:09:51 +0200 Subject: [PATCH 231/676] Update devices.js --- devices.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/devices.js b/devices.js index 9d441654b0925..f4d7935cdce01 100644 --- a/devices.js +++ b/devices.js @@ -560,25 +560,27 @@ const devices = [ vendor: 'Philips', description: 'Hue motion sensor', supports: 'motion, light and temperature', - fromZigbee: [fz._324131092621_power,fz.xiaomi_occupancy,fz.xiaomi_temperature,fz.ignore_occupancy_change,fz.xiaomi_illuminance,fz.ignore_illuminance_change,fz.ignore_temperature_change], + fromZigbee: [ + fz._324131092621_power, fz.xiaomi_occupancy, fz.xiaomi_temperature, + fz.ignore_occupancy_change, fz.xiaomi_illuminance, fz.ignore_illuminance_change, + fz.ignore_temperature_change + ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 2); - const actions = [ - (cb) => device.bind('genPowerCfg', coordinator, cb), - (cb) => device.bind('msIlluminanceMeasurement', coordinator, cb), // Need report! - (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), - (cb) => device.bind('msOccupancySensing', coordinator, cb), - (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), - (cb) => device.report('msOccupancySensing', 'occupancy', 0, 600, null, cb), - (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), - (cb) => device.report('msIlluminanceMeasurement', 'measuredValue', 0, 600, null, cb), - ]; - execute(device, actions, callback); + const device = shepherd.find(ieeeAddr, 2); + const actions = [ + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('msIlluminanceMeasurement', coordinator, cb), // Need report! + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.bind('msOccupancySensing', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), + (cb) => device.report('msOccupancySensing', 'occupancy', 0, 600, null, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + (cb) => device.report('msIlluminanceMeasurement', 'measuredValue', 0, 600, null, cb), + ]; + execute(device, actions, callback); }, }, - - // Belkin { From dfe90f8585c6d72f92f596684fbf9d51c2b173b1 Mon Sep 17 00:00:00 2001 From: TheCellMC Date: Wed, 29 Aug 2018 09:12:42 +0200 Subject: [PATCH 232/676] Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index f4d7935cdce01..8dd9f0171c408 100644 --- a/devices.js +++ b/devices.js @@ -563,7 +563,7 @@ const devices = [ fromZigbee: [ fz._324131092621_power, fz.xiaomi_occupancy, fz.xiaomi_temperature, fz.ignore_occupancy_change, fz.xiaomi_illuminance, fz.ignore_illuminance_change, - fz.ignore_temperature_change + fz.ignore_temperature_change, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { From a556ca5cc5588cfb3fc4ca70e0ace5f4fde25bd9 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 30 Aug 2018 17:52:14 +0200 Subject: [PATCH 233/676] Make some converters generic. --- converters/fromZigbee.js | 8 ++++---- devices.js | 23 +++++++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 5cee0f0d11cae..aa77a4aaffd74 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -161,7 +161,7 @@ const converters = { } }, }, - xiaomi_temperature: { + generic_temperature: { cid: 'msTemperatureMeasurement', type: 'attReport', convert: (model, msg, publish, options) => { @@ -246,7 +246,7 @@ const converters = { return {humidity: parseFloat(msg.data.data['measuredValue']) / 100.0}; }, }, - xiaomi_occupancy: { + generic_occupancy: { cid: 'msOccupancySensing', type: 'attReport', convert: (model, msg, publish, options) => { @@ -336,7 +336,7 @@ const converters = { } }, }, - xiaomi_illuminance: { + generic_illuminance: { cid: 'msIlluminanceMeasurement', type: 'attReport', convert: (model, msg, publish, options) => { @@ -600,7 +600,7 @@ const converters = { } }, }, - _324131092621_power: { + generic_battery: { cid: 'genPowerCfg', type: 'attReport', convert: (model, msg, publish, options) => { diff --git a/devices.js b/devices.js index 8dd9f0171c408..872fc16e8fc09 100644 --- a/devices.js +++ b/devices.js @@ -173,7 +173,7 @@ const devices = [ vendor: 'Xiaomi', description: 'MiJia temperature & humidity sensor ', supports: 'temperature and humidity', - fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_temperature, fz.xiaomi_humidity, fz.ignore_basic_change], + fromZigbee: [fz.xiaomi_battery_3v, fz.generic_temperature, fz.xiaomi_humidity, fz.ignore_basic_change], toZigbee: [], }, { @@ -183,8 +183,9 @@ const devices = [ description: 'Aqara temperature, humidity and pressure sensor', supports: 'temperature, humidity and pressure', fromZigbee: [ - fz.xiaomi_battery_3v, fz.xiaomi_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, fz.ignore_basic_change, - fz.ignore_temperature_change, fz.ignore_humidity_change, fz.ignore_pressure_change, + fz.xiaomi_battery_3v, fz.generic_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, + fz.ignore_basic_change, fz.ignore_temperature_change, fz.ignore_humidity_change, + fz.ignore_pressure_change, ], toZigbee: [], }, @@ -194,7 +195,7 @@ const devices = [ vendor: 'Xiaomi', description: 'MiJia human body movement sensor', supports: 'occupancy', - fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_occupancy, fz.ignore_basic_change], + fromZigbee: [fz.xiaomi_battery_3v, fz.generic_occupancy, fz.ignore_basic_change], toZigbee: [], }, { @@ -204,7 +205,7 @@ const devices = [ description: 'Aqara human body movement and illuminance sensor', supports: 'occupancy and illuminance', fromZigbee: [ - fz.xiaomi_battery_3v, fz.xiaomi_occupancy, fz.xiaomi_illuminance, fz.ignore_basic_change, + fz.xiaomi_battery_3v, fz.generic_occupancy, fz.generic_illuminance, fz.ignore_basic_change, fz.ignore_illuminance_change, fz.ignore_occupancy_change, ], toZigbee: [], @@ -529,7 +530,7 @@ const devices = [ supports: 'on/off', fromZigbee: [ fz._324131092621_on, fz._324131092621_off, fz._324131092621_step, fz._324131092621_stop, - fz.ignore_power_change, fz._324131092621_power, + fz.ignore_power_change, fz.generic_battery, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { @@ -559,18 +560,19 @@ const devices = [ model: '9290012607', vendor: 'Philips', description: 'Hue motion sensor', - supports: 'motion, light and temperature', + supports: 'occupancy, temperature, illuminance', fromZigbee: [ - fz._324131092621_power, fz.xiaomi_occupancy, fz.xiaomi_temperature, - fz.ignore_occupancy_change, fz.xiaomi_illuminance, fz.ignore_illuminance_change, + fz.generic_battery, fz.generic_occupancy, fz.generic_temperature, + fz.ignore_occupancy_change, fz.generic_illuminance, fz.ignore_illuminance_change, fz.ignore_temperature_change, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 2); + const actions = [ (cb) => device.bind('genPowerCfg', coordinator, cb), - (cb) => device.bind('msIlluminanceMeasurement', coordinator, cb), // Need report! + (cb) => device.bind('msIlluminanceMeasurement', coordinator, cb), (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), (cb) => device.bind('msOccupancySensing', coordinator, cb), (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), @@ -578,6 +580,7 @@ const devices = [ (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), (cb) => device.report('msIlluminanceMeasurement', 'measuredValue', 0, 600, null, cb), ]; + execute(device, actions, callback); }, }, From e871d3e970ca544d37613ce179be31efb79578cd Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 30 Aug 2018 17:53:40 +0200 Subject: [PATCH 234/676] 2.0.46 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e879d3b64aecd..84142678f1967 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.45", + "version": "2.0.46", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2cc845dadad28..687e65750d010 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.45", + "version": "2.0.46", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From c327f7d5d443b5601b44e91d98286c1042d30c71 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Mon, 3 Sep 2018 18:17:16 +0200 Subject: [PATCH 235/676] Paulmann LED Stripes --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index 872fc16e8fc09..e0ed52ce03e19 100644 --- a/devices.js +++ b/devices.js @@ -1098,6 +1098,17 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + + // Paulmann + { + zigbeeModel: ['Dimmablelight'], + model: '50045', + vendor: 'Paulmann', + description: 'Paulmann LED Stripes', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, ]; module.exports = devices; From 98d3773eb59b90d9a4fcae823677a8ee11c78ba4 Mon Sep 17 00:00:00 2001 From: evildad Date: Tue, 4 Sep 2018 13:04:15 +0200 Subject: [PATCH 236/676] Add a new converter xiaomi_interval. Fixes https://github.com/Koenkk/zigbee2mqtt/issues/327 --- converters/fromZigbee.js | 36 ++++++++++++++++++++++++++++++++++++ devices.js | 4 ++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index aa77a4aaffd74..6d96704a4fb1b 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -124,6 +124,42 @@ const converters = { } }, }, + // currently tested for WSDCGQ01LM/WSDCGQ11LM + xiaomi_interval: { + cid: 'genBasic', + type: 'attReport', + convert: (model, msg, publish, options) => { + let voltage = null; + let humidity = null; + let temperature = null; + let pressure = null; + + if (msg.data.data['65281']) { + voltage = msg.data.data['65281']['1']; + temperature = parseFloat(msg.data.data['65281']['100']) / 100.0; + humidity = parseFloat(msg.data.data['65281']['101']) / 100.0; + pressure = parseFloat(msg.data.data['65281']['102']) / 100.0; + + } + + if (pressure) { + return { + battery: toPercentage(voltage, battery3V.min, battery3V.max), + voltage: voltage, + temperature : temperature, + humidity : humidity, + pressure : pressure + }; + } else { + return { + battery: toPercentage(voltage, battery3V.min, battery3V.max), + voltage: voltage, + temperature : temperature, + humidity : humidity + }; + } + }, + }, WXKG01LM_click: { cid: 'genOnOff', type: 'attReport', diff --git a/devices.js b/devices.js index e0ed52ce03e19..1aa382a0e2848 100644 --- a/devices.js +++ b/devices.js @@ -173,7 +173,7 @@ const devices = [ vendor: 'Xiaomi', description: 'MiJia temperature & humidity sensor ', supports: 'temperature and humidity', - fromZigbee: [fz.xiaomi_battery_3v, fz.generic_temperature, fz.xiaomi_humidity, fz.ignore_basic_change], + fromZigbee: [fz.xiaomi_interval, fz.generic_temperature, fz.xiaomi_humidity, fz.ignore_basic_change], toZigbee: [], }, { @@ -183,7 +183,7 @@ const devices = [ description: 'Aqara temperature, humidity and pressure sensor', supports: 'temperature, humidity and pressure', fromZigbee: [ - fz.xiaomi_battery_3v, fz.generic_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, + fz.xiaomi_interval, fz.generic_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, fz.ignore_basic_change, fz.ignore_temperature_change, fz.ignore_humidity_change, fz.ignore_pressure_change, ], From ca9eadd875d7ee99b45094b5eac17d5a35c25417 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Tue, 4 Sep 2018 13:51:43 +0200 Subject: [PATCH 237/676] Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 1aa382a0e2848..9241a26cf5a52 100644 --- a/devices.js +++ b/devices.js @@ -1101,7 +1101,7 @@ const devices = [ // Paulmann { - zigbeeModel: ['Dimmablelight'], + zigbeeModel: ['Dimmablelight '], model: '50045', vendor: 'Paulmann', description: 'Paulmann LED Stripes', From c307c6904e6d434160d873e2a511bef3d6d70c15 Mon Sep 17 00:00:00 2001 From: evildad Date: Tue, 4 Sep 2018 13:59:18 +0200 Subject: [PATCH 238/676] fix code styling failures --- converters/fromZigbee.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 6d96704a4fb1b..dcce0349a0e06 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -136,28 +136,26 @@ const converters = { if (msg.data.data['65281']) { voltage = msg.data.data['65281']['1']; - temperature = parseFloat(msg.data.data['65281']['100']) / 100.0; + temperature = parseFloat(msg.data.data['65281']['100']) / 100.0; humidity = parseFloat(msg.data.data['65281']['101']) / 100.0; pressure = parseFloat(msg.data.data['65281']['102']) / 100.0; - } - if (pressure) { return { battery: toPercentage(voltage, battery3V.min, battery3V.max), voltage: voltage, - temperature : temperature, - humidity : humidity, - pressure : pressure + temperature: temperature, + humidity: humidity, + pressure: pressure, + }; + } else { + return { + battery: toPercentage(voltage, battery3V.min, battery3V.max), + voltage: voltage, + temperature: temperature, + humidity: humidity, }; - } else { - return { - battery: toPercentage(voltage, battery3V.min, battery3V.max), - voltage: voltage, - temperature : temperature, - humidity : humidity - }; - } + } }, }, WXKG01LM_click: { From 93b295967d970e7fa970923cb5e2e651b5a93d02 Mon Sep 17 00:00:00 2001 From: evildad Date: Tue, 4 Sep 2018 14:47:36 +0200 Subject: [PATCH 239/676] removed battery from converter and added fz.xiaomi_battery_3v back to devices.js --- converters/fromZigbee.js | 6 ------ devices.js | 9 ++++++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index dcce0349a0e06..347c00678924f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -129,29 +129,23 @@ const converters = { cid: 'genBasic', type: 'attReport', convert: (model, msg, publish, options) => { - let voltage = null; let humidity = null; let temperature = null; let pressure = null; if (msg.data.data['65281']) { - voltage = msg.data.data['65281']['1']; temperature = parseFloat(msg.data.data['65281']['100']) / 100.0; humidity = parseFloat(msg.data.data['65281']['101']) / 100.0; pressure = parseFloat(msg.data.data['65281']['102']) / 100.0; } if (pressure) { return { - battery: toPercentage(voltage, battery3V.min, battery3V.max), - voltage: voltage, temperature: temperature, humidity: humidity, pressure: pressure, }; } else { return { - battery: toPercentage(voltage, battery3V.min, battery3V.max), - voltage: voltage, temperature: temperature, humidity: humidity, }; diff --git a/devices.js b/devices.js index 9241a26cf5a52..3fa80d5f3814b 100644 --- a/devices.js +++ b/devices.js @@ -173,7 +173,10 @@ const devices = [ vendor: 'Xiaomi', description: 'MiJia temperature & humidity sensor ', supports: 'temperature and humidity', - fromZigbee: [fz.xiaomi_interval, fz.generic_temperature, fz.xiaomi_humidity, fz.ignore_basic_change], + fromZigbee: [ + fz.xiaomi_battery_3v, fz.xiaomi_interval, fz.generic_temperature, fz.xiaomi_humidity, + fz.ignore_basic_change, + ], toZigbee: [], }, { @@ -183,9 +186,9 @@ const devices = [ description: 'Aqara temperature, humidity and pressure sensor', supports: 'temperature, humidity and pressure', fromZigbee: [ - fz.xiaomi_interval, fz.generic_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, + fz.xiaomi_battery_3v, fz.generic_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, fz.ignore_basic_change, fz.ignore_temperature_change, fz.ignore_humidity_change, - fz.ignore_pressure_change, + fz.ignore_pressure_change, fz.xiaomi_interval, ], toZigbee: [], }, From 2e0d742104e6dbd4c806d939bd959ebbd6f19fe9 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 5 Sep 2018 15:31:25 +0200 Subject: [PATCH 240/676] Update 50045 --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 3fa80d5f3814b..d5a4256029d96 100644 --- a/devices.js +++ b/devices.js @@ -1101,13 +1101,13 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, - + // Paulmann { zigbeeModel: ['Dimmablelight '], model: '50045', vendor: 'Paulmann', - description: 'Paulmann LED Stripes', + description: 'SmartHome Zigbee LED-stripe', supports: generic.light_onoff_brightness().supports, fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, From b3405dd83d6d99468428cda7f42e8176d26bfd5b Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 5 Sep 2018 15:34:10 +0200 Subject: [PATCH 241/676] Set default occupancy timeout to 90 seconds. https://github.com/Koenkk/zigbee2mqtt/issues/270 --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 347c00678924f..6fe5f3dfdeca6 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -14,7 +14,7 @@ const battery3V = { max: 3000, }; -const occupancyTimeout = 60; // In seconds +const occupancyTimeout = 90; // In seconds const toPercentage = (value, min, max) => { if (value > max) { From 0f0632917679277e0ad371c024517e2a58483139 Mon Sep 17 00:00:00 2001 From: kimonm <40135180+kimonm@users.noreply.github.com> Date: Sat, 8 Sep 2018 15:54:34 -0700 Subject: [PATCH 242/676] Update devices.js Added support for Lowes Iris Smart Plug model 3210-L This one: https://www.lowes.com/pd/Iris-120-Volt-White-Smart-Plug/999925330 --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index d5a4256029d96..7ce82e4a372e2 100644 --- a/devices.js +++ b/devices.js @@ -1112,6 +1112,17 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + + // Iris + { + zigbeeModel: ['3210-L'], + model: '3210-L', + vendor: 'Iris', + description: 'Iris Smart Plug', + supports: 'on/off', + fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + toZigbee: [tz.onoff], + }, ]; module.exports = devices; From 015b3c4eef7103fc1e34fefed98e8cb3de8e57f9 Mon Sep 17 00:00:00 2001 From: kimonm <40135180+kimonm@users.noreply.github.com> Date: Sat, 8 Sep 2018 16:05:41 -0700 Subject: [PATCH 243/676] Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 7ce82e4a372e2..c023acaccf829 100644 --- a/devices.js +++ b/devices.js @@ -1112,7 +1112,7 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, - + // Iris { zigbeeModel: ['3210-L'], From d48a5183a3e2e9968f569451aeeb1d8353b4fbd3 Mon Sep 17 00:00:00 2001 From: tb-killa Date: Sun, 9 Sep 2018 11:54:19 +0200 Subject: [PATCH 244/676] add Bitron AV2010/22 to devices.js --- devices.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/devices.js b/devices.js index c023acaccf829..1739091454cba 100644 --- a/devices.js +++ b/devices.js @@ -1123,6 +1123,25 @@ const devices = [ fromZigbee: [fz.ignore_onoff_change, fz.generic_state], toZigbee: [tz.onoff], }, + // Bitron Home (Telecom Branding) + { + zigbeeModel: ['902010/22'], + model: 'Bitron AV2010/22', + vendor: 'Bitron Home', + description: 'IAS Infrared Sensor', + supports: 'occupancy', + fromZigbee: [fz.bitron_occupancy], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.report('ssIasZone', 'zoneStatus', 0, 30, null, cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 1, zoneid: 23}, cb), + ]; + execute(device, actions, callback); + }, + }, ]; module.exports = devices; From 67207f8bccf4df03c53d936b4b08a6246b856ed7 Mon Sep 17 00:00:00 2001 From: tb-killa Date: Sun, 9 Sep 2018 11:58:22 +0200 Subject: [PATCH 245/676] add occupancy via ssIasZone for Bitron AV2010/22 --- converters/fromZigbee.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 6fe5f3dfdeca6..a5fbb3f6375e2 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -97,6 +97,29 @@ const holdUpdateBrightness324131092621 = (deviceID) => { const converters = { + bitron_occupancy: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + // The occupancy sensor only sends a message when motion detected. + // Therefore we need to publish the no_motion detected by ourselves. + const useOptionsTimeout = options && options.hasOwnProperty('occupancy_timeout'); + const timeout = useOptionsTimeout ? options.occupancy_timeout : occupancyTimeout; + const deviceID = msg.endpoints[0].device.ieeeAddr; + // Stop existing timer because motion is detected and set a new one. + if (store[deviceID]) { + clearTimeout(store[deviceID]); + store[deviceID] = null; + } + if (timeout !== 0) { + store[deviceID] = setTimeout(() => { + publish({occupancy: false}); + store[deviceID] = null; + }, timeout * 1000); + } + return {occupancy: true}; + }, + }, smartthings_contact: { cid: 'ssIasZone', type: 'statusChange', From 2ff9c07818a05b89386679a9e52552c2292ea507 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 10 Sep 2018 18:09:02 +0200 Subject: [PATCH 246/676] Update 3210-L --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 1739091454cba..780521267f2e6 100644 --- a/devices.js +++ b/devices.js @@ -1118,7 +1118,7 @@ const devices = [ zigbeeModel: ['3210-L'], model: '3210-L', vendor: 'Iris', - description: 'Iris Smart Plug', + description: 'Smart plug', supports: 'on/off', fromZigbee: [fz.ignore_onoff_change, fz.generic_state], toZigbee: [tz.onoff], From 57339547112de9f86f0894c590dc4bb4c601ee7e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 10 Sep 2018 18:13:40 +0200 Subject: [PATCH 247/676] Update AV2010/22 --- devices.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index 780521267f2e6..8f5ec477713cb 100644 --- a/devices.js +++ b/devices.js @@ -1123,12 +1123,13 @@ const devices = [ fromZigbee: [fz.ignore_onoff_change, fz.generic_state], toZigbee: [tz.onoff], }, - // Bitron Home (Telecom Branding) + + // Bitron Home { zigbeeModel: ['902010/22'], - model: 'Bitron AV2010/22', + model: 'AV2010/22', vendor: 'Bitron Home', - description: 'IAS Infrared Sensor', + description: 'Wireless motion detector', supports: 'occupancy', fromZigbee: [fz.bitron_occupancy], toZigbee: [], @@ -1139,6 +1140,7 @@ const devices = [ (cb) => device.report('ssIasZone', 'zoneStatus', 0, 30, null, cb), (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 1, zoneid: 23}, cb), ]; + execute(device, actions, callback); }, }, From 893e7fb67294c9d17b8f3a7a972392f02b020e2d Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 10 Sep 2018 18:14:39 +0200 Subject: [PATCH 248/676] Update bitron_occupancy (layout only) --- converters/fromZigbee.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index a5fbb3f6375e2..8134357682f6f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -106,17 +106,20 @@ const converters = { const useOptionsTimeout = options && options.hasOwnProperty('occupancy_timeout'); const timeout = useOptionsTimeout ? options.occupancy_timeout : occupancyTimeout; const deviceID = msg.endpoints[0].device.ieeeAddr; + // Stop existing timer because motion is detected and set a new one. if (store[deviceID]) { clearTimeout(store[deviceID]); store[deviceID] = null; } + if (timeout !== 0) { store[deviceID] = setTimeout(() => { publish({occupancy: false}); store[deviceID] = null; }, timeout * 1000); } + return {occupancy: true}; }, }, From 94e60572133a0606e495abe8957d0129e12d9718 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 10 Sep 2018 18:19:31 +0200 Subject: [PATCH 249/676] Fix --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index 8f5ec477713cb..5b855ac9a282b 100644 --- a/devices.js +++ b/devices.js @@ -1144,6 +1144,17 @@ const devices = [ execute(device, actions, callback); }, }, + + // Iris + { + zigbeeModel: ['3210-L'], + model: '3210-L', + vendor: 'Iris', + description: 'Smart plug', + supports: 'on/off', + fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + toZigbee: [tz.onoff], + }, ]; module.exports = devices; From 8a39abffa57fd59c86fe9b21e50c87c1643eb976 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 10 Sep 2018 18:41:11 +0200 Subject: [PATCH 250/676] Lint --- devices.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/devices.js b/devices.js index 5b855ac9a282b..8b70cb874de17 100644 --- a/devices.js +++ b/devices.js @@ -1113,17 +1113,6 @@ const devices = [ toZigbee: generic.light_onoff_brightness().toZigbee, }, - // Iris - { - zigbeeModel: ['3210-L'], - model: '3210-L', - vendor: 'Iris', - description: 'Smart plug', - supports: 'on/off', - fromZigbee: [fz.ignore_onoff_change, fz.generic_state], - toZigbee: [tz.onoff], - }, - // Bitron Home { zigbeeModel: ['902010/22'], From 8290b88402c70531252582c840297fab6da96fee Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 11 Sep 2018 17:57:00 +0200 Subject: [PATCH 251/676] 2.0.47 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 84142678f1967..03887ffe25539 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.46", + "version": "2.0.47", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 687e65750d010..8c4c909b117e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.46", + "version": "2.0.47", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 41595e42f1826a000e4096faf5ba619e388f444e Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 11 Sep 2018 21:33:19 +0200 Subject: [PATCH 252/676] BREAKING CHANGE: update for https://github.com/Koenkk/zigbee2mqtt/pull/355 --- converters/toZigbee.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 99f52876cc5f8..f0649864217c4 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -43,6 +43,7 @@ const converters = { return { cid: 'genBasic', cmd: 'resetFactDefault', + type: 'functional', zclData: {}, }; }, @@ -54,6 +55,7 @@ const converters = { return { cid: 'genOnOff', cmd: value.toLowerCase(), + type: 'functional', zclData: {}, }; }, @@ -65,6 +67,7 @@ const converters = { return { cid: 'genLevelCtrl', cmd: 'moveToLevel', + type: 'functional', zclData: { level: value, transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, @@ -79,6 +82,7 @@ const converters = { return { cid: 'lightingColorCtrl', cmd: 'moveToColorTemp', + type: 'functional', zclData: { colortemp: value, transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, @@ -100,6 +104,7 @@ const converters = { return { cid: 'lightingColorCtrl', cmd: 'moveToColor', + type: 'functional', zclData: { colorx: value.x * 65535, colory: value.y * 65535, From 55aacacadc1c7e79acfe64d2a359a81b70ed8e69 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 11 Sep 2018 21:36:18 +0200 Subject: [PATCH 253/676] 3.0.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 03887ffe25539..a37c8adf1df2a 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.47", + "version": "3.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8c4c909b117e1..1765ea6d4d8a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "2.0.47", + "version": "3.0.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 3e19b175ff0639ae01eeca6343b497ff23e2d2ac Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 11 Sep 2018 21:46:07 +0200 Subject: [PATCH 254/676] Support LCT016. https://github.com/Koenkk/zigbee-shepherd-converters/issues/68 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 8b70cb874de17..c4d7987f382bb 100644 --- a/devices.js +++ b/devices.js @@ -490,7 +490,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { - zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT014', 'LCT015'], + zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT014', 'LCT015', 'LCT016'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E26/E27', From 76e7b6a2c2112f6411b3b82dd9bd3c6dc27a7b4d Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 11 Sep 2018 21:46:26 +0200 Subject: [PATCH 255/676] 3.0.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a37c8adf1df2a..9b222d0b3a956 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1765ea6d4d8a0..fee3263c98b28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.0", + "version": "3.0.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From b4cd8a91673d71d16ff6717b4a4de9bdd0726fd3 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 11 Sep 2018 21:57:52 +0200 Subject: [PATCH 256/676] Support LTS001. https://github.com/Koenkk/zigbee2mqtt/issues/354 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index c4d7987f382bb..10594d05d81f5 100644 --- a/devices.js +++ b/devices.js @@ -480,6 +480,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['LST001'], + model: '7299355PH', + vendor: 'Philips', + description: 'Hue white and color ambiance LightStrip', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['LST002'], model: '915005106701', From 65269e634ed986a473d7a34178490b613aab0e2f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 11 Sep 2018 21:58:27 +0200 Subject: [PATCH 257/676] 3.0.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 9b222d0b3a956..4f9de78e54173 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.1", + "version": "3.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fee3263c98b28..71fcbfe37f0d6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.1", + "version": "3.0.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 77467be5632f86df04eddc04e6423b2bd23960ae Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 11 Sep 2018 22:17:16 +0200 Subject: [PATCH 258/676] Update WSDCGQ01LM_WSDCGQ11LM_interval --- converters/fromZigbee.js | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 8134357682f6f..36c5d4d8e8ae0 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -150,31 +150,22 @@ const converters = { } }, }, - // currently tested for WSDCGQ01LM/WSDCGQ11LM - xiaomi_interval: { + WSDCGQ01LM_WSDCGQ11LM_interval: { cid: 'genBasic', type: 'attReport', convert: (model, msg, publish, options) => { - let humidity = null; - let temperature = null; - let pressure = null; - if (msg.data.data['65281']) { - temperature = parseFloat(msg.data.data['65281']['100']) / 100.0; - humidity = parseFloat(msg.data.data['65281']['101']) / 100.0; - pressure = parseFloat(msg.data.data['65281']['102']) / 100.0; - } - if (pressure) { - return { - temperature: temperature, - humidity: humidity, - pressure: pressure, - }; - } else { - return { - temperature: temperature, - humidity: humidity, + const result = { + temperature: parseFloat(msg.data.data['65281']['100']) / 100.0, + humidity: parseFloat(msg.data.data['65281']['101']) / 100.0, }; + + // Check if contains pressure (WSDCGQ11LM only) + if (msg.data.data['65281'].hasOwnProperty('102')) { + result.pressure = parseFloat(msg.data.data['65281']['102']) / 100.0; + } + + return result; } }, }, From 269ac49541b0044ac7aa3b31fe5eb004cd63c3aa Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 11 Sep 2018 22:17:55 +0200 Subject: [PATCH 259/676] Update WSDCGQ01LM/WSDCGQ11LM with WSDCGQ01LM_WSDCGQ11LM_interval --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 10594d05d81f5..57c2b9f460d3d 100644 --- a/devices.js +++ b/devices.js @@ -174,7 +174,7 @@ const devices = [ description: 'MiJia temperature & humidity sensor ', supports: 'temperature and humidity', fromZigbee: [ - fz.xiaomi_battery_3v, fz.xiaomi_interval, fz.generic_temperature, fz.xiaomi_humidity, + fz.xiaomi_battery_3v, fz.WSDCGQ01LM_WSDCGQ11LM_interval, fz.generic_temperature, fz.xiaomi_humidity, fz.ignore_basic_change, ], toZigbee: [], @@ -188,7 +188,7 @@ const devices = [ fromZigbee: [ fz.xiaomi_battery_3v, fz.generic_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, fz.ignore_basic_change, fz.ignore_temperature_change, fz.ignore_humidity_change, - fz.ignore_pressure_change, fz.xiaomi_interval, + fz.ignore_pressure_change, fz.WSDCGQ01LM_WSDCGQ11LM_interval, ], toZigbee: [], }, From 21b8d87d4ee2207bcea9dac8f5595ec73eb8061e Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 12 Sep 2018 22:15:45 +0200 Subject: [PATCH 260/676] 3.0.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4f9de78e54173..ba0241cfe2341 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.2", + "version": "3.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 71fcbfe37f0d6..785eca12a915d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.2", + "version": "3.0.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 91e2c8d9984509fb7b96a151f3a067e81d74c4dc Mon Sep 17 00:00:00 2001 From: kimonm <40135180+kimonm@users.noreply.github.com> Date: Sun, 16 Sep 2018 23:22:02 -0700 Subject: [PATCH 261/676] Added power reporting for Iris 3210-L plug (#71) * Add power reporting to Iris 3210-L Added reporting of power for Iris 3210-L * Add power reporting to Iris 3210-L Added power reporting to Iris 3210-L plug --- converters/fromZigbee.js | 7 +++++++ devices.js | 10 +++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 36c5d4d8e8ae0..9fa5bab1f2bfa 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -672,6 +672,13 @@ const converters = { cmd: 'moveToLevelWithOnOff', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'level'), }, + iris_3210L_power: { + cid: 'haElectricalMeasurement', + type: 'attReport', + convert: (model, msg, publish, options) => { + return {power: msg.data.data['activePower'] / 10.0}; + }, + }, // Ignore converters (these message dont need parsing). ignore_onoff_change: { diff --git a/devices.js b/devices.js index 57c2b9f460d3d..42ad8f67c8c90 100644 --- a/devices.js +++ b/devices.js @@ -1150,8 +1150,16 @@ const devices = [ vendor: 'Iris', description: 'Smart plug', supports: 'on/off', - fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + fromZigbee: [fz.ignore_onoff_change, fz.ignore_electrical_change, fz.generic_state, fz.iris_3210L_power], toZigbee: [tz.onoff], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.report('haElectricalMeasurement', 'activePower', 10, 1000, 1, cb), + ]; + + execute(device, actions, callback); + }, }, ]; From 3d67aa5e4c869abee87363102bd727b0384bfc04 Mon Sep 17 00:00:00 2001 From: Sean Nyekjar Date: Sat, 15 Sep 2018 13:18:53 +0200 Subject: [PATCH 262/676] devices: add support for Philips Hue Lux A19 Bulb --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 42ad8f67c8c90..8e1541f25bf76 100644 --- a/devices.js +++ b/devices.js @@ -462,6 +462,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['LWB004'], + model: '433714', + vendor: 'Philips', + description: 'Hue Lux A19 bulb E27', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, { zigbeeModel: ['LWB006', 'LWB014'], model: '9290011370', From 5d0f691c05085cb971702c051d2cbd8a9f0b3eec Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 17 Sep 2018 19:08:41 +0200 Subject: [PATCH 263/676] Fix lint issues. --- converters/fromZigbee.js | 10 +++++----- devices.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 9fa5bab1f2bfa..d2ae4ba995cb9 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -673,11 +673,11 @@ const converters = { convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'level'), }, iris_3210L_power: { - cid: 'haElectricalMeasurement', - type: 'attReport', - convert: (model, msg, publish, options) => { - return {power: msg.data.data['activePower'] / 10.0}; - }, + cid: 'haElectricalMeasurement', + type: 'attReport', + convert: (model, msg, publish, options) => { + return {power: msg.data.data['activePower'] / 10.0}; + }, }, // Ignore converters (these message dont need parsing). diff --git a/devices.js b/devices.js index 8e1541f25bf76..3b9c9d47b084d 100644 --- a/devices.js +++ b/devices.js @@ -1162,12 +1162,12 @@ const devices = [ fromZigbee: [fz.ignore_onoff_change, fz.ignore_electrical_change, fz.generic_state, fz.iris_3210L_power], toZigbee: [tz.onoff], configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); - const actions = [ - (cb) => device.report('haElectricalMeasurement', 'activePower', 10, 1000, 1, cb), + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.report('haElectricalMeasurement', 'activePower', 10, 1000, 1, cb), ]; - - execute(device, actions, callback); + + execute(device, actions, callback); }, }, ]; From 7047349306e5c7cff25c9f145e2a41cdd7c79201 Mon Sep 17 00:00:00 2001 From: Kirov Ilya Date: Thu, 13 Sep 2018 23:34:26 +0300 Subject: [PATCH 264/676] Xiaomi Vima Smart Lock (lumi.lock.v1) --- converters/fromZigbee.js | 24 ++++++++++++++++++++++++ devices.js | 9 +++++++++ 2 files changed, 33 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index d2ae4ba995cb9..5c3cc0404436f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -515,6 +515,30 @@ const converters = { } }, }, + xiaomi_lock_report: { + cid: 'genBasic', + type: 'attReport', + convert: (model, msg, publish, options) => { + if (msg.data.data['65328']) { + const data = msg.data.data['65328']; + const state = data.substr(2,2); + const action = data.substr(4,2); + const keynum = data.substr(6,2); + if (state == 11 && action == 7) { + // wrong key or not success inserted + return {keyerror: true}; + } + if (state == 12) { + if (action == 1) { + return {inserted: keynum}; + } + if (action == 11) { + return {forgotten: keynum}; + } + } + } + }, + }, JTYJGD01LMBW_smoke: { cid: 'ssIasZone', type: 'statusChange', diff --git a/devices.js b/devices.js index 3b9c9d47b084d..d46e2127213bc 100644 --- a/devices.js +++ b/devices.js @@ -297,6 +297,15 @@ const devices = [ fromZigbee: [fz.JTQJBF01LMBW_gas, fz.ignore_basic_change], toZigbee: [], }, + { + zigbeeModel: ['lumi.lock.v1'], + model: 'A6121', + vendor: 'Xiaomi', + description: 'Xiaomi Vima Smart Lock', + supports: 'inserted, forgotten, key error', + fromZigbee: [fz.xiaomi_lock_report, fz.ignore_basic_change], + toZigbee: [], + }, // IKEA { From bef79f89782ab2f92f45c2d4b28ea464b8e24ffa Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 17 Sep 2018 19:02:43 +0200 Subject: [PATCH 265/676] Update A6121 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index d46e2127213bc..92bd33cb0f47a 100644 --- a/devices.js +++ b/devices.js @@ -301,7 +301,7 @@ const devices = [ zigbeeModel: ['lumi.lock.v1'], model: 'A6121', vendor: 'Xiaomi', - description: 'Xiaomi Vima Smart Lock', + description: 'Vima Smart Lock', supports: 'inserted, forgotten, key error', fromZigbee: [fz.xiaomi_lock_report, fz.ignore_basic_change], toZigbee: [], From 9ba265aaafcc40030a2bb34a1655ed8877353ad6 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 17 Sep 2018 19:12:45 +0200 Subject: [PATCH 266/676] 3.0.4 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ba0241cfe2341..0cab7e1cf221d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.3", + "version": "3.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 785eca12a915d..93b402ed1c44d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.3", + "version": "3.0.4", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 71d8febbec7e367c4c869610a8cc0606a967a347 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 17 Sep 2018 21:33:23 +0200 Subject: [PATCH 267/676] Lint --- converters/fromZigbee.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 5c3cc0404436f..782fdf7eef25f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -521,9 +521,9 @@ const converters = { convert: (model, msg, publish, options) => { if (msg.data.data['65328']) { const data = msg.data.data['65328']; - const state = data.substr(2,2); - const action = data.substr(4,2); - const keynum = data.substr(6,2); + const state = data.substr(2, 2); + const action = data.substr(4, 2); + const keynum = data.substr(6, 2); if (state == 11 && action == 7) { // wrong key or not success inserted return {keyerror: true}; From 58369c2c5b68285a487c4b7da7e67c358ed6b67e Mon Sep 17 00:00:00 2001 From: esdeboer Date: Mon, 17 Sep 2018 21:34:14 +0200 Subject: [PATCH 268/676] Support for hue Being (#73) --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 92bd33cb0f47a..062f52f10ed4f 100644 --- a/devices.js +++ b/devices.js @@ -552,6 +552,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['LTC001'], + model: '3261030P7', + vendor: 'Philips', + description: 'Hue Being', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['RWL020', 'RWL021'], model: '324131092621', From f9d66bdeb0bc6d80918b026c89e5d9ea63f5efdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pl=C3=A1cido=20Revilla?= Date: Tue, 18 Sep 2018 09:02:29 -0700 Subject: [PATCH 269/676] Add Sengled Element Color Plus (A19) [E11-N1EA] support (#72) * Add Sengled Element Color Plus (A19) [E11-N1EA] support * Update E11-N1EA --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 062f52f10ed4f..0a43ee9dea4b2 100644 --- a/devices.js +++ b/devices.js @@ -1049,6 +1049,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['E11-N1EA'], + model: 'E11-N1EA', + vendor: 'Sengled', + description: 'Element Plus Color (A19)', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, // JIAWEN { From 623d366dd570dc336825e09bdb0237e867fdb760 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 18 Sep 2018 18:08:13 +0200 Subject: [PATCH 270/676] 3.0.5 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0cab7e1cf221d..aec613af9a628 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.4", + "version": "3.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 93b402ed1c44d..b6263919965fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.4", + "version": "3.0.5", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From b4f772c17e6f0c58716640c7f7f0764047a0cf35 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 19 Sep 2018 21:17:44 +0200 Subject: [PATCH 271/676] Support for cfg parameters. https://github.com/Koenkk/zigbee2mqtt/pull/383 --- converters/toZigbee.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index f0649864217c4..5683871cb746d 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -45,6 +45,10 @@ const converters = { cmd: 'resetFactDefault', type: 'functional', zclData: {}, + cfg: { + manufSpec: 0, + disDefaultRsp: 0, + }, }; }, }, @@ -57,6 +61,10 @@ const converters = { cmd: value.toLowerCase(), type: 'functional', zclData: {}, + cfg: { + manufSpec: 0, + disDefaultRsp: 0, + }, }; }, }, @@ -72,6 +80,10 @@ const converters = { level: value, transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, + cfg: { + manufSpec: 0, + disDefaultRsp: 0, + }, }; }, }, @@ -87,6 +99,10 @@ const converters = { colortemp: value, transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, + cfg: { + manufSpec: 0, + disDefaultRsp: 0, + }, }; }, }, @@ -110,6 +126,10 @@ const converters = { colory: value.y * 65535, transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, + cfg: { + manufSpec: 0, + disDefaultRsp: 0, + }, }; }, }, From 326c0f8f3e5e50925e838bbb061685d45311013a Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 19 Sep 2018 21:20:19 +0200 Subject: [PATCH 272/676] 4.0.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index aec613af9a628..0be1f15d3b283 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.5", + "version": "4.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b6263919965fe..c51fb850b0b32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "3.0.5", + "version": "4.0.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From e176b59a53582d85d8f9c7e1c4548f40a14c9477 Mon Sep 17 00:00:00 2001 From: Viet Dzung Date: Fri, 21 Sep 2018 03:05:36 +0700 Subject: [PATCH 273/676] Support Aqara Viration sensor DJT11LM (#74) * Support Aqara Viration sensor DJT11LM * Update DJT11LM --- converters/fromZigbee.js | 59 ++++++++++++++++++++++++++++++++++++++++ converters/toZigbee.js | 28 +++++++++++++++++++ devices.js | 11 ++++++++ 3 files changed, 98 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 782fdf7eef25f..183c5a1c09cb5 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -553,6 +553,60 @@ const converters = { return {gas: msg.data.zoneStatus === 1}; }, }, + DJT11LM_vibration: { + cid: 'closuresDoorLock', + type: 'attReport', + convert: (model, msg, publish, options) => { + const result = {}; + const vibrationLookup = { + 1: 'vibration', + 2: 'tilt', + 3: 'drop', + }; + + if (msg.data.data['85']) { + const data = msg.data.data['85']; + result.action = vibrationLookup[data]; + } + if (msg.data.data['1283']) { + const data = msg.data.data['1283']; + result.angle = data; + } + if (msg.data.data['1285']) { + const data = msg.data.data['1285']; + result.unknown_data = data; + } + + if (msg.data.data['1288']) { + const data = msg.data.data['1288']; + + let x; let y; let z; + + // array interpretation: + // 12 bit two's complement sign extended integer + // data[1][bit0..bit15] : x + // data[1][bit16..bit31]: y + // data[0][bit0..bit15] : z + // left shift first to preserve sign extension for 'x' + x = ((data['1'] << 16) >> 16); + y = (data['1'] >> 16); + // left shift first to preserve sign extension for 'z' + z = ((data['0'] << 16) >> 16); + + // calculate angle + result.angle_x = Math.round(Math.atan(x/Math.sqrt(y*y+z*z)) * 180 / Math.PI); + result.angle_y = Math.round(Math.atan(y/Math.sqrt(x*x+z*z)) * 180 / Math.PI); + result.angle_z = Math.round(Math.atan(z/Math.sqrt(x*x+y*y)) * 180 / Math.PI); + + // calculate absolulte angle + let R = Math.sqrt(x * x + y * y + z * z); + result.angle_x_absolute = Math.round((Math.acos(x / R)) * 180 / Math.PI); + result.angle_y_absolute = Math.round((Math.acos(y / R)) * 180 / Math.PI); + } + + return result; + }, + }, EDP_power: { cid: 'seMetering', type: 'attReport', @@ -705,6 +759,11 @@ const converters = { }, // Ignore converters (these message dont need parsing). + ignore_doorlock_change: { + cid: 'closuresDoorLock', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, ignore_onoff_change: { cid: 'genOnOff', type: 'devChange', diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 5683871cb746d..5c9f962777d92 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -133,6 +133,34 @@ const converters = { }; }, }, + /* Note when send the command to set sensitivity, press button on the device to make it wakeup*/ + DJT11LM_vibration_sensitivity: { + key: 'sensitivity', + attr: ['level'], + convert: (value, message) => { + const lookup = { + 'low': 0x15, + 'medium': 0x0B, + 'high': 0x01, + }; + + return { + cid: 'genBasic', + cmd: 'write', + type: 'foundation', + zclData: { + attrId: 0xFF0D, + dataType: 0x20, + attrData: lookup[value], + }, + cfg: { + manufSpec: 1, + disDefaultRsp: 1, + manufCode: 0x115F, + }, + }; + }, + }, // Ignore converters ignore_transition: { diff --git a/devices.js b/devices.js index 0a43ee9dea4b2..6287741e04a35 100644 --- a/devices.js +++ b/devices.js @@ -306,6 +306,17 @@ const devices = [ fromZigbee: [fz.xiaomi_lock_report, fz.ignore_basic_change], toZigbee: [], }, + { + zigbeeModel: ['lumi.vibration.aq1'], + model: 'DJT11LM', + vendor: 'Xiaomi', + description: 'Aqara vibration sensor', + supports: 'drop, tilt and touch', + fromZigbee: [ + fz.xiaomi_battery_3v, fz.DJT11LM_vibration, fz.ignore_basic_change, fz.ignore_doorlock_change, + ], + toZigbee: [tz.DJT11LM_vibration_sensitivity], + }, // IKEA { From 2484b35d8eec5d00092e51458ec7c4035dffe4ec Mon Sep 17 00:00:00 2001 From: Placido Revilla Date: Thu, 20 Sep 2018 11:36:10 -0700 Subject: [PATCH 274/676] Add support for GE 45857 in-wall smart dimmer --- devices.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/devices.js b/devices.js index 6287741e04a35..fc354ab65ebec 100644 --- a/devices.js +++ b/devices.js @@ -1031,6 +1031,25 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['45857'], + model: '45857GE', + vendor: 'GE', + description: 'ZigBee in-wall smart dimmer', + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.ignore_onoff_change, fz.generic_state], + toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, // Sengled { From 785e8bc98aea9deb62dde07dc60d1169aa25fdda Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 20 Sep 2018 22:20:38 +0200 Subject: [PATCH 275/676] 4.0.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0be1f15d3b283..e28c884c548ed 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.0", + "version": "4.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c51fb850b0b32..b435fc523de71 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.0", + "version": "4.0.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From a91c504d7889b2a37e94f2971ef5495e689a8843 Mon Sep 17 00:00:00 2001 From: k3erg Date: Tue, 25 Sep 2018 10:38:46 +0200 Subject: [PATCH 276/676] Support for WXKG02LM with modelId 'lumi.remote.b286acn01\u0000\u0000\u0000' (#62) * Support for WXKG02LM with modelId 'lumi.remote.b286acn01\u0000\u0000\u0000' * Support for WXKG02LM with modelId 'lumi.remote.b286acn01\u0000\u0000\u0000' * Whitespace fix. * WXKG02LM type 2, add fz.ignore_multistate_change to fromZigbee * whitespace fix :). * trailing comma fix :) * Update WXKG02LM * Remove Paulmann * Update WXKG02LM_click_multistate * Handle single clicks with cid "genMultistateInput" with WXKG02LM_click_multistate. --- converters/fromZigbee.js | 20 ++++++++++++++++++++ devices.js | 7 +++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 183c5a1c09cb5..3cccd3783fb26 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -402,6 +402,26 @@ const converters = { return {click: getKey(model.ep, msg.endpoints[0].epId)}; }, }, + WXKG02LM_click_multistate: { + cid: 'genMultistateInput', + type: 'attReport', + convert: (model, msg, publish, options) => { + const button = getKey(model.ep, msg.endpoints[0].epId); + const value = msg.data.data['presentValue']; + + const actionLookup = { + 0: 'long', + 1: null, + 2: 'double', + }; + + const action = actionLookup[value]; + + if (button) { + return {click: button + (action ? `_${action}` : '')}; + } + }, + }, WXKG03LM_click: { cid: 'genOnOff', type: 'attReport', diff --git a/devices.js b/devices.js index fc354ab65ebec..08b01c76a703c 100644 --- a/devices.js +++ b/devices.js @@ -109,12 +109,15 @@ const devices = [ toZigbee: [], }, { - zigbeeModel: ['lumi.sensor_86sw2\u0000Un', 'lumi.sensor_86sw2.es1'], + zigbeeModel: ['lumi.sensor_86sw2\u0000Un', 'lumi.sensor_86sw2.es1', 'lumi.remote.b286acn01\u0000\u0000\u0000'], model: 'WXKG02LM', vendor: 'Xiaomi', description: 'Aqara double key wireless wall switch', supports: 'left, right and both click', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG02LM_click, fz.ignore_basic_change], + fromZigbee: [ + fz.xiaomi_battery_3v, fz.WXKG02LM_click, fz.ignore_basic_change, + fz.WXKG02LM_click_multistate, fz.ignore_multistate_change, + ], toZigbee: [], ep: {'left': 1, 'right': 2, 'both': 3}, }, From f3e79c8fb3db03b4a0247e8a19e79cd7f7d4e4ee Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 25 Sep 2018 16:35:34 +0200 Subject: [PATCH 277/676] Remove color temperature support from LST001. https://github.com/Koenkk/zigbee2mqtt/issues/354 --- devices.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index 08b01c76a703c..513a6086411ce 100644 --- a/devices.js +++ b/devices.js @@ -517,9 +517,9 @@ const devices = [ model: '7299355PH', vendor: 'Philips', description: 'Hue white and color ambiance LightStrip', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, }, { zigbeeModel: ['LST002'], From 7f7975d093a6f07e12e52b9ff8d29a0d9b6059aa Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Tue, 25 Sep 2018 16:42:01 +0200 Subject: [PATCH 278/676] Add LLC011 and LTW001 lights (#79) * Add LLC011 and LTW001 lights * Merge LLC011 with LLC012 and LTW001 with LTW010. * Remove LLC011 --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 513a6086411ce..2dce5f673e8c1 100644 --- a/devices.js +++ b/devices.js @@ -468,7 +468,7 @@ const devices = [ // Philips { - zigbeeModel: ['LLC012'], + zigbeeModel: ['LLC012', 'LLC011'], model: '7299760PH', vendor: 'Philips', description: 'Hue Bloom', @@ -558,7 +558,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { - zigbeeModel: ['LTW010'], + zigbeeModel: ['LTW010', 'LTW001'], model: '8718696548738', vendor: 'Philips', description: 'Hue white ambiance E27', From b8220d9c448b8317ba6c367f1c9a10d2771c2454 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 25 Sep 2018 16:44:41 +0200 Subject: [PATCH 279/676] Add support for LLC010 (Philips Hue Iris). https://github.com/Koenkk/zigbee2mqtt/issues/399 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 2dce5f673e8c1..e251bbef505aa 100644 --- a/devices.js +++ b/devices.js @@ -575,6 +575,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['LLC010'], + model: '7199960PH', + vendor: 'Philips', + description: 'Hue Iris', + supports: generic.light_onoff_brightness_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, + }, { zigbeeModel: ['RWL020', 'RWL021'], model: '324131092621', From 95c3a2c0807f0e83c43a298a7e7af41a6b5efe4d Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 26 Sep 2018 14:30:47 +0200 Subject: [PATCH 280/676] Support LTW004. https://github.com/Koenkk/zigbee2mqtt/issues/405 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index e251bbef505aa..c0afb4e0294b1 100644 --- a/devices.js +++ b/devices.js @@ -558,7 +558,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, { - zigbeeModel: ['LTW010', 'LTW001'], + zigbeeModel: ['LTW010', 'LTW001', 'LTW004'], model: '8718696548738', vendor: 'Philips', description: 'Hue white ambiance E27', From 54420da190608c19377a051341fd9226cfa5d7c2 Mon Sep 17 00:00:00 2001 From: Roman Zhukov Date: Thu, 27 Sep 2018 16:42:45 +0300 Subject: [PATCH 281/676] Advanced commands support for Xiaomi gas leak sensor (#80) * Advanced commands support for Xiaomi gas leak sensor * Read sensitivity * Set sensitivity * Run selftest * Fix lint * Update JTQJBF01LMBW --- converters/fromZigbee.js | 21 +++++++++++++++ converters/toZigbee.js | 58 ++++++++++++++++++++++++++++++++++++++++ devices.js | 4 +-- 3 files changed, 81 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3cccd3783fb26..f7d347cef1228 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -573,6 +573,27 @@ const converters = { return {gas: msg.data.zoneStatus === 1}; }, }, + JTQJBF01LMBW_sensitivity: { + cid: 'ssIasZone', + type: 'devChange', + convert: (model, msg, publish, options) => { + const data = msg.data.data; + const lookup = { + '1': 'low', + '2': 'medium', + '3': 'high', + }; + + if (data && data.hasOwnProperty('65520')) { + const value = data['65520']; + if (value && value.startsWith('0x020')) { + return { + sensitivity: lookup[value.charAt(5)], + }; + } + } + }, + }, DJT11LM_vibration: { cid: 'closuresDoorLock', type: 'attReport', diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 5c9f962777d92..614ac7be92655 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -35,6 +35,12 @@ function rgbToXY(red, green, blue) { return {x: Number.parseFloat(x), y: Number.parseFloat(y)}; } +const JTQJBF01LMBWConfig = { + manufSpec: 1, + disDefaultRsp: 1, + manufCode: 0x115F, +}; + const converters = { factory_reset: { key: 'reset', @@ -161,7 +167,59 @@ const converters = { }; }, }, + JTQJBF01LMBW_sensitivity: { + key: 'sensitivity', + attr: ['sensitivity'], + convert: (value, message) => { + if (value === 'read') { + return { + cid: 'ssIasZone', + cmd: 'read', + type: 'foundation', + zclData: { + attrId: 0xFFF0, // presentValue + dataType: 0x39, // dataType + }, + cfg: JTQJBF01LMBWConfig, + }; + } else { + const lookup = { + 'low': 0x04010000, + 'medium': 0x04020000, + 'high': 0x04030000, + }; + return { + cid: 'ssIasZone', + cmd: 'write', + type: 'foundation', + zclData: { + attrId: 0xFFF1, // presentValue + dataType: 0x23, // dataType + attrData: lookup[value], + }, + cfg: JTQJBF01LMBWConfig, + }; + } + }, + }, + JTQJBF01LMBW_selfest: { + key: 'selftest', + attr: [0xFFF1], + convert: (value, message) => { + return { + cid: 'ssIasZone', + cmd: 'write', + type: 'foundation', + zclData: { + attrId: 0xFFF1, // presentValue + dataType: 0x23, // dataType + attrData: 0x03010000, + }, + cfg: JTQJBF01LMBWConfig, + }; + }, + }, // Ignore converters ignore_transition: { key: 'transition', diff --git a/devices.js b/devices.js index c0afb4e0294b1..3c3fe4cfbb189 100644 --- a/devices.js +++ b/devices.js @@ -297,8 +297,8 @@ const devices = [ vendor: 'Xiaomi', description: 'MiJia gas leak detector ', supports: 'gas', - fromZigbee: [fz.JTQJBF01LMBW_gas, fz.ignore_basic_change], - toZigbee: [], + fromZigbee: [fz.JTQJBF01LMBW_gas, fz.JTQJBF01LMBW_sensitivity, fz.ignore_basic_change], + toZigbee: [tz.JTQJBF01LMBW_sensitivity, tz.JTQJBF01LMBW_selfest], }, { zigbeeModel: ['lumi.lock.v1'], From 943736b04a38ac844e02ea4b3d579e4c32a219de Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 27 Sep 2018 15:49:17 +0200 Subject: [PATCH 282/676] Support 74696. https://github.com/Koenkk/zigbee-shepherd-converters/issues/82 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 3c3fe4cfbb189..aed622705cf0a 100644 --- a/devices.js +++ b/devices.js @@ -994,6 +994,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['A19 W 10 year'], + model: '74696', + vendor: 'Sylvania', + description: 'LIGHTIFY LED soft white dimmable A19', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, { zigbeeModel: ['PLUG'], model: '72922-A', From 523a8fc1f12ec42a04de1367a38cb93ba113ce0b Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Thu, 27 Sep 2018 15:55:55 +0200 Subject: [PATCH 283/676] Surface Light TW (#83) * Added device OSRAM Surface Light TW * LIGHTIFY Indoor Flex RGBW * Lint --- devices.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index aed622705cf0a..641846d04733b 100644 --- a/devices.js +++ b/devices.js @@ -788,6 +788,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['Surface Light TW'], + model: 'AB401130055', + vendor: 'OSRAM', + description: 'LIGHTIFY Surface Light LED Tunable White', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['Plug 01'], model: 'AB3257001NJ', @@ -808,7 +817,7 @@ const devices = [ }, }, { - zigbeeModel: ['Flex RGBW'], + zigbeeModel: ['Flex RGBW', 'LIGHTIFY Indoor Flex RGBW'], model: '4052899926110', vendor: 'OSRAM', description: 'Flex RGBW', From fde36bc8b2995d62ef231e1a7346640cb63aa52a Mon Sep 17 00:00:00 2001 From: Glen Takahashi Date: Sat, 29 Sep 2018 15:13:44 -0400 Subject: [PATCH 284/676] Fix brightness command being dropped when turning on bulbs (#81) * use moveToLevelWithOnOff * Update toZigbee.js --- converters/toZigbee.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 614ac7be92655..fa8721faf0143 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -76,11 +76,11 @@ const converters = { }, light_brightness: { key: 'brightness', - attr: ['currentLevel'], + attr: ['currentLevel', 'onOff'], convert: (value, message) => { return { cid: 'genLevelCtrl', - cmd: 'moveToLevel', + cmd: 'moveToLevelWithOnOff', type: 'functional', zclData: { level: value, From 2f257af10829e81335523388c7e411e7bd04b344 Mon Sep 17 00:00:00 2001 From: UnrealKazu <9115757+UnrealKazu@users.noreply.github.com> Date: Sat, 29 Sep 2018 21:14:48 +0200 Subject: [PATCH 285/676] Add support for TRADFRI Control Outlet (#86) The outlet is a simple on/off switch, so the config is based on genOnOff --- devices.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/devices.js b/devices.js index 641846d04733b..2ae788a2b0b30 100644 --- a/devices.js +++ b/devices.js @@ -465,6 +465,25 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['TRADFRI control outlet'], + model: 'E1603', + description: 'TRADFRI control outlet', + supports: 'on/off', + vendor: 'IKEA', + fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + toZigbee: [tz.onoff], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, // Philips { From a804fa675cc47dfcdb0f8c9f005adfd8b0a5646f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 29 Sep 2018 21:24:41 +0200 Subject: [PATCH 286/676] Support AB35996. https://github.com/Koenkk/zigbee-shepherd-converters/issues/88 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 2ae788a2b0b30..cd3def61170bc 100644 --- a/devices.js +++ b/devices.js @@ -844,6 +844,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['PAR 16 50 RGBW - LIGHTIFY'], + model: 'AB35996', + vendor: 'OSRAM', + description: 'Smart+ Spot GU10 Multicolor', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, // Hive From 583c7dda1b1f70dd55abd96fe4c022db326cf170 Mon Sep 17 00:00:00 2001 From: Pfluppe <39125291+Pfluppe@users.noreply.github.com> Date: Sat, 29 Sep 2018 22:39:50 +0200 Subject: [PATCH 287/676] Update devices.js (#91) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index cd3def61170bc..9c78d5c74f07a 100644 --- a/devices.js +++ b/devices.js @@ -754,7 +754,7 @@ const devices = [ }, { zigbeeModel: ['CLA60 RGBW OSRAM'], - model: 'AC03845', + model: 'AC03645', vendor: 'OSRAM', description: 'LIGHTIFY LED CLA60 E27 RGBW', supports: generic.light_onoff_brightness_colortemp_colorxy().supports, From 0e5a0ea16e07a648b70426222c1cf3c7a6cb3bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pl=C3=A1cido=20Revilla?= Date: Sat, 29 Sep 2018 13:53:52 -0700 Subject: [PATCH 288/676] =?UTF-8?q?Use=20a=20lookup=20table=20for=203V=20c?= =?UTF-8?q?ell=20battery=20to=20account=20for=20the=20non-lineari=E2=80=A6?= =?UTF-8?q?=20(#77)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use a lookup table for 3V cell battery to account for the non-linearity of the discharge * Don't use es6 syntax (for ioBroker compatibility) * Lint --- converters/fromZigbee.js | 92 +++++++++++++++++++++++++++++++--------- 1 file changed, 73 insertions(+), 19 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index f7d347cef1228..d3307500da26d 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -9,23 +9,73 @@ const clickLookup = { 4: 'quadruple', }; -const battery3V = { - min: 2700, - max: 3000, -}; - const occupancyTimeout = 90; // In seconds -const toPercentage = (value, min, max) => { - if (value > max) { - value = max; - } else if (value < min) { - value = min; - } - - const normalised = (value - min) / (max - min); - return (normalised * 100).toFixed(2); -}; +const voltageMap = [ + [2000, 0], + [2186, 1], + [2373, 2], + [2563, 3], + [2626, 4], + [2675, 5], + [2717, 6], + [2753, 7], + [2784, 8], + [2813, 9], + [2838, 10], + [2859, 11], + [2875, 12], + [2891, 13], + [2905, 14], + [2915, 15], + [2921, 16], + [2926, 17], + [2931, 18], + [2936, 19], + [2939, 20], + [2942, 21], + [2945, 22], + [2949, 23], + [2951, 24], + [2953, 25], + [2955, 26], + [2957, 27], + [2959, 28], + [2961, 29], + [2964, 30], + [2966, 31], + [2968, 32], + [2969, 33], + [2971, 34], + [2973, 35], + [2974, 36], + [2976, 37], + [2978, 38], + [2980, 39], + [2982, 40], + [2984, 41], + [2986, 42], + [2988, 43], + [2990, 44], + [2991, 46], + [2992, 48], + [2993, 49], + [2994, 51], + [2995, 53], + [2996, 55], + [2997, 57], + [2998, 59], + [2999, 61], + [3000, 64], + [3001, 66], + [3002, 69], + [3003, 77], + [3004, 90], + [3005, 98], + [3028, 99], + [3211, 100], + [Infinity, 100], +]; const precisionRound = (number, precision) => { const factor = Math.pow(10, precision); @@ -143,10 +193,14 @@ const converters = { } if (voltage) { - return { - battery: toPercentage(voltage, battery3V.min, battery3V.max), - voltage: voltage, - }; + for (let i = 0; i < voltageMap.length; i++) { + if (voltageMap[i][0] > voltage) { + return { + battery: voltageMap[i][1].toFixed(2), + voltage: voltage, + }; + } + } } }, }, From 1d93eb280c08a936143e0a342ab28ffcce4becc4 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sat, 29 Sep 2018 22:54:10 +0200 Subject: [PATCH 289/676] 4.0.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e28c884c548ed..b66e4ec85be35 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.1", + "version": "4.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b435fc523de71..6299461ac38fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.1", + "version": "4.0.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 48282f071a0ca42955f2e41d571ccebd48bf2d47 Mon Sep 17 00:00:00 2001 From: Phil Hawthorne Date: Mon, 1 Oct 2018 20:13:11 +1000 Subject: [PATCH 290/676] Add support for Philips Hue E14 bulbs (#92) Adds support for the E14 Philips Hue bulbs --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 9c78d5c74f07a..01dc17af92c35 100644 --- a/devices.js +++ b/devices.js @@ -550,10 +550,10 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { - zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT014', 'LCT015', 'LCT016'], + zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT012', 'LCT014', 'LCT015', 'LCT016'], model: '9290012573A', vendor: 'Philips', - description: 'Hue white and color ambiance E26/E27', + description: 'Hue white and color ambiance E26/E27/E14', supports: generic.light_onoff_brightness_colortemp_colorxy().supports, fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, From 18b97174dce02695c3745040399e84b73c576032 Mon Sep 17 00:00:00 2001 From: Phil Hawthorne Date: Tue, 2 Oct 2018 00:39:50 +1000 Subject: [PATCH 291/676] Add support for Sylvania MR16 Tuneable White (#94) * Add support for Sylvania MR16 Tuneable White Adds support for the Sylvania MR16 Tuneable White lightglobe. * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 01dc17af92c35..7ed71570f59d3 100644 --- a/devices.js +++ b/devices.js @@ -1059,6 +1059,15 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['MR16 TW'], + model: '74282', + vendor: 'Sylvania', + description: 'Smart Home adjustable white MR16 LED bulb', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, // GE { From a05b975e28e375aa19aef9123f4bee2c03f471d0 Mon Sep 17 00:00:00 2001 From: Harrison Pace Date: Sat, 6 Oct 2018 05:19:05 +1000 Subject: [PATCH 292/676] Added Support for new WXKG11LM Model (#89) * Fixed WXKG11LMv2 Support * Move WXKG11LM * Merge WXKG11LM models --- converters/fromZigbee.js | 15 +++++++++++++++ devices.js | 9 ++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index d3307500da26d..2448a0ec3d86a 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -338,6 +338,21 @@ const converters = { return lookup[value] ? lookup[value] : null; }, }, + WXKG11LM_action_click_multistate: { + cid: 'genMultistateInput', + type: 'attReport', + convert: (model, msg, publish, options) => { + const value = msg.data.data['presentValue']; + const lookup = { + 1: {click: 'single'}, // single click + 2: {click: 'double'}, // double click + 0: {action: 'hold'}, // hold for more than 400ms + 255: {action: 'release'}, // release after hold for more than 400ms + }; + + return lookup[value] ? lookup[value] : null; + }, + }, xiaomi_humidity: { cid: 'msRelativeHumidity', type: 'attReport', diff --git a/devices.js b/devices.js index 7ed71570f59d3..f9dda1ccb0461 100644 --- a/devices.js +++ b/devices.js @@ -79,12 +79,15 @@ const devices = [ toZigbee: [], }, { - zigbeeModel: ['lumi.sensor_switch.aq2'], + zigbeeModel: ['lumi.sensor_switch.aq2', 'lumi.remote.b1acn01\u0000\u0000\u0000\u0000\u0000\u0000'], model: 'WXKG11LM', vendor: 'Xiaomi', description: 'Aqara wireless switch', - supports: 'single, double, triple, quadruple click', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG11LM_click, fz.ignore_onoff_change, fz.ignore_basic_change], + supports: 'single, double click (and triple, quadruple, hold, release depending on model)', + fromZigbee: [ + fz.xiaomi_battery_3v, fz.WXKG11LM_click, fz.ignore_onoff_change, fz.ignore_basic_change, + fz.WXKG11LM_action_click_multistate, fz.ignore_multistate_change, + ], toZigbee: [], }, { From 810cf530af5207ae3d054d0f5d19a702ac8ef70f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 5 Oct 2018 21:20:44 +0200 Subject: [PATCH 293/676] Fix crash on invalid sensitivity value. https://github.com/Koenkk/zigbee2mqtt/issues/427 --- converters/toZigbee.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index fa8721faf0143..3fe774d86c39e 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -189,17 +189,19 @@ const converters = { 'high': 0x04030000, }; - return { - cid: 'ssIasZone', - cmd: 'write', - type: 'foundation', - zclData: { - attrId: 0xFFF1, // presentValue - dataType: 0x23, // dataType - attrData: lookup[value], - }, - cfg: JTQJBF01LMBWConfig, - }; + if (lookup.hasOwnProperty(value)) { + return { + cid: 'ssIasZone', + cmd: 'write', + type: 'foundation', + zclData: { + attrId: 0xFFF1, // presentValue + dataType: 0x23, // dataType + attrData: lookup[value], + }, + cfg: JTQJBF01LMBWConfig, + }; + } } }, }, From 508ee1be7773f12d81041bac1edc6217a61e73b0 Mon Sep 17 00:00:00 2001 From: AnhDuc85 <32938192+AnhDuc85@users.noreply.github.com> Date: Tue, 9 Oct 2018 20:48:36 +0200 Subject: [PATCH 294/676] add support for Osram Outdoor Lantern W RGBW OSRAM (#95) * add support for Osram Outdoor Lantern W RGBW OSRAM * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index f9dda1ccb0461..142db95f7e32f 100644 --- a/devices.js +++ b/devices.js @@ -746,6 +746,15 @@ const devices = [ }, // OSRAM + { + zigbeeModel: ['Outdoor Lantern W RGBW OSRAM'], + model: '4058075816718', + vendor: 'OSRAM', + description: 'SMART+ outdoor wall lantern RGBW', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['Classic A60 RGBW'], model: 'AA69697', From 3e10947e29334703422741107cc46bd4c8c8479d Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 9 Oct 2018 20:48:56 +0200 Subject: [PATCH 295/676] 4.0.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b66e4ec85be35..293ed2b654e49 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.2", + "version": "4.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6299461ac38fb..6bda5c8de9ba8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.2", + "version": "4.0.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 92afbbbd483ba0f548ce896e9924457a0303cc5f Mon Sep 17 00:00:00 2001 From: Andre Volmensky Date: Fri, 12 Oct 2018 17:43:25 +0900 Subject: [PATCH 296/676] Added support for Philips Hue LTW001 (#96) * Added support for Philips Hue LTW001 * Changed description of LTW001 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 142db95f7e32f..d3dc8eddce4b6 100644 --- a/devices.js +++ b/devices.js @@ -583,7 +583,7 @@ const devices = [ zigbeeModel: ['LTW010', 'LTW001', 'LTW004'], model: '8718696548738', vendor: 'Philips', - description: 'Hue white ambiance E27', + description: 'Hue white ambiance E26/E27', supports: generic.light_onoff_brightness_colortemp().supports, fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, From 8e7683b399ca8a19e3423c347f8a0949554792e5 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 15 Oct 2018 17:55:42 +0200 Subject: [PATCH 297/676] Fix occupancy reported on interval report (for Hue motion sensor). https://github.com/Koenkk/zigbee2mqtt/issues/467 --- converters/fromZigbee.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 2448a0ec3d86a..380cc5c791420 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -364,6 +364,12 @@ const converters = { cid: 'msOccupancySensing', type: 'attReport', convert: (model, msg, publish, options) => { + if (msg.data.occupancy !== 1) { + // In case of 0 no occupancy is reported. + // https://github.com/Koenkk/zigbee2mqtt/issues/467 + return; + } + // The occupancy sensor only sends a message when motion detected. // Therefore we need to publish the no_motion detected by ourselves. const useOptionsTimeout = options && options.hasOwnProperty('occupancy_timeout'); From fb76937280158265f67fae1b4e9fbbda01b3c3ee Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 15 Oct 2018 17:56:09 +0200 Subject: [PATCH 298/676] 4.0.4 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 293ed2b654e49..b33a80a66764d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.3", + "version": "4.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6bda5c8de9ba8..8deff5c192dc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.3", + "version": "4.0.4", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From d543742b3fa4e2bad137c2bac645255c3f4af09c Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 15 Oct 2018 19:01:40 +0200 Subject: [PATCH 299/676] Fix #cb2a4ab99a9028c0ff68dcc90b6372f7bb410561 --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 380cc5c791420..84a07043b6918 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -364,7 +364,7 @@ const converters = { cid: 'msOccupancySensing', type: 'attReport', convert: (model, msg, publish, options) => { - if (msg.data.occupancy !== 1) { + if (msg.data.data.occupancy !== 1) { // In case of 0 no occupancy is reported. // https://github.com/Koenkk/zigbee2mqtt/issues/467 return; From b5f511d4fe2caedb1ed85f98bf76d4544907ad30 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 15 Oct 2018 19:03:02 +0200 Subject: [PATCH 300/676] 4.0.5 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b33a80a66764d..87873ba522304 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.4", + "version": "4.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8deff5c192dc9..c0ff441db6089 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.4", + "version": "4.0.5", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From a492e9710730c3f50d50b0835965b607336c1edc Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 15 Oct 2018 19:12:30 +0200 Subject: [PATCH 301/676] Lumi.remote.b186acn01 https://github.com/Koenkk/zigbee2mqtt/issues/455 (#97) * WIP: support for new WXKG03LM. https://github.com/Koenkk/zigbee2mqtt/issues/455 * Update --- converters/fromZigbee.js | 2 +- devices.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 84a07043b6918..3527efa957eec 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -338,7 +338,7 @@ const converters = { return lookup[value] ? lookup[value] : null; }, }, - WXKG11LM_action_click_multistate: { + xiaomi_action_click_multistate: { cid: 'genMultistateInput', type: 'attReport', convert: (model, msg, publish, options) => { diff --git a/devices.js b/devices.js index d3dc8eddce4b6..609e0be781a3b 100644 --- a/devices.js +++ b/devices.js @@ -86,7 +86,7 @@ const devices = [ supports: 'single, double click (and triple, quadruple, hold, release depending on model)', fromZigbee: [ fz.xiaomi_battery_3v, fz.WXKG11LM_click, fz.ignore_onoff_change, fz.ignore_basic_change, - fz.WXKG11LM_action_click_multistate, fz.ignore_multistate_change, + fz.xiaomi_action_click_multistate, fz.ignore_multistate_change, ], toZigbee: [], }, @@ -103,12 +103,15 @@ const devices = [ toZigbee: [], }, { - zigbeeModel: ['lumi.sensor_86sw1\u0000lu'], + zigbeeModel: ['lumi.sensor_86sw1\u0000lu', 'lumi.remote.b186acn01\u0000\u0000\u0000'], model: 'WXKG03LM', vendor: 'Xiaomi', description: 'Aqara single key wireless wall switch', supports: 'single click', - fromZigbee: [fz.xiaomi_battery_3v, fz.WXKG03LM_click, fz.ignore_basic_change], + fromZigbee: [ + fz.xiaomi_battery_3v, fz.WXKG03LM_click, fz.ignore_basic_change, + fz.xiaomi_action_click_multistate, fz.ignore_multistate_change, + ], toZigbee: [], }, { From 76fc2ac8e2e58a420220aded8dd84863e7defeb1 Mon Sep 17 00:00:00 2001 From: FutureCow Date: Tue, 16 Oct 2018 17:48:47 +0200 Subject: [PATCH 302/676] Add Innr RS 128 T (#98) * Update devices.js Add Innr RS 128 T GU10 Light Spot(On/Off, Dimmable, White spectrum) * Lint --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 609e0be781a3b..91bbc0b4ca5a0 100644 --- a/devices.js +++ b/devices.js @@ -918,6 +918,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['RS 128 T'], + model: 'RS 128 T', + vendor: 'Innr', + description: 'GU10 Spot 350 lm, dimmable, white spectrum', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['RB 145'], model: 'RB 145', From 188fd60ecb3ebf6dcedc274ae8ba6b6eb16c54ed Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 17 Oct 2018 18:23:11 +0200 Subject: [PATCH 303/676] Support BY 265. https://github.com/Koenkk/zigbee2mqtt/issues/204 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 91bbc0b4ca5a0..5f147ffc093d5 100644 --- a/devices.js +++ b/devices.js @@ -937,7 +937,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness().toZigbee, }, { - zigbeeModel: ['BY 165'], + zigbeeModel: ['BY 165', 'BY 265'], model: 'BY 165', vendor: 'Innr', description: 'B22 Bulb dimmable', From f32738592f335234446517daaa47c1637b5b9c11 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Wed, 17 Oct 2018 17:25:01 +0100 Subject: [PATCH 304/676] Add Philips Hue white ambiance E14 (LTW012) (#100) Adds support for LTW012 devices - See info page at https://www2.meethue.com/en-gb/p/hue-white-ambiance-single-bulb-e14/8718696695203 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 5f147ffc093d5..722db0320e3b8 100644 --- a/devices.js +++ b/devices.js @@ -573,6 +573,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['LTW012'], + model: '8718696695203', + vendor: 'Philips', + description: 'Hue white ambiance E14', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['LTW013'], model: '8718696598283', From b2bbaefae400fec5d4777bafd05c2d0062eb1712 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 17 Oct 2018 21:02:19 +0200 Subject: [PATCH 305/676] 4.0.6 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 87873ba522304..512b326ff205b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.5", + "version": "4.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c0ff441db6089..621ed7c0e3598 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.5", + "version": "4.0.6", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 01600978e8cd5e654438b5692480e91f2e48cc9a Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Fri, 19 Oct 2018 22:04:55 +0200 Subject: [PATCH 306/676] OSRAM Gardenpole RGBW (#99) * Added device OSRAM Surface Light TW * LIGHTIFY Indoor Flex RGBW * Lint * Gardenpole RGBW-Lightify * Gardenpole RGBW-Lightify Stripe * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 722db0320e3b8..49661c1ab8362 100644 --- a/devices.js +++ b/devices.js @@ -868,6 +868,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['Gardenpole RGBW-Lightify'], + model: '4058075036147', + vendor: 'OSRAM', + description: 'Smart+ Gardenpole RGBW', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['PAR 16 50 RGBW - LIGHTIFY'], model: 'AB35996', From 9e18ab1125d2e2072be08bec3014254275ab5820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Fri, 19 Oct 2018 23:15:52 +0300 Subject: [PATCH 307/676] Zigbee OnOff Controller (#101) * Xiaomi Vima Smart Lock (lumi.lock.v1) * Update A6121 * Zigbee OnOff Controller * code style --- devices.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/devices.js b/devices.js index 49661c1ab8362..dcfe96bf7abd3 100644 --- a/devices.js +++ b/devices.js @@ -1336,6 +1336,18 @@ const devices = [ execute(device, actions, callback); }, }, + + // ksentry + { + zigbeeModel: ['Lamp_01'], + model: 'KS-SM001', + vendor: 'Ksentry Electronics', + description: '[Zigbee OnOff Controller](http://ksentry.manufacturer.globalsources.com/si/6008837134660'+ + '/pdtl/ZigBee-module/1162731630/zigbee-on-off-controller-modules.htm)', + supports: 'on/off', + fromZigbee: [fz.generic_state], + toZigbee: [tz.onoff], + }, ]; module.exports = devices; From 105ae75543e61cf6862375768976b81926b08387 Mon Sep 17 00:00:00 2001 From: dcshoes23 Date: Fri, 19 Oct 2018 16:19:57 -0400 Subject: [PATCH 308/676] Add support for Commerical Electric LED potlight 4" (#102) --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index dcfe96bf7abd3..42760af40d532 100644 --- a/devices.js +++ b/devices.js @@ -1348,6 +1348,17 @@ const devices = [ fromZigbee: [fz.generic_state], toZigbee: [tz.onoff], }, + + // Commercial Electric + { + zigbeeModel: ['Zigbee CCT Downlight'], + model: '53170161', + vendor: 'Commercial Electric', + description: 'Matte White Recessed Retrofit Smart Led Downlight - 4 Inch', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, ]; module.exports = devices; From 17170431767bcaa3755b354653d79057ef41435f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 19 Oct 2018 22:21:53 +0200 Subject: [PATCH 309/676] 4.0.7 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 512b326ff205b..72aa62b7de577 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.6", + "version": "4.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 621ed7c0e3598..e136be93e93b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.6", + "version": "4.0.7", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 9e1778b28d8d2ddd0c855c94e143b01cb4a26a0e Mon Sep 17 00:00:00 2001 From: johnnyletrois Date: Sun, 21 Oct 2018 12:06:13 -0700 Subject: [PATCH 310/676] Add support for LED1624G9 E26 version Ikea Tradfri LED1624G9 E26 version is not supported --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 42760af40d532..55cf1a8d99092 100644 --- a/devices.js +++ b/devices.js @@ -392,10 +392,10 @@ const devices = [ toZigbee: generic.light_onoff_brightness().toZigbee, }, { - zigbeeModel: ['TRADFRI bulb E27 CWS opal 600lm'], + zigbeeModel: ['TRADFRI bulb E27 CWS opal 600lm', 'TRADFRI bulb E26 CWS opal 600lm'], model: 'LED1624G9', vendor: 'IKEA', - description: 'TRADFRI LED bulb E27 600 lumen, dimmable, color, opal white', + description: 'TRADFRI LED bulb E27/E26 600 lumen, dimmable, color, opal white', supports: generic.light_onoff_brightness_colorxy().supports, fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, From 85c8cde096abaaa26f4ad47efd144e08ebe50cbc Mon Sep 17 00:00:00 2001 From: mmnpkf Date: Thu, 25 Oct 2018 00:13:05 +1000 Subject: [PATCH 311/676] Add Nue Double GPO (au version) (#103) * Update to add Nue Double Power Outlet (au version) * Add New Double Power Outlet (au version) * Update fromZigbee.js * Update devices.js * Update devices.js * Update devices.js * Update devices.js * Update devices.js * Trying to fix Zigbee Model Number * Fixed Zigbee Model Number * Update nue_power_state * Lint --- converters/fromZigbee.js | 12 ++++++++++++ devices.js | 10 ++++++++++ 2 files changed, 22 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3527efa957eec..1fa94eb638dd1 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -873,6 +873,18 @@ const converters = { return {power: msg.data.data['activePower'] / 10.0}; }, }, + nue_power_state: { + cid: 'genOnOff', + type: 'attReport', + convert: (model, msg, publish, options) => { + const button = getKey(model.ep, msg.endpoints[0].epId); + if (button) { + const payload = {}; + payload[`state_${button}`] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; + return payload; + } + }, + }, // Ignore converters (these message dont need parsing). ignore_doorlock_change: { diff --git a/devices.js b/devices.js index 55cf1a8d99092..9172ef0766aa8 100644 --- a/devices.js +++ b/devices.js @@ -1252,6 +1252,16 @@ const devices = [ fromZigbee: [fz.generic_state], toZigbee: [tz.onoff], }, + { + zigbeeModel: ['FNB56-SKT1DHG1.4'], + model: 'MG-AUWS01', + vendor: 'Nue', + description: 'ZigBee Double GPO', + supports: 'on/off', + fromZigbee: [fz.nue_power_state, fz.ignore_onoff_change], + toZigbee: [tz.onoff], + ep: {'left': 12, 'right': 11}, + }, // Gledopto { From 3365dc6de982be4e3bce4366b0d32271ff69e3d0 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Wed, 24 Oct 2018 21:17:21 +0200 Subject: [PATCH 312/676] added genBasic to xiaomi_contact (#108) * added genBasic for xiaomi_contact https://github.com/Koenkk/zigbee2mqtt/issues/526 * Update fromZigbee.js * Update devices.js * Update devices.js * Update devices.js reduced maximum line length 231, 241 * Update devices.js * Update devices.js * Update fromZigbee.js * Update fromZigbee.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 7 +++++++ devices.js | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 1fa94eb638dd1..adaf69f5b562f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -399,6 +399,13 @@ const converters = { return {contact: msg.data.data['onOff'] === 0}; }, }, + xiaomi_contact_interval: { + cid: 'genBasic', + type: 'attReport', + convert: (model, msg, publish, options) => { + return {contact: msg.data.data['65281']['100'] === 0}; + }, + }, light_state: { cid: 'genOnOff', type: 'devChange', diff --git a/devices.js b/devices.js index 9172ef0766aa8..ff7907bc14ff5 100644 --- a/devices.js +++ b/devices.js @@ -228,7 +228,10 @@ const devices = [ vendor: 'Xiaomi', description: 'MiJia door & window contact sensor', supports: 'contact', - fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.ignore_onoff_change, fz.ignore_basic_change], + fromZigbee: [ + fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.xiaomi_contact_interval, fz.ignore_onoff_change, + fz.ignore_basic_change, + ], toZigbee: [], }, { @@ -237,7 +240,10 @@ const devices = [ vendor: 'Xiaomi', description: 'Aqara door & window contact sensor', supports: 'contact', - fromZigbee: [fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.ignore_onoff_change, fz.ignore_basic_change], + fromZigbee: [ + fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.xiaomi_contact_interval, fz.ignore_onoff_change, + fz.ignore_basic_change, + ], toZigbee: [], }, { From cec77e8b96abf6dfb86dd4c720de99c9da497010 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Thu, 25 Oct 2018 19:54:59 +0200 Subject: [PATCH 313/676] Remove SJCGQ11LM water leak basic (always reports true) (#109) * Added device OSRAM Surface Light TW * LIGHTIFY Indoor Flex RGBW * Lint * Gardenpole RGBW-Lightify * Gardenpole RGBW-Lightify Stripe * Update devices.js * hue LTW012 * water_leak -> water_leak_rep * Update fromZigbee.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 7 ------- devices.js | 5 +---- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index adaf69f5b562f..c77b06c0f4892 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -511,13 +511,6 @@ const converters = { return {click: 'single'}; }, }, - SJCGQ11LM_water_leak_basic: { - cid: 'genBasic', - type: 'attReport', - convert: (model, msg, publish, options) => { - return {water_leak: msg.data.data['65281']['100'] === 1}; - }, - }, SJCGQ11LM_water_leak_iaszone: { cid: 'ssIasZone', type: 'statusChange', diff --git a/devices.js b/devices.js index ff7907bc14ff5..77d237a8443be 100644 --- a/devices.js +++ b/devices.js @@ -252,10 +252,7 @@ const devices = [ vendor: 'Xiaomi', description: 'Aqara water leak sensor', supports: 'water leak true/false', - fromZigbee: [ - fz.xiaomi_battery_3v, fz.SJCGQ11LM_water_leak_basic, fz.SJCGQ11LM_water_leak_iaszone, - fz.ignore_basic_change, - ], + fromZigbee: [fz.xiaomi_battery_3v, fz.SJCGQ11LM_water_leak_iaszone, fz.ignore_basic_change], toZigbee: [], }, { From 8a5d3d1c422ee20b90a05fe8e1fa55f7cd0a7dd9 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 25 Oct 2018 19:58:40 +0200 Subject: [PATCH 314/676] Support 74696. https://github.com/Koenkk/zigbee-shepherd-converters/pull/110 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 77d237a8443be..47396fc7f84b0 100644 --- a/devices.js +++ b/devices.js @@ -1113,6 +1113,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['A19 W 10 year'], + model: '74696', + vendor: 'Sylvania', + description: 'Smart+ A19 dimmable soft white bulb', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, // GE { From 679317f601e470e3ef76de5bd870551f84aee2f1 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 25 Oct 2018 19:59:17 +0200 Subject: [PATCH 315/676] 4.0.8 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 72aa62b7de577..59a831063dc32 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.7", + "version": "4.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e136be93e93b6..249b4802390c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.7", + "version": "4.0.8", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 090512fd4b8b285cc460be92e6dacae468e3d1b9 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 25 Oct 2018 20:22:38 +0200 Subject: [PATCH 316/676] Revert "Support 74696. https://github.com/Koenkk/zigbee-shepherd-converters/pull/110" This reverts commit 6ba6dcdacd98eb9b07d0a09ee6dd3b2e25bec345. --- devices.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/devices.js b/devices.js index 47396fc7f84b0..77d237a8443be 100644 --- a/devices.js +++ b/devices.js @@ -1113,15 +1113,6 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, - { - zigbeeModel: ['A19 W 10 year'], - model: '74696', - vendor: 'Sylvania', - description: 'Smart+ A19 dimmable soft white bulb', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, - }, // GE { From 3d15eb87b6c7ed2fd2e16a8c27f9cb7c79f60c17 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 25 Oct 2018 20:28:41 +0200 Subject: [PATCH 317/676] 4.0.9 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 59a831063dc32..1f5dd21bc60d3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.8", + "version": "4.0.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 249b4802390c9..7ae4c1b2fa5a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.8", + "version": "4.0.9", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From d833c15a93fe19f179a263232ac28df0297a52aa Mon Sep 17 00:00:00 2001 From: modmax Date: Fri, 26 Oct 2018 16:58:52 +0200 Subject: [PATCH 318/676] Fixes issue #111 (#112) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 77d237a8443be..6c940719d44f9 100644 --- a/devices.js +++ b/devices.js @@ -229,7 +229,7 @@ const devices = [ description: 'MiJia door & window contact sensor', supports: 'contact', fromZigbee: [ - fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.xiaomi_contact_interval, fz.ignore_onoff_change, + fz.xiaomi_battery_3v, fz.xiaomi_contact, fz.ignore_onoff_change, fz.ignore_basic_change, ], toZigbee: [], From 9f854ccc964a0b7f3f0bbd0c693cdd49ebcf828c Mon Sep 17 00:00:00 2001 From: koebbe Date: Mon, 29 Oct 2018 15:10:20 -0500 Subject: [PATCH 319/676] Add Hue model LCT002 (#114) --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 6c940719d44f9..78f6166701ed9 100644 --- a/devices.js +++ b/devices.js @@ -567,6 +567,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['LCT002'], + model: '9290002579A', + vendor: 'Philips', + description: 'Hue white and color ambiance BR30', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['LCT003'], model: '8718696485880', From 27e73481e325ed7362641a9f4856215896764af9 Mon Sep 17 00:00:00 2001 From: mmnpkf Date: Tue, 30 Oct 2018 06:11:21 +1000 Subject: [PATCH 320/676] Add Sengled Element Classic (A60) - B22 fitting (#115) * Add Sengled Element Classic (A60) - B22 fitting The Sengled Element Classic with Edison fitting (E27) is already defined - model E11-G23. The same bulb comes with a bayonet fitting (B22) with a slightly different model number - E11-G33. * Update devices.js --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 78f6166701ed9..960a0d30c8d6a 100644 --- a/devices.js +++ b/devices.js @@ -1183,8 +1183,8 @@ const devices = [ toZigbee: generic.light_onoff_brightness().toZigbee, }, { - zigbeeModel: ['E11-G23'], - model: 'E11-G23', + zigbeeModel: ['E11-G23', 'E11-G33'], + model: 'E11-G23/E11-G33', vendor: 'Sengled', description: 'Element Classic (A60)', supports: generic.light_onoff_brightness().supports, From 35bdf4eaed789c51be4e617bcd8d2766bf4c2f49 Mon Sep 17 00:00:00 2001 From: EagleAdam <44459480+EagleAdam@users.noreply.github.com> Date: Mon, 29 Oct 2018 21:27:22 +0100 Subject: [PATCH 321/676] Issue 156 - Centralite Plug (#117) * Update devices.js with Centralite Swiss Plug * Update fromZigbee.js Added Centralite Swiss Plug * Update devices.js * Update fromZigbee.js * Update fromZigbee.js * Update devices.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 11 +++++++++++ devices.js | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index c77b06c0f4892..cf404cc74d865 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -885,6 +885,17 @@ const converters = { } }, }, + RZHAC_4256251_power: { + cid: 'haElectricalMeasurement', + type: 'attReport', + convert: (model, msg, publish, options) => { + return { + power: msg.data.data['activePower'], + current: msg.data.data['rmsCurrent'], + voltage: msg.data.data['rmsVoltage'], + }; + }, + }, // Ignore converters (these message dont need parsing). ignore_doorlock_change: { diff --git a/devices.js b/devices.js index 960a0d30c8d6a..337817aa38bdc 100644 --- a/devices.js +++ b/devices.js @@ -1381,6 +1381,30 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + + // Centralite Swiss Plug + { + zigbeeModel: ['4256251-RZHAC'], + model: '4256251-RZHAC', + vendor: 'Centralite', + description: 'White Swiss power outlet switch with power meter', + supports: 'switch and power meter', + fromZigbee: [fz.ignore_onoff_change, fz.generic_state, fz.ignore_electrical_change, fz.RZHAC_4256251_power], + toZigbee: [tz.onoff], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + (cb) => device.report('haElectricalMeasurement', 'rmsVoltage', 10, 1000, 1, cb), + (cb) => device.report('haElectricalMeasurement', 'rmsCurrent', 10, 1000, 1, cb), + (cb) => device.report('haElectricalMeasurement', 'activePower', 10, 1000, 1, cb), + ]; + + execute(device, actions, callback); + }, + }, ]; module.exports = devices; From 4b62e58dd06d1a103f8e2c9cb515732cdc61a970 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 29 Oct 2018 21:28:53 +0100 Subject: [PATCH 322/676] 4.0.10 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 1f5dd21bc60d3..6a5d358e0860f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.9", + "version": "4.0.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7ae4c1b2fa5a7..2725e75e7a40a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.9", + "version": "4.0.10", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 17c554717df791b6ce5dc95df98e7c9b2a9f083d Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 30 Oct 2018 20:08:58 +0100 Subject: [PATCH 323/676] Add Samsung SmartThings Arrival Sensor support (#118) * Support F-ARR-US-2. https://github.com/Koenkk/zigbee2mqtt/issues/459 * STS-PRS-251 report battery. https://github.com/Koenkk/zigbee2mqtt/issues/459 * Update STS_PRS_251. https://github.com/Koenkk/zigbee2mqtt/issues/459 * Update. https://github.com/Koenkk/zigbee2mqtt/issues/459 * Update fromZigbee.js * Update fromZigbee.js --- converters/fromZigbee.js | 52 ++++++++++++++++++++++++++++++++++++++++ converters/toZigbee.js | 18 ++++++++++++++ devices.js | 18 ++++++++++++++ 3 files changed, 88 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index cf404cc74d865..9baeea22c6432 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -82,6 +82,17 @@ const precisionRound = (number, precision) => { return Math.round(number * factor) / factor; }; +const toPercentage = (value, min, max) => { + if (value > max) { + value = max; + } else if (value < min) { + value = min; + } + + const normalised = (value - min) / (max - min); + return (normalised * 100).toFixed(2); +}; + const numberWithinRange = (number, min, max) => { if (number > max) { return max; @@ -781,6 +792,47 @@ const converters = { }; }, }, + STS_PRS_251_presence: { + cid: 'genBinaryInput', + type: 'attReport', + convert: (model, msg, publish, options) => { + const useOptionsTimeout = options && options.hasOwnProperty('presence_timeout'); + const timeout = useOptionsTimeout ? options.presence_timeout : 100; // 100 seconds by default + const deviceID = msg.endpoints[0].device.ieeeAddr; + + // Stop existing timer because presence is detected and set a new one. + if (store.hasOwnProperty(deviceID)) { + clearTimeout(store[deviceID]); + store[deviceID] = null; + } + + store[deviceID] = setTimeout(() => { + publish({presence: false}); + store[deviceID] = null; + }, timeout * 1000); + + return {presence: true}; + }, + }, + STS_PRS_251_battery: { + cid: 'genPowerCfg', + type: 'attReport', + convert: (model, msg, publish, options) => { + const battery = {max: 3000, min: 2500}; + const voltage = msg.data.data['batteryVoltage'] * 100; + return { + battery: toPercentage(voltage, battery.min, battery.max), + voltage: voltage, + }; + }, + }, + STS_PRS_251_beeping: { + cid: 'genIdentify', + type: 'devChange', + convert: (model, msg, publish, options) => { + return {action: 'beeping'}; + }, + }, _324131092621_on: { cid: 'genOnOff', type: 'cmdOn', diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 3fe774d86c39e..1f9d219dd4a29 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -222,6 +222,24 @@ const converters = { }; }, }, + STS_PRS_251_beep: { + key: 'beep', + attr: ['identifyTime'], + convert: (value, message) => { + return { + cid: 'genIdentify', + cmd: 'identify', + type: 'functional', + zclData: { + identifytime: value, + }, + cfg: { + manufSpec: 0, + disDefaultRsp: 0, + }, + }; + }, + }, // Ignore converters ignore_transition: { key: 'transition', diff --git a/devices.js b/devices.js index 337817aa38bdc..4cd74eaeb38e9 100644 --- a/devices.js +++ b/devices.js @@ -1296,6 +1296,24 @@ const devices = [ fromZigbee: [fz.smartthings_contact], toZigbee: [], }, + { + zigbeeModel: ['tagv4'], + model: 'STS-PRS-251', + vendor: 'SmartThings', + description: 'SmartThings arrival sensor', + supports: 'presence', + fromZigbee: [fz.STS_PRS_251_presence, fz.STS_PRS_251_battery, fz.ignore_power_change, fz.STS_PRS_251_beeping], + toZigbee: [tz.STS_PRS_251_beep], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.report('genBinaryInput', 'presentValue', 10, 30, 1, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 3600), + ]; + + execute(device, actions, callback); + }, + }, // Trust { From b2cd2d30d3b286ecb98660694cff252cac0c3472 Mon Sep 17 00:00:00 2001 From: alex-voigt Date: Wed, 31 Oct 2018 16:58:52 +0100 Subject: [PATCH 324/676] Fix battery level type (#119) --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 9baeea22c6432..6845cdab84efd 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -207,7 +207,7 @@ const converters = { for (let i = 0; i < voltageMap.length; i++) { if (voltageMap[i][0] > voltage) { return { - battery: voltageMap[i][1].toFixed(2), + battery: parseFloat(voltageMap[i][1].toFixed(2)), voltage: voltage, }; } From 8909f1e829bbc2dd20ecc684e936f6543a2eea6e Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 31 Oct 2018 16:59:40 +0100 Subject: [PATCH 325/676] 4.0.11 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6a5d358e0860f..e60a47436a553 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.10", + "version": "4.0.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2725e75e7a40a..1095fac5362b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.10", + "version": "4.0.11", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 97415f69f153e751e3c4911d74e8bc1a21c34146 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 31 Oct 2018 17:17:40 +0100 Subject: [PATCH 326/676] Support TRADFRI bulb E27 WS\uFFFDopal 980lm. https://github.com/Koenkk/zigbee2mqtt/issues/513 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 4cd74eaeb38e9..fe8ea5dc1bb8b 100644 --- a/devices.js +++ b/devices.js @@ -332,7 +332,7 @@ const devices = [ // IKEA { - zigbeeModel: ['TRADFRI bulb E27 WS opal 980lm', 'TRADFRI bulb E26 WS opal 980lm'], + zigbeeModel: ['TRADFRI bulb E27 WS opal 980lm', 'TRADFRI bulb E26 WS opal 980lm', 'TRADFRI bulb E27 WS\uFFFDopal 980lm'], model: 'LED1545G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white', From 2a793d9f1d01aa5670c76e92731dd75a02505806 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 31 Oct 2018 17:29:48 +0100 Subject: [PATCH 327/676] Lint --- devices.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index fe8ea5dc1bb8b..cc5dc36b3a29b 100644 --- a/devices.js +++ b/devices.js @@ -332,7 +332,10 @@ const devices = [ // IKEA { - zigbeeModel: ['TRADFRI bulb E27 WS opal 980lm', 'TRADFRI bulb E26 WS opal 980lm', 'TRADFRI bulb E27 WS\uFFFDopal 980lm'], + zigbeeModel: [ + 'TRADFRI bulb E27 WS opal 980lm', 'TRADFRI bulb E26 WS opal 980lm', + 'TRADFRI bulb E27 WS\uFFFDopal 980lm', + ], model: 'LED1545G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white', From 1f0c4d81147ac920a0304835547277c090c14f55 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 5 Nov 2018 21:32:46 +0100 Subject: [PATCH 328/676] Prepare for read commands. https://github.com/Koenkk/zigbee2mqtt/issues/518 --- converters/toZigbee.js | 400 +++++++++++---------- converters/utils.js | 38 ++ devices.js | 52 +-- npm-shrinkwrap.json | 797 ++++++++++++++++++----------------------- package.json | 3 +- test/verify.js | 4 +- 6 files changed, 628 insertions(+), 666 deletions(-) create mode 100644 converters/utils.js diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 1f9d219dd4a29..2ea901ef1a7c0 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,188 +1,198 @@ 'use strict'; -/** - * From: https://github.com/usolved/cie-rgb-converter/blob/master/cie_rgb_converter.js - * Converts RGB color space to CIE color space - * @param {Number} red - * @param {Number} green - * @param {Number} blue - * @return {Array} Array that contains the CIE color values for x and y - */ -function rgbToXY(red, green, blue) { - // Apply a gamma correction to the RGB values, which makes the color - // more vivid and more the like the color displayed on the screen of your device - red = (red > 0.04045) ? Math.pow((red + 0.055) / (1.0 + 0.055), 2.4) : (red / 12.92); - green = (green > 0.04045) ? Math.pow((green + 0.055) / (1.0 + 0.055), 2.4) : (green / 12.92); - blue = (blue > 0.04045) ? Math.pow((blue + 0.055) / (1.0 + 0.055), 2.4) : (blue / 12.92); +const utils = require('./utils'); +const zclId = require('zcl-id'); - // RGB values to XYZ using the Wide RGB D65 conversion formula - const X = red * 0.664511 + green * 0.154324 + blue * 0.162028; - const Y = red * 0.283881 + green * 0.668433 + blue * 0.047685; - const Z = red * 0.000088 + green * 0.072310 + blue * 0.986039; - - // Calculate the xy values from the XYZ values - let x = (X / (X + Y + Z)).toFixed(4); - let y = (Y / (X + Y + Z)).toFixed(4); - - if (isNaN(x)) { - x = 0; - } - - if (isNaN(y)) { - y = 0; - } - - return {x: Number.parseFloat(x), y: Number.parseFloat(y)}; -} - -const JTQJBF01LMBWConfig = { - manufSpec: 1, - disDefaultRsp: 1, - manufCode: 0x115F, +const cfg = { + default: { + manufSpec: 0, + disDefaultRsp: 0, + }, + xiaomi: { + manufSpec: 1, + disDefaultRsp: 1, + manufCode: 0x115F, + }, }; const converters = { factory_reset: { key: 'reset', - attr: [], - convert: (value, message) => { - return { - cid: 'genBasic', - cmd: 'resetFactDefault', - type: 'functional', - zclData: {}, - cfg: { - manufSpec: 0, - disDefaultRsp: 0, - }, - }; + convert: (value, message, type) => { + if (type === 'set') { + return { + cid: 'genBasic', + cmd: 'resetFactDefault', + cmdType: 'functional', + zclData: {}, + cfg: cfg.default, + }; + } }, }, - onoff: { + on_off: { key: 'state', - attr: ['onOff'], - convert: (value, message) => { - return { - cid: 'genOnOff', - cmd: value.toLowerCase(), - type: 'functional', - zclData: {}, - cfg: { - manufSpec: 0, - disDefaultRsp: 0, - }, - }; + convert: (value, message, type) => { + const cid = 'genOnOff'; + const attrId = 'onOff'; + + if (type === 'set') { + return { + cid: cid, + cmd: value.toLowerCase(), + cmdType: 'functional', + zclData: {}, + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } }, }, light_brightness: { key: 'brightness', - attr: ['currentLevel', 'onOff'], - convert: (value, message) => { - return { - cid: 'genLevelCtrl', - cmd: 'moveToLevelWithOnOff', - type: 'functional', - zclData: { - level: value, - transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, - }, - cfg: { - manufSpec: 0, - disDefaultRsp: 0, - }, - }; + convert: (value, message, type) => { + const cid = 'genLevelCtrl'; + const attrId = 'currentLevel'; + + if (type === 'set') { + return { + cid: cid, + cmd: 'moveToLevelWithOnOff', + cmdType: 'functional', + zclData: { + level: value, + transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, + }, + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } }, }, light_colortemp: { key: 'color_temp', - attr: ['colorTemperature'], - convert: (value, message) => { - return { - cid: 'lightingColorCtrl', - cmd: 'moveToColorTemp', - type: 'functional', - zclData: { - colortemp: value, - transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, - }, - cfg: { - manufSpec: 0, - disDefaultRsp: 0, - }, - }; + convert: (value, message, type) => { + const cid = 'lightingColorCtrl'; + const attrId = 'colorTemperature'; + + if (type === 'set') { + return { + cid: cid, + cmd: 'moveToColorTemp', + cmdType: 'functional', + zclData: { + colortemp: value, + transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, + }, + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } }, }, light_color: { key: 'color', - attr: ['currentX', 'currentY'], - convert: (value, message) => { - // Check if we need to convert from RGB to XY. - if (value.hasOwnProperty('r') && value.hasOwnProperty('g') && value.hasOwnProperty('b')) { - const xy = rgbToXY(value.r, value.g, value.b); - value.x = xy.x; - value.y = xy.y; - } + convert: (value, message, type) => { + const cid = 'lightingColorCtrl'; + + if (type === 'set') { + // Check if we need to convert from RGB to XY. + if (value.hasOwnProperty('r') && value.hasOwnProperty('g') && value.hasOwnProperty('b')) { + const xy = utils.rgbToXY(value.r, value.g, value.b); + value.x = xy.x; + value.y = xy.y; + } - return { - cid: 'lightingColorCtrl', - cmd: 'moveToColor', - type: 'functional', - zclData: { - colorx: value.x * 65535, - colory: value.y * 65535, - transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, - }, - cfg: { - manufSpec: 0, - disDefaultRsp: 0, - }, - }; + return { + cid: cid, + cmd: 'moveToColor', + cmdType: 'functional', + zclData: { + colorx: value.x * 65535, + colory: value.y * 65535, + transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, + }, + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [ + {attrId: zclId.attr(cid, 'currentX').value}, + {attrId: zclId.attr(cid, 'currentY').value}, + ], + cfg: cfg.default, + }; + } }, }, /* Note when send the command to set sensitivity, press button on the device to make it wakeup*/ DJT11LM_vibration_sensitivity: { key: 'sensitivity', - attr: ['level'], - convert: (value, message) => { - const lookup = { - 'low': 0x15, - 'medium': 0x0B, - 'high': 0x01, - }; + convert: (value, message, type) => { + const cid = 'genBasic'; + const attrId = 0xFF0D; + + if (type === 'set') { + const lookup = { + 'low': 0x15, + 'medium': 0x0B, + 'high': 0x01, + }; - return { - cid: 'genBasic', - cmd: 'write', - type: 'foundation', - zclData: { - attrId: 0xFF0D, - dataType: 0x20, - attrData: lookup[value], - }, - cfg: { - manufSpec: 1, - disDefaultRsp: 1, - manufCode: 0x115F, - }, - }; + if (lookup.hasOwnProperty(value)) { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: attrId, + dataType: 0x20, + attrData: lookup[value], + }], + cfg: cfg.xiaomi, + }; + } + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: attrId}], + cfg: cfg.xiaomi, + }; + } }, }, JTQJBF01LMBW_sensitivity: { key: 'sensitivity', - attr: ['sensitivity'], - convert: (value, message) => { - if (value === 'read') { - return { - cid: 'ssIasZone', - cmd: 'read', - type: 'foundation', - zclData: { - attrId: 0xFFF0, // presentValue - dataType: 0x39, // dataType - }, - cfg: JTQJBF01LMBWConfig, - }; - } else { + convert: (value, message, type) => { + const cid = 'ssIasZone'; + + if (type === 'set') { const lookup = { 'low': 0x04010000, 'medium': 0x04020000, @@ -191,60 +201,82 @@ const converters = { if (lookup.hasOwnProperty(value)) { return { - cid: 'ssIasZone', + cid: cid, cmd: 'write', - type: 'foundation', - zclData: { + cmdType: 'foundation', + zclData: [{ attrId: 0xFFF1, // presentValue dataType: 0x23, // dataType attrData: lookup[value], - }, - cfg: JTQJBF01LMBWConfig, + }], + cfg: cfg.xiaomi, }; } + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{ + attrId: 0xFFF0, // presentValue + dataType: 0x39, // dataType + }], + cfg: cfg.xiaomi, + }; } }, }, JTQJBF01LMBW_selfest: { key: 'selftest', - attr: [0xFFF1], - convert: (value, message) => { - return { - cid: 'ssIasZone', - cmd: 'write', - type: 'foundation', - zclData: { - attrId: 0xFFF1, // presentValue - dataType: 0x23, // dataType - attrData: 0x03010000, - }, - cfg: JTQJBF01LMBWConfig, - }; + convert: (value, message, type) => { + if (type === 'set') { + return { + cid: 'ssIasZone', + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: 0xFFF1, // presentValue + dataType: 0x23, // dataType + attrData: 0x03010000, + }], + cfg: cfg.xiaomi, + }; + } }, }, STS_PRS_251_beep: { key: 'beep', - attr: ['identifyTime'], - convert: (value, message) => { - return { - cid: 'genIdentify', - cmd: 'identify', - type: 'functional', - zclData: { - identifytime: value, - }, - cfg: { - manufSpec: 0, - disDefaultRsp: 0, - }, - }; + convert: (value, message, type) => { + const cid = 'genIdentify'; + const attrId = 'identifyTime'; + + if (type === 'set') { + return { + cid: cid, + cmd: 'identify', + cmdType: 'functional', + zclData: { + identifytime: value, + }, + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } }, }, + // Ignore converters ignore_transition: { key: 'transition', attr: [], - convert: (value, message) => null, + convert: (value, message, type) => null, }, }; diff --git a/converters/utils.js b/converters/utils.js new file mode 100644 index 0000000000000..412c012831b0d --- /dev/null +++ b/converters/utils.js @@ -0,0 +1,38 @@ +/** + * From: https://github.com/usolved/cie-rgb-converter/blob/master/cie_rgb_converter.js + * Converts RGB color space to CIE color space + * @param {Number} red + * @param {Number} green + * @param {Number} blue + * @return {Array} Array that contains the CIE color values for x and y + */ +function rgbToXY(red, green, blue) { + // Apply a gamma correction to the RGB values, which makes the color + // more vivid and more the like the color displayed on the screen of your device + red = (red > 0.04045) ? Math.pow((red + 0.055) / (1.0 + 0.055), 2.4) : (red / 12.92); + green = (green > 0.04045) ? Math.pow((green + 0.055) / (1.0 + 0.055), 2.4) : (green / 12.92); + blue = (blue > 0.04045) ? Math.pow((blue + 0.055) / (1.0 + 0.055), 2.4) : (blue / 12.92); + + // RGB values to XYZ using the Wide RGB D65 conversion formula + const X = red * 0.664511 + green * 0.154324 + blue * 0.162028; + const Y = red * 0.283881 + green * 0.668433 + blue * 0.047685; + const Z = red * 0.000088 + green * 0.072310 + blue * 0.986039; + + // Calculate the xy values from the XYZ values + let x = (X / (X + Y + Z)).toFixed(4); + let y = (Y / (X + Y + Z)).toFixed(4); + + if (isNaN(x)) { + x = 0; + } + + if (isNaN(y)) { + y = 0; + } + + return {x: Number.parseFloat(x), y: Number.parseFloat(y)}; +} + +module.exports = { + rgbToXY: rgbToXY, +}; diff --git a/devices.js b/devices.js index cc5dc36b3a29b..07bfbbd9e0c7b 100644 --- a/devices.js +++ b/devices.js @@ -9,28 +9,28 @@ const generic = { return { supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.light_state], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], }; }, light_onoff_brightness_colortemp: () => { return { supports: 'on/off, brightness, color temperature', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], }; }, light_onoff_brightness_colorxy: () => { return { supports: 'on/off, brightness, color xy', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_color, tz.ignore_transition], + toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition], }; }, light_onoff_brightness_colortemp_colorxy: () => { return { supports: 'on/off, brightness, color temperature, color xy', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], - toZigbee: [tz.onoff, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], }; }, }; @@ -136,7 +136,7 @@ const devices = [ fromZigbee: [ fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_basic_report, ], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], ep: {'': 2}, }, { @@ -149,7 +149,7 @@ const devices = [ fz.QBKG04LM_QBKG11LM_state, fz.QBKG11LM_power, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_analog_change, fz.ignore_analog_report, ], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], }, { zigbeeModel: ['lumi.ctrl_neutral2'], @@ -160,7 +160,7 @@ const devices = [ fromZigbee: [ fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons, fz.ignore_basic_change, fz.ignore_basic_report, ], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], ep: {'left': 2, 'right': 3}, }, { @@ -173,7 +173,7 @@ const devices = [ fz.QBKG03LM_QBKG12LM_state, fz.QBKG12LM_power, fz.ignore_analog_change, fz.ignore_basic_change, fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.ignore_analog_report, ], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], ep: {'left': 1, 'right': 2}, }, { @@ -277,7 +277,7 @@ const devices = [ fz.generic_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_analog_change, ], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], }, { zigbeeModel: ['lumi.ctrl_86plug', 'lumi.ctrl_86plug.aq1'], @@ -289,7 +289,7 @@ const devices = [ fz.generic_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_analog_change, ], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], }, { zigbeeModel: ['lumi.sensor_smoke'], @@ -484,7 +484,7 @@ const devices = [ supports: 'on/off', vendor: 'IKEA', fromZigbee: [fz.ignore_onoff_change, fz.generic_state], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; @@ -715,7 +715,7 @@ const devices = [ description: 're:dy plug', supports: 'on/off, power measurement', fromZigbee: [fz.ignore_onoff_change, fz.EDP_power, fz.ignore_metering_change], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 85); execute(device, [(cb) => device.report('seMetering', 'instantaneousDemand', 10, 60, 1, cb)], callback); @@ -739,7 +739,7 @@ const devices = [ description: '[DNCKAT single key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'on/off', fromZigbee: [fz.generic_state, fz.ignore_onoff_change], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], }, { zigbeeModel: ['DNCKAT_S002'], @@ -748,7 +748,7 @@ const devices = [ description: '[DNCKAT double key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'hold/release, on/off', fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], ep: {'left': 1, 'right': 2}, }, { @@ -758,7 +758,7 @@ const devices = [ description: '[DNCKAT triple key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'hold/release, on/off', fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], ep: {'left': 1, 'center': 2, 'right': 3}, }, { @@ -768,7 +768,7 @@ const devices = [ description: '[DNCKAT quadruple key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'hold/release, on/off', fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], ep: {'bottom_left': 1, 'bottom_right': 2, 'top_left': 3, 'top_right': 4}, }, @@ -862,7 +862,7 @@ const devices = [ supports: 'on/off', vendor: 'OSRAM', fromZigbee: [fz.ignore_onoff_change, fz.generic_state], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 3); const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; @@ -1104,7 +1104,7 @@ const devices = [ description: 'SMART+ Smart Plug', supports: 'on/off', fromZigbee: [fz.ignore_onoff_change, fz.generic_state], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; @@ -1143,7 +1143,7 @@ const devices = [ description: 'ZigBee plug-in smart dimmer', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change, fz.generic_state], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], configure: (ieeeAddr, shepherd, coordinator, callback) => { const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; const device = shepherd.find(ieeeAddr, 1); @@ -1162,7 +1162,7 @@ const devices = [ description: 'ZigBee in-wall smart dimmer', supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.ignore_onoff_change, fz.generic_state], - toZigbee: [tz.onoff, tz.light_brightness, tz.ignore_transition], + toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], configure: (ieeeAddr, shepherd, coordinator, callback) => { const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; const device = shepherd.find(ieeeAddr, 1); @@ -1232,7 +1232,7 @@ const devices = [ description: 'Power socket with power consumption monitoring', supports: 'on/off, power measurement', fromZigbee: [fz.generic_state, fz.ignore_onoff_change, fz.ignore_electrical_change, fz.Z809A_power], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const actions = [ @@ -1265,7 +1265,7 @@ const devices = [ description: 'ZigBee one gang smart switch', supports: 'on/off', fromZigbee: [fz.generic_state], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], }, { zigbeeModel: ['FNB56-SKT1DHG1.4'], @@ -1274,7 +1274,7 @@ const devices = [ description: 'ZigBee Double GPO', supports: 'on/off', fromZigbee: [fz.nue_power_state, fz.ignore_onoff_change], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], ep: {'left': 12, 'right': 11}, }, @@ -1369,7 +1369,7 @@ const devices = [ description: 'Smart plug', supports: 'on/off', fromZigbee: [fz.ignore_onoff_change, fz.ignore_electrical_change, fz.generic_state, fz.iris_3210L_power], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const actions = [ @@ -1389,7 +1389,7 @@ const devices = [ '/pdtl/ZigBee-module/1162731630/zigbee-on-off-controller-modules.htm)', supports: 'on/off', fromZigbee: [fz.generic_state], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], }, // Commercial Electric @@ -1411,7 +1411,7 @@ const devices = [ description: 'White Swiss power outlet switch with power meter', supports: 'switch and power meter', fromZigbee: [fz.ignore_onoff_change, fz.generic_state, fz.ignore_electrical_change, fz.RZHAC_4256251_power], - toZigbee: [tz.onoff], + toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e60a47436a553..ce0d6b3f68bf5 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -4,64 +4,70 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "acorn": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", - "dev": true - }, - "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "dev": true, "requires": { - "acorn": "3.3.0" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", - "dev": true - } + "@babel/highlight": "^7.0.0" } }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", "dev": true, "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" } }, - "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "acorn": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", + "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", "dev": true }, + "acorn-jsx": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.0.tgz", + "integrity": "sha512-XkB50fn0MURDyww9+UYL3c1yLbOBz0ZFvrdYlGB8l+Ije1oSC75qAqrzSPjYQbdnQUzhlUGNKuesryAv0gxZOg==", + "dev": true + }, + "ajv": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-escapes": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "dev": true }, "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } }, "argparse": { "version": "1.0.10", @@ -69,7 +75,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "array-union": { @@ -78,7 +84,7 @@ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -93,41 +99,6 @@ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "dev": true, - "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" - }, - "dependencies": { - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - } - } - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -140,15 +111,14 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, - "buffer-from": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", - "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", - "dev": true + "busyman": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/busyman/-/busyman-0.3.0.tgz", + "integrity": "sha1-FN6kn2JgfOSy0wsgPGMG72zKiKc=" }, "caller-path": { "version": "0.1.0", @@ -156,7 +126,7 @@ "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", "dev": true, "requires": { - "callsites": "0.2.0" + "callsites": "^0.2.0" } }, "callsites": { @@ -171,35 +141,15 @@ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "1.9.1" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "3.0.0" - } - } + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "chardet": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", - "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, "circular-json": { @@ -214,7 +164,7 @@ "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, "requires": { - "restore-cursor": "2.0.0" + "restore-cursor": "^2.0.0" } }, "cli-width": { @@ -223,16 +173,10 @@ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, - "co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true - }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" @@ -250,47 +194,31 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "1.0.0", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true - }, "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "lru-cache": "4.1.3", - "shebang-command": "1.2.0", - "which": "1.3.0" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "debounce": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.1.0.tgz", - "integrity": "sha512-ZQVKfRVlwRfD150ndzEK8M90ABT+Y/JQKs4Y7U4MXdpuoUkkrr4DwKbVux3YjylA5bUMUj0Nc3pMxPJX6N2QQQ==" + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz", + "integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg==" }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "deep-is": { @@ -305,13 +233,13 @@ "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", "dev": true, "requires": { - "globby": "5.0.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.1", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "rimraf": "2.6.2" + "globby": "^5.0.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "rimraf": "^2.2.8" } }, "doctrine": { @@ -320,7 +248,15 @@ "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { - "esutils": "2.0.2" + "esutils": "^2.0.2" + } + }, + "enum": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/enum/-/enum-2.5.0.tgz", + "integrity": "sha1-8gW4xlozWorOgIEQXflxsYVouYQ=", + "requires": { + "is-buffer": "^1.1.0" } }, "escape-string-regexp": { @@ -330,67 +266,73 @@ "dev": true }, "eslint": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.8.0.tgz", + "integrity": "sha512-Zok6Bru3y2JprqTNm14mgQ15YQu/SMDkWdnmHfFg770DIUlmMFd/gqqzCHekxzjHZJxXv3tmTpH0C1icaYJsRQ==", "dev": true, "requires": { - "ajv": "5.5.2", - "babel-code-frame": "6.26.0", - "chalk": "2.4.1", - "concat-stream": "1.6.2", - "cross-spawn": "5.1.0", - "debug": "3.1.0", - "doctrine": "2.1.0", - "eslint-scope": "3.7.1", - "eslint-visitor-keys": "1.0.0", - "espree": "3.5.4", - "esquery": "1.0.1", - "esutils": "2.0.2", - "file-entry-cache": "2.0.0", - "functional-red-black-tree": "1.0.1", - "glob": "7.1.2", - "globals": "11.5.0", - "ignore": "3.3.8", - "imurmurhash": "0.1.4", - "inquirer": "3.3.0", - "is-resolvable": "1.1.0", - "js-yaml": "3.11.0", - "json-stable-stringify-without-jsonify": "1.0.1", - "levn": "0.3.0", - "lodash": "4.17.10", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "optionator": "0.8.2", - "path-is-inside": "1.0.2", - "pluralize": "7.0.0", - "progress": "2.0.0", - "regexpp": "1.1.0", - "require-uncached": "1.0.3", - "semver": "5.5.0", - "strip-ansi": "4.0.0", - "strip-json-comments": "2.0.1", - "table": "4.0.2", - "text-table": "0.2.0" + "@babel/code-frame": "^7.0.0", + "ajv": "^6.5.3", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^2.1.0", + "eslint-scope": "^4.0.0", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^4.0.0", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "imurmurhash": "^0.1.4", + "inquirer": "^6.1.0", + "is-resolvable": "^1.1.0", + "js-yaml": "^3.12.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.5", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.0.2", + "text-table": "^0.2.0" } }, "eslint-config-google": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.9.1.tgz", - "integrity": "sha512-5A83D+lH0PA81QMESKbLJd/a3ic8tPZtwUmqNrxMRo54nfFaUvtt89q/+icQ+fd66c2xQHn0KyFkzJDoAUfpZA==", + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.11.0.tgz", + "integrity": "sha512-z541Fs5TFaY7/35v/z100InQ2f3V2J7e3u/0yKrnImgsHjh6JWgSRngfC/mZepn/+XN16jUydt64k//kxXc1fw==", "dev": true }, "eslint-scope": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", - "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", + "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", "dev": true, "requires": { - "esrecurse": "4.2.1", - "estraverse": "4.2.0" + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, "eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", @@ -398,19 +340,20 @@ "dev": true }, "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", + "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", "dev": true, "requires": { - "acorn": "5.5.3", - "acorn-jsx": "3.0.1" + "acorn": "^6.0.2", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" } }, "esprima": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "esquery": { @@ -419,7 +362,7 @@ "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.0.0" } }, "esrecurse": { @@ -428,7 +371,7 @@ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.1.0" } }, "estraverse": { @@ -444,20 +387,20 @@ "dev": true }, "external-editor": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", - "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", "dev": true, "requires": { - "chardet": "0.4.2", - "iconv-lite": "0.4.23", - "tmp": "0.0.33" + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" } }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, "fast-json-stable-stringify": { @@ -478,7 +421,7 @@ "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5" + "escape-string-regexp": "^1.0.5" } }, "file-entry-cache": { @@ -487,8 +430,8 @@ "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", "dev": true, "requires": { - "flat-cache": "1.3.0", - "object-assign": "4.1.1" + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" } }, "flat-cache": { @@ -497,10 +440,10 @@ "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", "dev": true, "requires": { - "circular-json": "0.3.3", - "del": "2.2.2", - "graceful-fs": "4.1.11", - "write": "0.2.1" + "circular-json": "^0.3.1", + "del": "^2.0.2", + "graceful-fs": "^4.1.2", + "write": "^0.2.1" } }, "fs.realpath": { @@ -516,23 +459,23 @@ "dev": true }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "globals": { - "version": "11.5.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", - "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "version": "11.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", + "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==", "dev": true }, "globby": { @@ -541,29 +484,20 @@ "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { - "array-union": "1.0.2", - "arrify": "1.0.1", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "2.1.1" - } - }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -571,18 +505,18 @@ "dev": true }, "iconv-lite": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", - "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": ">= 2.1.2 < 3" } }, "ignore": { - "version": "3.3.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", - "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, "imurmurhash": { @@ -597,8 +531,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -608,27 +542,31 @@ "dev": true }, "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", + "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", "dev": true, "requires": { - "ansi-escapes": "3.1.0", - "chalk": "2.4.1", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "2.2.0", - "figures": "2.0.0", - "lodash": "4.17.10", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.0", + "figures": "^2.0.0", + "lodash": "^4.17.10", "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rx-lite": "4.0.8", - "rx-lite-aggregates": "4.0.8", - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "through": "2.3.8" + "run-async": "^2.2.0", + "rxjs": "^6.1.0", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" } }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -647,7 +585,7 @@ "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { - "is-path-inside": "1.0.1" + "is-path-inside": "^1.0.0" } }, "is-path-inside": { @@ -656,7 +594,7 @@ "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { - "path-is-inside": "1.0.2" + "path-is-inside": "^1.0.1" } }, "is-promise": { @@ -671,12 +609,6 @@ "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -684,25 +616,25 @@ "dev": true }, "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { @@ -717,26 +649,16 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, - "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", - "dev": true, - "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" - } - }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -749,18 +671,18 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { @@ -768,9 +690,9 @@ } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true }, "mute-stream": { @@ -785,6 +707,12 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -797,7 +725,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "onetime": { @@ -806,7 +734,7 @@ "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "optionator": { @@ -815,12 +743,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "os-tmpdir": { @@ -841,9 +769,15 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, "pify": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, @@ -859,7 +793,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "pluralize": { @@ -874,43 +808,22 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, - "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", - "dev": true - }, "progress": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", - "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", + "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", "dev": true }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" - } - }, "regexpp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, "require-uncached": { @@ -919,8 +832,8 @@ "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { - "caller-path": "0.1.0", - "resolve-from": "1.0.1" + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" } }, "resolve-from": { @@ -935,8 +848,8 @@ "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { - "onetime": "2.0.1", - "signal-exit": "3.0.2" + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" } }, "rimraf": { @@ -945,7 +858,7 @@ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "run-async": { @@ -954,30 +867,18 @@ "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "dev": true, "requires": { - "is-promise": "2.1.0" + "is-promise": "^2.1.0" } }, - "rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", - "dev": true - }, - "rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "rxjs": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", + "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", "dev": true, "requires": { - "rx-lite": "4.0.8" + "tslib": "^1.9.0" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -985,9 +886,9 @@ "dev": true }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, "shebang-command": { @@ -996,7 +897,7 @@ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -1017,7 +918,7 @@ "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0" + "is-fullwidth-code-point": "^2.0.0" } }, "sprintf-js": { @@ -1032,17 +933,8 @@ "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -1051,15 +943,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - } + "ansi-regex": "^3.0.0" } }, "strip-json-comments": { @@ -1069,23 +953,24 @@ "dev": true }, "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", + "integrity": "sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg==", "dev": true, "requires": { - "ajv": "5.5.2", - "ajv-keywords": "2.1.1", - "chalk": "2.4.1", - "lodash": "4.17.10", + "ajv": "^6.5.3", + "lodash": "^4.17.10", "slice-ansi": "1.0.0", - "string-width": "2.1.1" + "string-width": "^2.1.1" } }, "text-table": { @@ -1096,7 +981,7 @@ }, "through": { "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, @@ -1106,37 +991,40 @@ "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { - "os-tmpdir": "1.0.2" + "os-tmpdir": "~1.0.2" } }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, "type-check": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } }, "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "wordwrap": { @@ -1157,14 +1045,17 @@ "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", "dev": true, "requires": { - "mkdirp": "0.5.1" + "mkdirp": "^0.5.1" } }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true + "zcl-id": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/zcl-id/-/zcl-id-0.4.0.tgz", + "integrity": "sha512-XN7diHjvF/qQmrs78xURDEpZcw7Y5+R0ScuNwR3X+xfUfJo94Dj9UGkKniSzOATEZWlLZjg/P23y4GwKFRMptA==", + "requires": { + "busyman": "^0.3.0", + "enum": "^2.5.0" + } } } } diff --git a/package.json b/package.json index 1095fac5362b0..9010be7b59bc6 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ }, "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", "dependencies": { - "debounce": "*" + "debounce": "*", + "zcl-id": "*" }, "devDependencies": { "eslint": "*", diff --git a/test/verify.js b/test/verify.js index 2509f6994406f..e5c2205fd5d02 100644 --- a/test/verify.js +++ b/test/verify.js @@ -41,12 +41,12 @@ devices.forEach((device) => { const converter = device.toZigbee[converterKey]; verifyKeys( - ['key', 'convert', 'attr'], + ['key', 'convert'], Object.keys(converter), converterKey, ); - assert.strictEqual(2, converter.convert.length, `${converterKey}: convert() invalid arguments length`); + assert.strictEqual(3, converter.convert.length, `${converterKey}: convert() invalid arguments length`); }); // Check for duplicate zigbee model ids From c78a700fe63ada4a30f42d72d23bc0fff48168cc Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 5 Nov 2018 21:38:12 +0100 Subject: [PATCH 329/676] Lint updates --- .eslintrc.json | 4 +--- converters/fromZigbee.js | 12 +++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 540026c98fa9c..3bf858f497e2e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,9 +4,7 @@ }, "extends": ["eslint:recommended", "google"], "parserOptions": { - "ecmaFeatures": { - "experimentalObjectRestSpread": true - }, + "ecmaVersion": 2018, "sourceType": "module" }, "rules": { diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 6845cdab84efd..06944ef9cf281 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -105,7 +105,7 @@ const numberWithinRange = (number, min, max) => { // get object property name (key) by it's value const getKey = (object, value) => { - for (let key in object) { + for (const key in object) { if (object[key]==value) return key; } }; @@ -707,18 +707,16 @@ const converters = { if (msg.data.data['1288']) { const data = msg.data.data['1288']; - let x; let y; let z; - // array interpretation: // 12 bit two's complement sign extended integer // data[1][bit0..bit15] : x // data[1][bit16..bit31]: y // data[0][bit0..bit15] : z // left shift first to preserve sign extension for 'x' - x = ((data['1'] << 16) >> 16); - y = (data['1'] >> 16); + const x = ((data['1'] << 16) >> 16); + const y = (data['1'] >> 16); // left shift first to preserve sign extension for 'z' - z = ((data['0'] << 16) >> 16); + const z = ((data['0'] << 16) >> 16); // calculate angle result.angle_x = Math.round(Math.atan(x/Math.sqrt(y*y+z*z)) * 180 / Math.PI); @@ -726,7 +724,7 @@ const converters = { result.angle_z = Math.round(Math.atan(z/Math.sqrt(x*x+y*y)) * 180 / Math.PI); // calculate absolulte angle - let R = Math.sqrt(x * x + y * y + z * z); + const R = Math.sqrt(x * x + y * y + z * z); result.angle_x_absolute = Math.round((Math.acos(x / R)) * 180 / Math.PI); result.angle_y_absolute = Math.round((Math.acos(y / R)) * 180 / Math.PI); } From 95b688de9c1dc8359d1dbddf9f30cc85b897149d Mon Sep 17 00:00:00 2001 From: Koenkk Date: Mon, 5 Nov 2018 21:45:38 +0100 Subject: [PATCH 330/676] 5.0.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ce0d6b3f68bf5..d344f875f8846 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.11", + "version": "5.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9010be7b59bc6..01bf64c840c68 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "4.0.11", + "version": "5.0.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From b0a8871f882c2e884ae28cae1eea012a8705091e Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Wed, 7 Nov 2018 11:08:51 +0100 Subject: [PATCH 331/676] =?UTF-8?q?Surface=20Light=20W=20=EF=BF=BDC=20LIGH?= =?UTF-8?q?TIFY=20(#121)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update devices.js * LIGHTIFY Outdoor Flex RGBW * Update devices.js * Update devices.js * Update devices.js * Update devices.js * corr TRADFRI bulb E27 CWS opal 600lm light_onoff_brightness_colortemp_colorxy * Update devices.js * Ceiling TW OSRAM * Update devices.js * RGBW light corr * Update devices.js * Update devices.js * Update devices.js * Update devices.js --- devices.js | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index 07bfbbd9e0c7b..a8706840b1870 100644 --- a/devices.js +++ b/devices.js @@ -402,9 +402,9 @@ const devices = [ model: 'LED1624G9', vendor: 'IKEA', description: 'TRADFRI LED bulb E27/E26 600 lumen, dimmable, color, opal white', - supports: generic.light_onoff_brightness_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { zigbeeModel: ['TRADFRI bulb E14 W op/ch 400lm'], @@ -837,6 +837,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['Ceiling TW OSRAM'], + model: '4058075816794', + vendor: 'OSRAM', + description: 'Smart+ Ceiling TW', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['Classic A60 W clear - LIGHTIFY'], model: 'AC03641', @@ -846,6 +855,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['Surface Light W �C LIGHTIFY'], + model: '4052899926158', + vendor: 'OSRAM', + description: 'LIGHTIFY Surface Light TW', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, { zigbeeModel: ['Surface Light TW'], model: 'AB401130055', @@ -883,6 +901,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['LIGHTIFY Outdoor Flex RGBW'], + model: '4058075036185', + vendor: 'OSRAM', + description: 'Outdoor Flex RGBW', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['Gardenpole RGBW-Lightify'], model: '4058075036147', @@ -1339,6 +1366,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['RGBW light'], + model: '50049', + vendor: 'Paulmann', + description: 'SmartHome Yourled RGB Controller', + supports: generic.light_onoff_brightness_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, + }, // Bitron Home { From f7797a0217e464561ea5e15d154bfc2577472831 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Fri, 9 Nov 2018 08:14:56 +0100 Subject: [PATCH 332/676] Hue White and color ambiance Play Lightbar (#126) * Hue White and color ambiance Play Lightbar * Update devices.js * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index a8706840b1870..4bbad4582829f 100644 --- a/devices.js +++ b/devices.js @@ -588,6 +588,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['LCT024'], + model: '915005733701', + vendor: 'Philips', + description: 'Hue White and color ambiance Play Lightbar', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['LTW012'], model: '8718696695203', From 49c071d02ac741545a1aded51943d34574d670a2 Mon Sep 17 00:00:00 2001 From: blawford Date: Sun, 11 Nov 2018 18:50:54 +0000 Subject: [PATCH 333/676] Support for Innr 285C RGBW bulb (#128) Added support for Innr 285C, tested all functions locally in HomeAssistant (On/Off/Colour/White Temperature) and working with generic functions used by the other Innr RGBW bulb (185C). Bulb is an E27 bulb listed on Amazon UK here - https://www.amazon.co.uk/Innr-Colour-Philips-Assistant-Required/dp/B07GT1LWDH/ref=sr_1_1?ie=UTF8&qid=1541855612&sr=8-1&keywords=innr+285c --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 4bbad4582829f..ce0655be6c59c 100644 --- a/devices.js +++ b/devices.js @@ -960,6 +960,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['RB 285 C'], + model: 'RB 285 C', + vendor: 'Innr', + description: 'E27 Bulb RGBW', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['RB 165'], model: 'RB 165', From ab7de4753744a358cc80da2bc87e5332528a2deb Mon Sep 17 00:00:00 2001 From: Koenkk Date: Sun, 11 Nov 2018 19:54:25 +0100 Subject: [PATCH 334/676] Add generic_state_change. --- converters/fromZigbee.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 06944ef9cf281..3ec45d397c153 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -536,6 +536,13 @@ const converters = { return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; }, }, + generic_state_change: { + cid: 'genOnOff', + type: 'devChange', + convert: (model, msg, publish, options) => { + return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + }, + }, xiaomi_power: { cid: 'genAnalogInput', type: 'attReport', From 2d4bd371fb53ff15d7fd7b03cd78d598cddfa7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Sun, 11 Nov 2018 21:57:02 +0300 Subject: [PATCH 335/676] DevChange event for KS-SM001, not attReport (#123) * DevChange event for KS-SM001, not attReport * Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index ce0655be6c59c..0166d8231b314 100644 --- a/devices.js +++ b/devices.js @@ -1442,7 +1442,7 @@ const devices = [ description: '[Zigbee OnOff Controller](http://ksentry.manufacturer.globalsources.com/si/6008837134660'+ '/pdtl/ZigBee-module/1162731630/zigbee-on-off-controller-modules.htm)', supports: 'on/off', - fromZigbee: [fz.generic_state], + fromZigbee: [fz.generic_state_change], toZigbee: [tz.on_off], }, From 54846b5f0841b54b2a1f1f9c98f0d1b53fdd2e0c Mon Sep 17 00:00:00 2001 From: Merlin Schumacher Date: Mon, 12 Nov 2018 07:00:46 -0800 Subject: [PATCH 336/676] Added support for LTC015 (#129) * Added support for LTC015 Philips Hue White ambiance Aurelle Rectangle Panel Light (https://www.p4c.philips.com/files/3/3216331p5/3216331p5_pss_.pdf) * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 0166d8231b314..26e02f5f7850f 100644 --- a/devices.js +++ b/devices.js @@ -633,6 +633,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + { + zigbeeModel: ['LTC015'], + model: '3216331P5', + vendor: 'Philips', + description: 'Philips Hue White ambiance Aurelle Rectangle Panel Light', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['LLC010'], model: '7199960PH', From 27f9bc37e9dca79eb6448f293248079d45f2b261 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 14 Nov 2018 17:53:02 +0100 Subject: [PATCH 337/676] 5.0.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d344f875f8846..7037d8dc52ed3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "5.0.0", + "version": "5.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 01bf64c840c68..3aef6e730d230 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "5.0.0", + "version": "5.0.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From e98884a433a23aff10454474954253305573f5f2 Mon Sep 17 00:00:00 2001 From: hamstie Date: Thu, 15 Nov 2018 10:24:26 +0100 Subject: [PATCH 338/676] Added Support for Osram SMART+ Candle E14 Dimmable White (#130) * Tested set of: state and brightness --- devices.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 26e02f5f7850f..05cd1d7e638da 100644 --- a/devices.js +++ b/devices.js @@ -946,7 +946,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, - + { + zigbeeModel: ['B40 DIM Z3'], + model: 'AC08562', + vendor: 'OSRAM', + description: 'SMART+ Candle E14 Dimmable White', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, // Hive { From d02a1a6c1826c66dcfb9157e949ea1c55f28390c Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Fri, 16 Nov 2018 14:25:20 -0500 Subject: [PATCH 339/676] include support for E12 400lm * Update devices.js include support for E12 400lm * Update devices.js moved model to existing entry * Update devices.js * Update devices.js * Update devices.js --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 05cd1d7e638da..dd4dbd901bd81 100644 --- a/devices.js +++ b/devices.js @@ -407,10 +407,10 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { - zigbeeModel: ['TRADFRI bulb E14 W op/ch 400lm'], + zigbeeModel: ['TRADFRI bulb E14 W op/ch 400lm', 'TRADFRI bulb E12 W op/ch 400lm'], model: 'LED1649C5', vendor: 'IKEA', - description: 'TRADFRI LED bulb E14 400 lumen, dimmable warm white, chandelier opal', + description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable warm white, chandelier opal', supports: generic.light_onoff_brightness().supports, fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, From c86576ddd1d8eae3bdc43d809ab1545bc87f0d6f Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 16 Nov 2018 21:49:00 +0100 Subject: [PATCH 340/676] ICTC-G-1 use cid instead of onAfIncomingMsg. https://github.com/Koenkk/zigbee2mqtt/issues/553 --- converters/fromZigbee.js | 27 ++++++++++++--------------- devices.js | 3 +-- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3ec45d397c153..4f5ede917d493 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -134,10 +134,10 @@ const ictcg1 = (model, msg, publish, options, action) => { if (action === 'move') { s.since = Date.now(); - s.direction = msg.data.payload.movemode === 1 ? 'left' : 'right'; + s.direction = msg.data.data.movemode === 1 ? 'left' : 'right'; } else if (action === 'stop' || action === 'level') { if (action === 'level') { - s.value = msg.data.payload.level; + s.value = msg.data.data.level; } s.since = false; @@ -904,23 +904,28 @@ const converters = { }, }, ICTC_G_1_move: { - cmd: 'move', + cid: 'genLevelCtrl', + type: 'cmdMove', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), }, ICTC_G_1_moveWithOnOff: { - cmd: 'moveWithOnOff', + cid: 'genLevelCtrl', + type: 'cmdMoveWithOnOff', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), }, ICTC_G_1_stop: { - cmd: 'stop', + cid: 'genLevelCtrl', + type: 'cmdStop', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'stop'), }, ICTC_G_1_stopWithOnOff: { - cmd: 'stopWithOnOff', + cid: 'genLevelCtrl', + type: 'cmdStopWithOnOff', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'stop'), }, ICTC_G_1_moveToLevelWithOnOff: { - cmd: 'moveToLevelWithOnOff', + cid: 'genLevelCtrl', + type: 'cmdMoveToLevelWithOnOff', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'level'), }, iris_3210L_power: { @@ -1035,14 +1040,6 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, - ignore_cmd_readRsp: { - cmd: 'readRsp', - convert: (model, msg, publish, options) => null, - }, - ignore_cmd_discoverRsp: { - cmd: 'discoverRsp', - convert: (model, msg, publish, options) => null, - }, }; module.exports = converters; diff --git a/devices.js b/devices.js index dd4dbd901bd81..f038224b9639e 100644 --- a/devices.js +++ b/devices.js @@ -423,10 +423,9 @@ const devices = [ supports: 'brightness [0-255], quick rotate for instant 0/255', fromZigbee: [ fz.ICTC_G_1_move, fz.ICTC_G_1_moveWithOnOff, fz.ICTC_G_1_stop, fz.ICTC_G_1_stopWithOnOff, - fz.ICTC_G_1_moveToLevelWithOnOff, fz.ignore_cmd_readRsp, fz.ignore_cmd_discoverRsp, + fz.ICTC_G_1_moveToLevelWithOnOff, ], toZigbee: [], - onAfIncomingMsg: [1], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); execute(device, [(cb) => device.bind('genLevelCtrl', coordinator, cb)], callback); From 72157299073e105f4de40bd63b7527e43f6ecda0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 16 Nov 2018 21:51:53 +0100 Subject: [PATCH 341/676] 5.0.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7037d8dc52ed3..59a081b714fdd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "5.0.1", + "version": "5.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3aef6e730d230..8e23c9176278d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "5.0.1", + "version": "5.0.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From fb0db7bc80cec434e3c3d57afc3868c1e0ff8ead Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Mon, 19 Nov 2018 19:49:22 +0100 Subject: [PATCH 342/676] FLS-PP3 (#137) * FLS-PP3 * Update devices.js * Update devices.js * Update devices.js --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index f038224b9639e..128390874d862 100644 --- a/devices.js +++ b/devices.js @@ -1473,6 +1473,17 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + // Dresden Elektronik + { + zigbeeModel: ['FLS-PP3 '], + model: 'Mega23M12', + vendor: 'Dresden Elektronik', + description: 'ZigBee Light Link wireless electronic ballast', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, + // Centralite Swiss Plug { zigbeeModel: ['4256251-RZHAC'], From 954c3b0be3ef3e804f215390c0671e397866a015 Mon Sep 17 00:00:00 2001 From: Iain van der Bloat Date: Wed, 21 Nov 2018 04:01:14 +0900 Subject: [PATCH 343/676] Add alternate zigbeeModel for LED1649C5 for E17 variant (#142) * Add alternate zigbeeModel for LED1649C5 for E17 variant * Lint --- devices.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 128390874d862..b5bc6c25d7205 100644 --- a/devices.js +++ b/devices.js @@ -407,10 +407,13 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { - zigbeeModel: ['TRADFRI bulb E14 W op/ch 400lm', 'TRADFRI bulb E12 W op/ch 400lm'], + zigbeeModel: [ + 'TRADFRI bulb E14 W op/ch 400lm', 'TRADFRI bulb E12 W op/ch 400lm', + 'TRADFRI bulb E17 W op/ch 400lm', + ], model: 'LED1649C5', vendor: 'IKEA', - description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable warm white, chandelier opal', + description: 'TRADFRI LED bulb E12/E14/E17 400 lumen, dimmable warm white, chandelier opal', supports: generic.light_onoff_brightness().supports, fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, From 7447f2d6e6eb69afe18026fb2fc8df3e95337495 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Tue, 20 Nov 2018 20:04:03 +0100 Subject: [PATCH 344/676] LEColorLight (#141) * FLS-PP3 * Update devices.js * Update devices.js * Update devices.js * LEColorLight * Update devices.js * Update devices.js --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index b5bc6c25d7205..ff62129f7f4b6 100644 --- a/devices.js +++ b/devices.js @@ -1476,6 +1476,17 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, }, + // ilux + { + zigbeeModel: ['LEColorLight'], + model: '900008-WW', + vendor: 'ilux', + description: 'Dimmable A60 E27 LED Bulb', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, + // Dresden Elektronik { zigbeeModel: ['FLS-PP3 '], From 8b224c7ef974b1665d7b89f88e748a7666e02815 Mon Sep 17 00:00:00 2001 From: Mitchell O'Hara-Wild Date: Mon, 26 Nov 2018 07:02:13 +1100 Subject: [PATCH 345/676] Added support for Aqara cube MFKZQ01LM (#144) All tested functionality appears to behave the same as the Xiaomi cube. Related: https://github.com/Koenkk/zigbee2mqtt/issues/315 --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index ff62129f7f4b6..7722556a5caa0 100644 --- a/devices.js +++ b/devices.js @@ -256,10 +256,10 @@ const devices = [ toZigbee: [], }, { - zigbeeModel: ['lumi.sensor_cube'], + zigbeeModel: ['lumi.sensor_cube', 'lumi.sensor_cube.aqgl01'], model: 'MFKZQ01LM', vendor: 'Xiaomi', - description: 'Mi smart home cube', + description: 'Mi/Aqara smart home cube', supports: 'shake, wakeup, fall, tap, slide, flip180, flip90, rotate_left and rotate_right', fromZigbee: [ fz.xiaomi_battery_3v, fz.MFKZQ01LM_action_multistate, fz.MFKZQ01LM_action_analog, From a70cfe1c7687d9549405ec2a536aa52b49989814 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 26 Nov 2018 13:46:15 +0100 Subject: [PATCH 346/676] Fix FLS-PP3 zigbee model. https://github.com/Koenkk/zigbee2mqtt/issues/633 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 7722556a5caa0..037f9e7fc519f 100644 --- a/devices.js +++ b/devices.js @@ -1489,7 +1489,7 @@ const devices = [ // Dresden Elektronik { - zigbeeModel: ['FLS-PP3 '], + zigbeeModel: ['FLS-PP3\u0000'], model: 'Mega23M12', vendor: 'Dresden Elektronik', description: 'ZigBee Light Link wireless electronic ballast', From cd5785527693f8cca8ee23057225a380fbd918db Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 27 Nov 2018 21:15:18 +0100 Subject: [PATCH 347/676] Allow color_temp and brightness in %. https://github.com/Koenkk/zigbee2mqtt/issues/627 --- converters/toZigbee.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 2ea901ef1a7c0..91d738df83e9c 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -62,6 +62,10 @@ const converters = { const attrId = 'currentLevel'; if (type === 'set') { + if (value.includes('%')) { + value = Math.round(Number(value.replace('%', '')) * 2.55).toString(); + } + return { cid: cid, cmd: 'moveToLevelWithOnOff', @@ -90,6 +94,11 @@ const converters = { const attrId = 'colorTemperature'; if (type === 'set') { + if (value.includes('%')) { + value = Number(value.replace('%', '')) * 3.46; + value = Math.round(value + 154).toString(); + } + return { cid: cid, cmd: 'moveToColorTemp', From 5a24e8fd9b20e8259572c8d3a2a0210fd329cd54 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 27 Nov 2018 21:15:27 +0100 Subject: [PATCH 348/676] 5.0.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 59a081b714fdd..0d3f899ab2ae7 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "5.0.2", + "version": "5.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8e23c9176278d..df51f3ced6dfd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "5.0.2", + "version": "5.0.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 0d1c3c4679c0557958d0a8fdc3429c5d55702b54 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 27 Nov 2018 21:47:46 +0100 Subject: [PATCH 349/676] Determine ep dynamically. (breaking change) --- converters/fromZigbee.js | 18 ++++++++++++------ devices.js | 39 +++++++++++++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 14 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 4f5ede917d493..c7cc1375f86fd 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -492,14 +492,16 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - return {click: getKey(model.ep, msg.endpoints[0].epId)}; + const device = msg.endpoints[0]; + return {click: getKey(model.ep(device), device.epId)}; }, }, WXKG02LM_click_multistate: { cid: 'genMultistateInput', type: 'attReport', convert: (model, msg, publish, options) => { - const button = getKey(model.ep, msg.endpoints[0].epId); + const device = msg.endpoints[0]; + const button = getKey(model.ep(device), device.epId); const value = msg.data.data['presentValue']; const actionLookup = { @@ -608,7 +610,8 @@ const converters = { type: 'attReport', convert: (model, msg, publish, options) => { if (msg.data.data['61440']) { - const key = `state_${getKey(model.ep, msg.endpoints[0].epId)}`; + const device = msg.endpoints[0]; + const key = `state_${getKey(model.ep(device), device.epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; return payload; @@ -769,7 +772,8 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - const key = `state_${getKey(model.ep, msg.endpoints[0].epId)}`; + const device = msg.endpoints[0]; + const key = `state_${getKey(model.ep(device), device.epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; return payload; @@ -779,7 +783,8 @@ const converters = { cid: 'genOnOff', type: 'devChange', convert: (model, msg, publish, options) => { - const key = `button_${getKey(model.ep, msg.endpoints[0].epId)}`; + const device = msg.endpoints[0]; + const key = `button_${getKey(model.ep(device), device.epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; return payload; @@ -939,7 +944,8 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - const button = getKey(model.ep, msg.endpoints[0].epId); + const device = msg.endpoints[0]; + const button = getKey(model.ep(device), device.epId); if (button) { const payload = {}; payload[`state_${button}`] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; diff --git a/devices.js b/devices.js index 037f9e7fc519f..a5fd9fbe94c6a 100644 --- a/devices.js +++ b/devices.js @@ -125,7 +125,9 @@ const devices = [ fz.WXKG02LM_click_multistate, fz.ignore_multistate_change, ], toZigbee: [], - ep: {'left': 1, 'right': 2, 'both': 3}, + ep: (device) => { + return {'left': 1, 'right': 2, 'both': 3}; + }, }, { zigbeeModel: ['lumi.ctrl_neutral1'], @@ -137,7 +139,9 @@ const devices = [ fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_basic_report, ], toZigbee: [tz.on_off], - ep: {'': 2}, + ep: (device) => { + return {'': 2}; + }, }, { zigbeeModel: ['lumi.ctrl_ln1.aq1'], @@ -161,7 +165,9 @@ const devices = [ fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons, fz.ignore_basic_change, fz.ignore_basic_report, ], toZigbee: [tz.on_off], - ep: {'left': 2, 'right': 3}, + ep: (device) => { + return {'left': 2, 'right': 3}; + }, }, { zigbeeModel: ['lumi.ctrl_ln2.aq1'], @@ -174,7 +180,9 @@ const devices = [ fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.ignore_analog_report, ], toZigbee: [tz.on_off], - ep: {'left': 1, 'right': 2}, + ep: (device) => { + return {'left': 1, 'right': 2}; + }, }, { zigbeeModel: ['lumi.sens'], @@ -769,7 +777,9 @@ const devices = [ supports: 'hold/release, on/off', fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], toZigbee: [tz.on_off], - ep: {'left': 1, 'right': 2}, + ep: (device) => { + return {'left': 1, 'right': 2}; + }, }, { zigbeeModel: ['DNCKAT_S003'], @@ -779,7 +789,9 @@ const devices = [ supports: 'hold/release, on/off', fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], toZigbee: [tz.on_off], - ep: {'left': 1, 'center': 2, 'right': 3}, + ep: (device) => { + return {'left': 1, 'center': 2, 'right': 3}; + }, }, { zigbeeModel: ['DNCKAT_S004'], @@ -789,7 +801,9 @@ const devices = [ supports: 'hold/release, on/off', fromZigbee: [fz.DNCKAT_S00X_state, fz.DNCKAT_S00X_buttons], toZigbee: [tz.on_off], - ep: {'bottom_left': 1, 'bottom_right': 2, 'top_left': 3, 'top_right': 4}, + ep: (device) => { + return {'bottom_left': 1, 'bottom_right': 2, 'top_left': 3, 'top_right': 4}; + }, }, // OSRAM @@ -1339,7 +1353,9 @@ const devices = [ supports: 'on/off', fromZigbee: [fz.nue_power_state, fz.ignore_onoff_change], toZigbee: [tz.on_off], - ep: {'left': 12, 'right': 11}, + ep: (device) => { + return {'left': 12, 'right': 11}; + }, }, // Gledopto @@ -1351,6 +1367,13 @@ const devices = [ supports: generic.light_onoff_brightness_colortemp_colorxy().supports, fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + ep: (device) => { + if (device.epList.toString() === '11,12,13') { + return {'': 12}; + } + + return {}; + }, }, // SmartThings From c9e538e23ded5d12171ca769e670b4c78c7e98fe Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 27 Nov 2018 21:48:06 +0100 Subject: [PATCH 350/676] 6.0.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0d3f899ab2ae7..e519b4ddf7432 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "5.0.3", + "version": "6.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index df51f3ced6dfd..aeced204fe495 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "5.0.3", + "version": "6.0.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 3ca5be03911d0078df894aa664303ac44ef0fdb4 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 28 Nov 2018 19:24:15 +0100 Subject: [PATCH 351/676] Fix device from endpoints. --- converters/fromZigbee.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index c7cc1375f86fd..0117bf4f9098f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -492,7 +492,7 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0]; + const device = msg.endpoints[0].device; return {click: getKey(model.ep(device), device.epId)}; }, }, @@ -500,7 +500,7 @@ const converters = { cid: 'genMultistateInput', type: 'attReport', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0]; + const device = msg.endpoints[0].device; const button = getKey(model.ep(device), device.epId); const value = msg.data.data['presentValue']; @@ -610,7 +610,7 @@ const converters = { type: 'attReport', convert: (model, msg, publish, options) => { if (msg.data.data['61440']) { - const device = msg.endpoints[0]; + const device = msg.endpoints[0].device; const key = `state_${getKey(model.ep(device), device.epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; @@ -772,7 +772,7 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0]; + const device = msg.endpoints[0].device; const key = `state_${getKey(model.ep(device), device.epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; @@ -783,7 +783,7 @@ const converters = { cid: 'genOnOff', type: 'devChange', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0]; + const device = msg.endpoints[0].device; const key = `button_${getKey(model.ep(device), device.epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; @@ -944,7 +944,7 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0]; + const device = msg.endpoints[0].device; const button = getKey(model.ep(device), device.epId); if (button) { const payload = {}; From 9b20bd10920baf38dea40526b6a33a60eb46d379 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 28 Nov 2018 19:26:38 +0100 Subject: [PATCH 352/676] 6.0.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e519b4ddf7432..28340f4aa0c10 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.0", + "version": "6.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index aeced204fe495..36b1bde3ea306 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.0", + "version": "6.0.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From f17227b24f1b114bc724b222e6aac9cbc8da2e5c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 28 Nov 2018 19:51:31 +0100 Subject: [PATCH 353/676] Update GL-C-008. https://github.com/Koenkk/zigbee2mqtt/issues/608 --- devices.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index a5fd9fbe94c6a..867183d795ea6 100644 --- a/devices.js +++ b/devices.js @@ -1363,16 +1363,18 @@ const devices = [ zigbeeModel: ['GLEDOPTO'], model: 'GL-C-008', vendor: 'Gledopto', - description: 'Zigbee LED controller RGB + CCT', + description: 'Zigbee LED controller RGB + CCT / RGBW / WWCW / Dimmer', supports: generic.light_onoff_brightness_colortemp_colorxy().supports, fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; + } else if (device.epList.toString() === '10,11,13') { + return {'': 11}; + } else { + return {}; } - - return {}; }, }, From a88ad37631238bc86b5d01a19483e03f750350b6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 28 Nov 2018 19:55:04 +0100 Subject: [PATCH 354/676] Fix debug to 3.2.6. https://github.com/Koenkk/zigbee-shepherd-converters/pull/146 --- npm-shrinkwrap.json | 150 ++++++++++---------------------------------- package.json | 3 +- 2 files changed, 34 insertions(+), 119 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 28340f4aa0c10..69fa24848498a 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -31,9 +31,9 @@ "dev": true }, "acorn-jsx": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.0.tgz", - "integrity": "sha512-XkB50fn0MURDyww9+UYL3c1yLbOBz0ZFvrdYlGB8l+Ije1oSC75qAqrzSPjYQbdnQUzhlUGNKuesryAv0gxZOg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", "dev": true }, "ajv": { @@ -78,27 +78,6 @@ "sprintf-js": "~1.0.2" } }, - "array-union": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", - "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", - "dev": true, - "requires": { - "array-uniq": "^1.0.1" - } - }, - "array-uniq": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", - "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -131,7 +110,7 @@ }, "callsites": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", "dev": true }, @@ -213,10 +192,9 @@ "integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg==" }, "debug": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", - "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", - "dev": true, + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "requires": { "ms": "^2.1.1" } @@ -227,21 +205,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "del": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", - "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", - "dev": true, - "requires": { - "globby": "^5.0.0", - "is-path-cwd": "^1.0.0", - "is-path-in-cwd": "^1.0.0", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "rimraf": "^2.2.8" - } - }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -266,9 +229,9 @@ "dev": true }, "eslint": { - "version": "5.8.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.8.0.tgz", - "integrity": "sha512-Zok6Bru3y2JprqTNm14mgQ15YQu/SMDkWdnmHfFg770DIUlmMFd/gqqzCHekxzjHZJxXv3tmTpH0C1icaYJsRQ==", + "version": "5.9.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.9.0.tgz", + "integrity": "sha512-g4KWpPdqN0nth+goDNICNXGfJF7nNnepthp46CAlJoJtC5K/cLu3NgCM3AHu1CkJ5Hzt9V0Y0PBAO6Ay/gGb+w==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -309,6 +272,17 @@ "strip-json-comments": "^2.0.1", "table": "^5.0.2", "text-table": "^0.2.0" + }, + "dependencies": { + "debug": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", + "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } } }, "eslint-config-google": { @@ -435,14 +409,14 @@ } }, "flat-cache": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", - "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", + "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", "dev": true, "requires": { "circular-json": "^0.3.1", - "del": "^2.0.2", "graceful-fs": "^4.1.2", + "rimraf": "~2.6.2", "write": "^0.2.1" } }, @@ -473,25 +447,11 @@ } }, "globals": { - "version": "11.8.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.8.0.tgz", - "integrity": "sha512-io6LkyPVuzCHBSQV9fmOwxZkUk6nIaGmxheLDgmuFv89j0fm2aqDbIXKAGfzCMHqz3HLF2Zf8WSG6VqMh2qFmA==", + "version": "11.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", + "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", "dev": true }, - "globby": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "graceful-fs": { "version": "4.1.15", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", @@ -573,30 +533,6 @@ "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "is-path-cwd": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", - "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", - "dev": true - }, - "is-path-in-cwd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", - "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", - "dev": true, - "requires": { - "is-path-inside": "^1.0.0" - } - }, - "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", - "dev": true, - "requires": { - "path-is-inside": "^1.0.1" - } - }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -692,8 +628,7 @@ "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", - "dev": true + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" }, "mute-stream": { "version": "0.0.7", @@ -753,13 +688,13 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, @@ -775,27 +710,6 @@ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, - "pify": { - "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, - "pinkie": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, - "requires": { - "pinkie": "^2.0.0" - } - }, "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", @@ -828,7 +742,7 @@ }, "require-uncached": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", "dev": true, "requires": { diff --git a/package.json b/package.json index 36b1bde3ea306..ac423d23dec82 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", "dependencies": { "debounce": "*", - "zcl-id": "*" + "zcl-id": "*", + "debug": "3.2.6" }, "devDependencies": { "eslint": "*", From 289e3c87297a9099ce8d45f4fecc1e7ba1ef1b83 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 28 Nov 2018 19:56:47 +0100 Subject: [PATCH 355/676] 6.0.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 69fa24848498a..617123c9864c1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.1", + "version": "6.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ac423d23dec82..6f14625ba17d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.1", + "version": "6.0.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From a4c40c5cc9e5641c91932663f4a4a9f74a911b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Wed, 28 Nov 2018 22:55:24 +0300 Subject: [PATCH 356/676] I am sorry, but 'use strict' (#147) * DevChange event for KS-SM001, not attReport * Update devices.js * #145 Debug dependence * #145 NodeJS 4.* support --- converters/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/converters/utils.js b/converters/utils.js index 412c012831b0d..dd8cfc07141d8 100644 --- a/converters/utils.js +++ b/converters/utils.js @@ -1,3 +1,4 @@ +'use strict'; /** * From: https://github.com/usolved/cie-rgb-converter/blob/master/cie_rgb_converter.js * Converts RGB color space to CIE color space From 2e3f48d04558c2952dfe691610f8250ae98533bf Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 28 Nov 2018 21:19:44 +0100 Subject: [PATCH 357/676] Fix ep (for real now). --- converters/fromZigbee.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 0117bf4f9098f..eab4922ef6722 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -492,16 +492,16 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0].device; - return {click: getKey(model.ep(device), device.epId)}; + const ep = msg.endpoints[0]; + return {click: getKey(model.ep(ep.device), ep.epId)}; }, }, WXKG02LM_click_multistate: { cid: 'genMultistateInput', type: 'attReport', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0].device; - const button = getKey(model.ep(device), device.epId); + const ep = msg.endpoints[0]; + const button = getKey(model.ep(ep.device), ep.epId); const value = msg.data.data['presentValue']; const actionLookup = { @@ -610,8 +610,8 @@ const converters = { type: 'attReport', convert: (model, msg, publish, options) => { if (msg.data.data['61440']) { - const device = msg.endpoints[0].device; - const key = `state_${getKey(model.ep(device), device.epId)}`; + const ep = msg.endpoints[0]; + const key = `state_${getKey(model.ep(ep.device), ep.epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; return payload; @@ -772,8 +772,8 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0].device; - const key = `state_${getKey(model.ep(device), device.epId)}`; + const ep = msg.endpoints[0]; + const key = `state_${getKey(model.ep(ep.device), ep.epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; return payload; @@ -783,8 +783,8 @@ const converters = { cid: 'genOnOff', type: 'devChange', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0].device; - const key = `button_${getKey(model.ep(device), device.epId)}`; + const ep = msg.endpoints[0]; + const key = `button_${getKey(model.ep(ep.device), ep.epId)}`; const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'release' : 'hold'; return payload; @@ -944,8 +944,8 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - const device = msg.endpoints[0].device; - const button = getKey(model.ep(device), device.epId); + const ep = msg.endpoints[0]; + const button = getKey(model.ep(ep.device), ep.epId); if (button) { const payload = {}; payload[`state_${button}`] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; From 82be5f1484b5ee1d6ad6ea3426ba39f5d0047041 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 28 Nov 2018 21:19:50 +0100 Subject: [PATCH 358/676] 6.0.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 617123c9864c1..e0cc461838c0e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.2", + "version": "6.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6f14625ba17d1..4ffaa16ea0dc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.2", + "version": "6.0.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 9cbc87dde674da8096ef7042027e9f287b4144f9 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 28 Nov 2018 21:24:30 +0100 Subject: [PATCH 359/676] Check if value is string in case of %. https://github.com/Koenkk/zigbee-shepherd-converters/issues/148 --- converters/toZigbee.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 91d738df83e9c..43d3a922c97cd 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -62,7 +62,7 @@ const converters = { const attrId = 'currentLevel'; if (type === 'set') { - if (value.includes('%')) { + if (typeof value === 'string' && value.includes('%')) { value = Math.round(Number(value.replace('%', '')) * 2.55).toString(); } @@ -94,7 +94,7 @@ const converters = { const attrId = 'colorTemperature'; if (type === 'set') { - if (value.includes('%')) { + if (typeof value === 'string' && value.includes('%')) { value = Number(value.replace('%', '')) * 3.46; value = Math.round(value + 154).toString(); } From b8d7412a2711d88ab72f960f152a3b1acb8f9996 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Wed, 28 Nov 2018 21:26:45 +0100 Subject: [PATCH 360/676] 6.0.4 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e0cc461838c0e..19d3e1402a821 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.3", + "version": "6.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4ffaa16ea0dc6..c199dde761ddd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.3", + "version": "6.0.4", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From f465010ca069ca649cdf413a7542e3aa5d3639b3 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 29 Nov 2018 19:58:11 +0100 Subject: [PATCH 361/676] Support rgb string value. https://github.com/Koenkk/zigbee2mqtt/issues/627 --- converters/toZigbee.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 43d3a922c97cd..f47eb6bc6adbe 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -131,6 +131,11 @@ const converters = { const xy = utils.rgbToXY(value.r, value.g, value.b); value.x = xy.x; value.y = xy.y; + } else if (value.hasOwnProperty('rgb')) { + const rgb = value.rgb.split(',').map((i) => parseInt(i)); + const xy = utils.rgbToXY(rgb[0], rgb[1], rgb[2]); + value.x = xy.x; + value.y = xy.y; } return { @@ -138,8 +143,8 @@ const converters = { cmd: 'moveToColor', cmdType: 'functional', zclData: { - colorx: value.x * 65535, - colory: value.y * 65535, + colorx: Math.round(value.x * 65535), + colory: Math.round(value.y * 65535), transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, cfg: cfg.default, From 3caab39282b85f0b620e9d8f9503bf425e5bf414 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 29 Nov 2018 19:58:59 +0100 Subject: [PATCH 362/676] 6.0.5 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 19d3e1402a821..d01f334a54b96 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.4", + "version": "6.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c199dde761ddd..37aac72d8f185 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.4", + "version": "6.0.5", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 78c43f731c7205a961a97689a55ff9776432710e Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 29 Nov 2018 20:30:14 +0100 Subject: [PATCH 363/676] 6.0.6 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d01f334a54b96..ad802ed06cbbd 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.5", + "version": "6.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 37aac72d8f185..767624db2d5e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.5", + "version": "6.0.6", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 130a451aa384e46643a232cf35d7c145bb7cd541 Mon Sep 17 00:00:00 2001 From: brubaked <37672083+brubaked@users.noreply.github.com> Date: Fri, 30 Nov 2018 11:10:16 -0500 Subject: [PATCH 364/676] Add support for sengled Element Plus (A19) (#149) * Add support for sengled Element Plus (A19) All features of the bulb work using the "generic.light_onoff_brightness_colortemp" converter. More info about the bulb can be found here - https://www.amazon.com/Sengled-2700-6500K-Equivalent-Assistant-SmartThings/dp/B01MQVYNFL * Lint --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 867183d795ea6..d9ddca8bd1e74 100644 --- a/devices.js +++ b/devices.js @@ -1281,6 +1281,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['Z01-A19NAE26'], + model: 'Z01-A19NAE26', + vendor: 'Sengled', + description: 'Element Plus (A19)', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['E11-N1EA'], model: 'E11-N1EA', From 9608209be4164459a89eaff6b262ff1f2e21f321 Mon Sep 17 00:00:00 2001 From: Dennis van den Bos Date: Fri, 30 Nov 2018 18:35:33 +0100 Subject: [PATCH 365/676] added Climax PSS-23ZBS power plug (#150) * added Climax PSS-23ZBS power plug * added Climax PSS-23ZBS power plug --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index d9ddca8bd1e74..bde28dbbb82bc 100644 --- a/devices.js +++ b/devices.js @@ -1555,6 +1555,17 @@ const devices = [ execute(device, actions, callback); }, }, + + // Climax + { + zigbeeModel: ['PSS_00.00.00.15TC'], + model: 'PSS-23ZBS', + vendor: 'Climax', + description: 'Power plug', + supports: 'on/off', + fromZigbee: [fz.generic_state_change], + toZigbee: [tz.on_off], + }, ]; module.exports = devices; From bd17d46c14a0988cad2a759c66f914131764235d Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 30 Nov 2018 20:41:44 +0100 Subject: [PATCH 366/676] Support HS1SA. https://github.com/Koenkk/zigbee2mqtt/issues/279 (#152) --- converters/fromZigbee.js | 7 +++++++ devices.js | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index eab4922ef6722..5cdfed7cc4e8a 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -662,6 +662,13 @@ const converters = { return {smoke: msg.data.zoneStatus === 1}; }, }, + HS1SA_smoke: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + return {smoke: msg.data.zoneStatus === 33}; + }, + }, JTQJBF01LMBW_gas: { cid: 'ssIasZone', type: 'statusChange', diff --git a/devices.js b/devices.js index bde28dbbb82bc..67f996d4cd90c 100644 --- a/devices.js +++ b/devices.js @@ -1566,6 +1566,26 @@ const devices = [ fromZigbee: [fz.generic_state_change], toZigbee: [tz.on_off], }, + + // HEIMAN + { + zigbeeModel: ['SMOK_V16', 'b5db59bfd81e4f1f95dc57fdbba17931'], + model: 'HS1SA', + vendor: 'HEIMAN', + description: 'Smoke detector', + supports: 'smoke', + fromZigbee: [fz.HS1SA_smoke], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + ]; + + execute(device, actions, callback, 1000); + }, + }, ]; module.exports = devices; From 1fbdd8ccc7fd12bcfe11f00140b4d005b0f0e0eb Mon Sep 17 00:00:00 2001 From: Koenkk Date: Fri, 30 Nov 2018 23:18:50 +0100 Subject: [PATCH 367/676] 6.0.7 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ad802ed06cbbd..e5e26cac8be48 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.6", + "version": "6.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 767624db2d5e4..6e4f3ac6a8318 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.6", + "version": "6.0.7", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From dcb6dc529d6180115f1848846caa22dad29406a9 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Sun, 2 Dec 2018 18:28:30 +0100 Subject: [PATCH 368/676] SMOK_YDLV10 HEIMAN (#156) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 67f996d4cd90c..7af2c4c795c65 100644 --- a/devices.js +++ b/devices.js @@ -1569,7 +1569,7 @@ const devices = [ // HEIMAN { - zigbeeModel: ['SMOK_V16', 'b5db59bfd81e4f1f95dc57fdbba17931'], + zigbeeModel: ['SMOK_V16', 'b5db59bfd81e4f1f95dc57fdbba17931', 'SMOK_YDLV10'], model: 'HS1SA', vendor: 'HEIMAN', description: 'Smoke detector', From 996d0d5e252882b56e5b0e7225cbba17d9b452fc Mon Sep 17 00:00:00 2001 From: nebman Date: Mon, 3 Dec 2018 15:29:05 +0100 Subject: [PATCH 369/676] Add initial OSRAM Smart+ Motion Sensor support (#153) * Add initial OSRAM Smart+ Motion Sensor support Add zigbeeModel ['Motion Sensor-A'] with converters 'ias_zone_motion_dev_change' and 'ias_zone_motion_status_change'. Note: genPowerCfg maybe not working! See Issue: https://github.com/Koenkk/zigbee2mqtt/issues/507 Co-Authored-By: Koen Kanters * fix eslint errors * Update fromZigbee.js * Update devices.js * Update devices.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 26 ++++++++++++++++++++++++++ devices.js | 24 ++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 5cdfed7cc4e8a..3732c0e73f1df 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -971,6 +971,32 @@ const converters = { }; }, }, + ias_zone_motion_dev_change: { + cid: 'ssIasZone', + type: 'devChange', + convert: (model, msg, publish, options) => { + if (msg.data.data.zoneType === 0x000D) { // type 0x000D = motion sensor + const zoneStatus = msg.data.data.zoneStatus; + return { + occupancy: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm 2: Presence Indication + tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status + battery_low: (zoneStatus & 1<<3) > 0, // Bit 3 = Battery LOW indicator (trips around 2.4V) + }; + } + }, + }, + ias_zone_motion_status_change: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.zoneStatus; + return { + occupancy: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm 2: Presence Indication + tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status + battery_low: (zoneStatus & 1<<3) > 0, // Bit 3 = Battery LOW indicator (trips around 2.4V) + }; + }, + }, // Ignore converters (these message dont need parsing). ignore_doorlock_change: { diff --git a/devices.js b/devices.js index 7af2c4c795c65..de2551f4a7362 100644 --- a/devices.js +++ b/devices.js @@ -971,6 +971,30 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['Motion Sensor-A'], + model: 'AC01353010G', + vendor: 'OSRAM', + description: 'SMART+ Motion Sensor', + supports: 'occupancy and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.ias_zone_motion_dev_change, + fz.ias_zone_motion_status_change, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), + ]; + execute(device, actions, callback); + }, + }, // Hive { From ca0b0702658751a025f4963416736ccc702d3ae8 Mon Sep 17 00:00:00 2001 From: d-EScape <8693608+d-EScape@users.noreply.github.com> Date: Mon, 3 Dec 2018 17:54:16 +0100 Subject: [PATCH 370/676] Include color mode (xy or colortemp) for hue rgbw bulbs (#154) * Include color mode (xy or colortemp) for hue rgbw bulbs The color mode can be used by home automation to determine the correct way to (re)calculate the set lighting. Zigbee2mqtt plugin for Domoticz will use the acknowledged info to correctly set the sliders (rgb/colortemp) in the UI and database. (my upcoming addition to the plugin to support HUE white and ambiance bulbs will use it) The hue bulb will only update this value after a color mode change, but it will be cached by MQTT. * Include color mode (xy or colortemp) for hue rgbw bulbs The color mode can be used by home automation to determine the correct way to (re)calculate the set lighting. Zigbee2mqtt plugin for Domoticz will use the acknowledged info to correctly set the sliders (rgb/colortemp) in the UI and database. (my upcoming addition to the plugin to support HUE white and ambiance bulbs will use it) The hue bulb will only update this value after a color mode change, but it will be cached by MQTT. --- converters/fromZigbee.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3732c0e73f1df..922544c2b0fb2 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -441,6 +441,10 @@ const converters = { result.color_temp = msg.data.data['colorTemperature']; } + if (msg.data.data['colorMode']) { + result.color_mode = msg.data.data['colorMode']; + } + if (msg.data.data['currentX'] || msg.data.data['currentY']) { result.color = {}; From 854473da7b5318c5d3ca5c64613aac16224a60df Mon Sep 17 00:00:00 2001 From: d-EScape <8693608+d-EScape@users.noreply.github.com> Date: Tue, 4 Dec 2018 19:48:16 +0100 Subject: [PATCH 371/676] Added light blinking (Hue style 'alert') feature (#157) * Added light blinking (Hue style 'alert') feature The feature used is not specific to Philips Hue, but your milage may vary. Tested on Philips Hue White and color ambiance and on Ikea Tradfri White. Publish the following commands to your lightbulb thru mqtt: {"alert":"select"} for a single blink {"alert":"lselect"} for a longer blink time (I get 15 blinks in 15 seconds on Philips Hue) {"alert":"none"} stop blinking The bulb will flash in the color you have set. If the bulb is off you should first turn it on and set the desired color. * Converter for Alert action * Converter for Alert effect * fix line length * fix comma dangle --- converters/toZigbee.js | 23 +++++++++++++++++++++++ devices.js | 11 +++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index f47eb6bc6adbe..184c22abf2154 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -163,6 +163,29 @@ const converters = { } }, }, + light_alert: { + key: 'alert', + convert: (value, message, type) => { + const cid = 'genIdentify'; + if (type === 'set') { + const lookup = { + 'select': 0x00, + 'lselect': 0x01, + 'none': 0xFF, + }; + return { + cid: cid, + cmd: 'triggerEffect', + cmdType: 'functional', + zclData: { + effectid: lookup[value.toLowerCase()], + effectvariant: 0x01, + }, + cfg: cfg.default, + }; + } + }, + }, /* Note when send the command to set sensitivity, press button on the device to make it wakeup*/ DJT11LM_vibration_sensitivity: { key: 'sensitivity', diff --git a/devices.js b/devices.js index de2551f4a7362..2dc4e151a8db3 100644 --- a/devices.js +++ b/devices.js @@ -9,28 +9,31 @@ const generic = { return { supports: 'on/off, brightness', fromZigbee: [fz.light_brightness, fz.light_state], - toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], + toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition, tz.light_alert], }; }, light_onoff_brightness_colortemp: () => { return { supports: 'on/off, brightness, color temperature', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], - toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition], + toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], }; }, light_onoff_brightness_colorxy: () => { return { supports: 'on/off, brightness, color xy', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], - toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition], + toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], }; }, light_onoff_brightness_colortemp_colorxy: () => { return { supports: 'on/off, brightness, color temperature, color xy', fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], - toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition], + toZigbee: [ + tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition, + tz.light_alert, + ], }; }, }; From d5ddd235b2e7cb3ea02cbb2019c485f712b0fdfd Mon Sep 17 00:00:00 2001 From: johnnyletrois Date: Tue, 4 Dec 2018 10:59:54 -0800 Subject: [PATCH 372/676] Add support for Iris motion/temp sensor model 3326-L (#158) * Add Iris 3326-L motion and temperature sensor * Add support for Iris 3326-L motion/temp sensor * Update fromZigbee.js * Update devices.js --- devices.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/devices.js b/devices.js index 2dc4e151a8db3..eda2b5a4bc0c8 100644 --- a/devices.js +++ b/devices.js @@ -1513,6 +1513,30 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['3326-L'], + model: '3326-L', + vendor: 'Iris', + description: 'Motion sensor', + supports: 'occupancy and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.ias_zone_motion_dev_change, + fz.ias_zone_motion_status_change, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), + ]; + execute(device, actions, callback); + }, + }, // ksentry { From 0db3b2408a78a40cbb0d8569a87e9a2c65d0e4c6 Mon Sep 17 00:00:00 2001 From: johnnyletrois Date: Tue, 4 Dec 2018 11:23:34 -0800 Subject: [PATCH 373/676] Support Iris contact sensor 3320-L (#159) * Add Iris 3326-L motion and temperature sensor * Add support for Iris 3326-L motion/temp sensor * Support for Iris contact sensor model 3320-L * Support Iris contact sensor model 3320-L * Update fromZigbee.js * Update devices.js --- converters/fromZigbee.js | 7 +++++++ devices.js | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 922544c2b0fb2..21a51a96aecc8 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -951,6 +951,13 @@ const converters = { return {power: msg.data.data['activePower'] / 10.0}; }, }, + iris_3320L_contact: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + return {contact: msg.data.zoneStatus === 36}; + }, + }, nue_power_state: { cid: 'genOnOff', type: 'attReport', diff --git a/devices.js b/devices.js index eda2b5a4bc0c8..85b1fa748aa0e 100644 --- a/devices.js +++ b/devices.js @@ -1537,6 +1537,23 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['3320-L'], + model: '3320-L', + vendor: 'Iris', + description: 'Contact sensor', + supports: 'contact', + fromZigbee: [fz.iris_3320L_contact], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + ]; + execute(device, actions, callback, 1000); + }, + }, // ksentry { From 6e304813f2bac1c1d78c3e887f24c6dd1dfcfe2e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 4 Dec 2018 21:38:06 +0100 Subject: [PATCH 374/676] Add GL-C-008 as modelID of GL-C-008. https://github.com/Koenkk/zigbee2mqtt/issues/655 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 85b1fa748aa0e..5fbf2d19cc827 100644 --- a/devices.js +++ b/devices.js @@ -1396,7 +1396,7 @@ const devices = [ // Gledopto { - zigbeeModel: ['GLEDOPTO'], + zigbeeModel: ['GLEDOPTO', 'GL-C-008'], model: 'GL-C-008', vendor: 'Gledopto', description: 'Zigbee LED controller RGB + CCT / RGBW / WWCW / Dimmer', From ce6c30501faebf60b540a1b90266b888ddb996c0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Tue, 4 Dec 2018 21:38:40 +0100 Subject: [PATCH 375/676] 6.0.8 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e5e26cac8be48..3e63f4454a730 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.7", + "version": "6.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6e4f3ac6a8318..5349318fc1c87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.7", + "version": "6.0.8", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 8e24ffa73283723d5f751f659605a501c6b9c9d3 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 6 Dec 2018 20:47:39 +0100 Subject: [PATCH 376/676] Support brigthness_percent and colortemp_percent. https://github.com/Koenkk/zigbee2mqtt/issues/627 --- converters/toZigbee.js | 52 +++++++++++++++++++++--------------------- test/verify.js | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 184c22abf2154..49b59773b037b 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -17,8 +17,8 @@ const cfg = { const converters = { factory_reset: { - key: 'reset', - convert: (value, message, type) => { + key: ['reset'], + convert: (key, value, message, type) => { if (type === 'set') { return { cid: 'genBasic', @@ -31,8 +31,8 @@ const converters = { }, }, on_off: { - key: 'state', - convert: (value, message, type) => { + key: ['state'], + convert: (key, value, message, type) => { const cid = 'genOnOff'; const attrId = 'onOff'; @@ -56,14 +56,14 @@ const converters = { }, }, light_brightness: { - key: 'brightness', - convert: (value, message, type) => { + key: ['brightness', 'brightness_percent'], + convert: (key, value, message, type) => { const cid = 'genLevelCtrl'; const attrId = 'currentLevel'; if (type === 'set') { - if (typeof value === 'string' && value.includes('%')) { - value = Math.round(Number(value.replace('%', '')) * 2.55).toString(); + if (key === 'brightness_percent') { + value = Math.round(Number(value) * 2.55).toString(); } return { @@ -88,14 +88,14 @@ const converters = { }, }, light_colortemp: { - key: 'color_temp', - convert: (value, message, type) => { + key: ['color_temp', 'color_temp_percent'], + convert: (key, value, message, type) => { const cid = 'lightingColorCtrl'; const attrId = 'colorTemperature'; if (type === 'set') { - if (typeof value === 'string' && value.includes('%')) { - value = Number(value.replace('%', '')) * 3.46; + if (key === 'color_temp_percent') { + value = Number(value) * 3.46; value = Math.round(value + 154).toString(); } @@ -121,8 +121,8 @@ const converters = { }, }, light_color: { - key: 'color', - convert: (value, message, type) => { + key: ['color'], + convert: (key, value, message, type) => { const cid = 'lightingColorCtrl'; if (type === 'set') { @@ -164,8 +164,8 @@ const converters = { }, }, light_alert: { - key: 'alert', - convert: (value, message, type) => { + key: ['alert'], + convert: (key, value, message, type) => { const cid = 'genIdentify'; if (type === 'set') { const lookup = { @@ -188,8 +188,8 @@ const converters = { }, /* Note when send the command to set sensitivity, press button on the device to make it wakeup*/ DJT11LM_vibration_sensitivity: { - key: 'sensitivity', - convert: (value, message, type) => { + key: ['sensitivity'], + convert: (key, value, message, type) => { const cid = 'genBasic'; const attrId = 0xFF0D; @@ -225,8 +225,8 @@ const converters = { }, }, JTQJBF01LMBW_sensitivity: { - key: 'sensitivity', - convert: (value, message, type) => { + key: ['sensitivity'], + convert: (key, value, message, type) => { const cid = 'ssIasZone'; if (type === 'set') { @@ -264,8 +264,8 @@ const converters = { }, }, JTQJBF01LMBW_selfest: { - key: 'selftest', - convert: (value, message, type) => { + key: ['selftest'], + convert: (key, value, message, type) => { if (type === 'set') { return { cid: 'ssIasZone', @@ -282,8 +282,8 @@ const converters = { }, }, STS_PRS_251_beep: { - key: 'beep', - convert: (value, message, type) => { + key: ['beep'], + convert: (key, value, message, type) => { const cid = 'genIdentify'; const attrId = 'identifyTime'; @@ -311,9 +311,9 @@ const converters = { // Ignore converters ignore_transition: { - key: 'transition', + key: ['transition'], attr: [], - convert: (value, message, type) => null, + convert: (key, value, message, type) => null, }, }; diff --git a/test/verify.js b/test/verify.js index e5c2205fd5d02..e960d2d7c0e26 100644 --- a/test/verify.js +++ b/test/verify.js @@ -46,7 +46,7 @@ devices.forEach((device) => { converterKey, ); - assert.strictEqual(3, converter.convert.length, `${converterKey}: convert() invalid arguments length`); + assert.strictEqual(4, converter.convert.length, `${converterKey}: convert() invalid arguments length`); }); // Check for duplicate zigbee model ids From ea980fe39981897e253135533911645f3641f203 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 6 Dec 2018 20:54:44 +0100 Subject: [PATCH 377/676] 7.0.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 3e63f4454a730..e4d237728ca4a 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.8", + "version": "7.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5349318fc1c87..28988c64f9355 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "6.0.8", + "version": "7.0.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 5c006e8f6e6daa343a28fb280363c2bd5b3c6914 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 6 Dec 2018 20:57:33 +0100 Subject: [PATCH 378/676] Add lumi.ctrl_ln1 to QBKG11LM. https://github.com/Koenkk/zigbee2mqtt/issues/117 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 5fbf2d19cc827..9e4873c77533e 100644 --- a/devices.js +++ b/devices.js @@ -147,7 +147,7 @@ const devices = [ }, }, { - zigbeeModel: ['lumi.ctrl_ln1.aq1'], + zigbeeModel: ['lumi.ctrl_ln1.aq1', 'lumi.ctrl_ln1'], model: 'QBKG11LM', vendor: 'Xiaomi', description: 'Aqara single key wired wall switch', From 5dd580640d45a25bd28cfd843e2fadd6c8f30ba0 Mon Sep 17 00:00:00 2001 From: Koenkk Date: Thu, 6 Dec 2018 20:57:47 +0100 Subject: [PATCH 379/676] 7.0.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e4d237728ca4a..00feee1a6f655 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.0", + "version": "7.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 28988c64f9355..720433da8e930 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.0", + "version": "7.0.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 5ee4205ab12f5f477e178703c3e6ef8e87d86dd7 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 6 Dec 2018 21:13:07 +0100 Subject: [PATCH 380/676] Support Calex 421786. https://github.com/Koenkk/zigbee2mqtt/issues/618 --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index 9e4873c77533e..d6c1aca8583bd 100644 --- a/devices.js +++ b/devices.js @@ -1654,6 +1654,17 @@ const devices = [ execute(device, actions, callback, 1000); }, }, + + // Calex + { + zigbeeModel: ['EC-Z3.0-CCT '], + model: '421786', + vendor: 'Calex', + description: 'LED A60 Zigbee GLS-lamp', + supports: generic.light_onoff_brightness().supports, + fromZigbee: generic.light_onoff_brightness().fromZigbee, + toZigbee: generic.light_onoff_brightness().toZigbee, + }, ]; module.exports = devices; From 954c0415183b7d848f941dd17cd818ec75d0b996 Mon Sep 17 00:00:00 2001 From: AndiGS94 Date: Fri, 7 Dec 2018 17:50:33 +0100 Subject: [PATCH 381/676] Extended E14 Candle RB 248 T with white spectrum (#160) --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index d6c1aca8583bd..e08c30e19530e 100644 --- a/devices.js +++ b/devices.js @@ -1074,6 +1074,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['RB 248 T'], + model: 'RB 248 T', + vendor: 'Innr', + description: 'E14 Candle with white spectrum', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['BY 165', 'BY 265'], model: 'BY 165', From 2035180a2bf657ad47583ab7da7addb4be5f0b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ad=C3=A1n=20SDPC?= Date: Fri, 7 Dec 2018 17:53:48 +0100 Subject: [PATCH 382/676] fix(xiaomi_lock_report): improve conversion of key error messages (#138) Fix #135 --- converters/fromZigbee.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 21a51a96aecc8..ae3b356ad6494 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -644,9 +644,15 @@ const converters = { const state = data.substr(2, 2); const action = data.substr(4, 2); const keynum = data.substr(6, 2); - if (state == 11 && action == 7) { - // wrong key or not success inserted - return {keyerror: true}; + if (state == 11) { + if (action == 1) { + // unknown key + return {keyerror: true, inserted: 'unknown'}; + } + if (action == 3) { + // explicitly disabled key (e.g.: reported lost) + return {keyerror: true, inserted: keynum}; + } } if (state == 12) { if (action == 1) { From f767759540d58ac16ae9bcef0d8b6b469fafc7c6 Mon Sep 17 00:00:00 2001 From: Merlin Schumacher Date: Sun, 9 Dec 2018 20:09:18 +0100 Subject: [PATCH 383/676] New devices: Heiman Water Sensor, Heiman Door Sensor (#133) * New devices: Heiman Water Sensor, Heiman Door Sensor * Update devices.js * Update fromZigbee.js * Update fromZigbee.js * Improved support for HEIMAN devices * Fixed ; and style * Style fix * Updates --- converters/fromZigbee.js | 33 +++++++++++++++++++++++++++++++-- devices.js | 38 +++++++++++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index ae3b356ad6494..31cc1351746cb 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -672,11 +672,40 @@ const converters = { return {smoke: msg.data.zoneStatus === 1}; }, }, - HS1SA_smoke: { + heiman_smoke: { cid: 'ssIasZone', type: 'statusChange', convert: (model, msg, publish, options) => { - return {smoke: msg.data.zoneStatus === 33}; + const zoneStatus = msg.data.zoneStatus; + return { + smoke: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm: Smoke + tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status + battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator + }; + }, + }, + heiman_water_leak: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.zoneStatus; + return { + water_leak: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm: Water leak + tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status + battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator + }; + }, + }, + heiman_contact: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.zoneStatus; + return { + contact: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm: Contact detection + tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status + battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator + }; }, }, JTQJBF01LMBW_gas: { diff --git a/devices.js b/devices.js index e08c30e19530e..856a9d52ae4ef 100644 --- a/devices.js +++ b/devices.js @@ -1651,7 +1651,7 @@ const devices = [ vendor: 'HEIMAN', description: 'Smoke detector', supports: 'smoke', - fromZigbee: [fz.HS1SA_smoke], + fromZigbee: [fz.heiman_smoke], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); @@ -1663,6 +1663,42 @@ const devices = [ execute(device, actions, callback, 1000); }, }, + { + zigbeeModel: ['SmokeSensor-N'], + model: 'HS3SA', + vendor: 'HEIMAN', + description: 'Smoke detector', + supports: 'smoke', + fromZigbee: [fz.heiman_smoke], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + ]; + + execute(device, actions, callback, 1000); + }, + }, + { + zigbeeModel: ['DoorSensor-N'], + model: 'HS1DS', + vendor: 'HEIMAN', + description: 'Door sensor', + supports: 'contact', + fromZigbee: [fz.heiman_contact], + toZigbee: [], + }, + { + zigbeeModel: ['WaterSensor-N'], + model: 'HS1WL', + vendor: 'HEIMAN', + description: 'Water leakage sensor', + supports: 'water leak', + fromZigbee: [fz.heiman_water_leak], + toZigbee: [], + }, // Calex { From c62bced8a958fb32ab94551296c13acd385df6fa Mon Sep 17 00:00:00 2001 From: Merlin Schumacher Date: Mon, 10 Dec 2018 17:41:17 +0100 Subject: [PATCH 384/676] Fixed wrong bitshift for Heiman converters (#161) * New devices: Heiman Water Sensor, Heiman Door Sensor * Update devices.js * Update fromZigbee.js * Update fromZigbee.js * Improved support for HEIMAN devices * Fixed ; and style * Style fix * Updates * Fixed wrong bitshift --- converters/fromZigbee.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 31cc1351746cb..c45ca7a54c169 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -678,8 +678,8 @@ const converters = { convert: (model, msg, publish, options) => { const zoneStatus = msg.data.zoneStatus; return { - smoke: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm: Smoke - tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status + smoke: (zoneStatus & 1) > 0, // Bit 1 = Alarm: Smoke + tamper: (zoneStatus & 1<<2) > 0, // Bit 3 = Tamper status battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator }; }, @@ -690,8 +690,8 @@ const converters = { convert: (model, msg, publish, options) => { const zoneStatus = msg.data.zoneStatus; return { - water_leak: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm: Water leak - tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status + water_leak: (zoneStatus & 1) > 0, // Bit 1 = Alarm: Water leak + tamper: (zoneStatus & 1<<2) > 0, // Bit 3 = Tamper status battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator }; }, @@ -702,8 +702,8 @@ const converters = { convert: (model, msg, publish, options) => { const zoneStatus = msg.data.zoneStatus; return { - contact: (zoneStatus & 1<<1) > 0, // Bit 1 = Alarm: Contact detection - tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status + contact: (zoneStatus & 1) > 0, // Bit 1 = Alarm: Contact detection + tamper: (zoneStatus & 1<<2) > 0, // Bit 3 = Tamper status battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator }; }, From 854b96d6e05bbc617e6a7ca06e2c535d07d94ea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrijan=20M=C3=B6cker?= <36304504+ctandi@users.noreply.github.com> Date: Wed, 12 Dec 2018 13:49:40 +0100 Subject: [PATCH 385/676] Remove tamper from heiman_smoke (#162) Due to the HS3SA not having a tamper-switch, we can remove this status from the converter. @arteck could you please confirm that for the other Heiman smoke detector? Please wait for his confirmation before merging. Thanks @merlinschumacher --- converters/fromZigbee.js | 1 - 1 file changed, 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index c45ca7a54c169..0424e2046d75f 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -679,7 +679,6 @@ const converters = { const zoneStatus = msg.data.zoneStatus; return { smoke: (zoneStatus & 1) > 0, // Bit 1 = Alarm: Smoke - tamper: (zoneStatus & 1<<2) > 0, // Bit 3 = Tamper status battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator }; }, From f003c3ce2857ec0792b98761ab41cc631528ad2c Mon Sep 17 00:00:00 2001 From: AndiGS94 Date: Thu, 13 Dec 2018 20:59:37 +0100 Subject: [PATCH 386/676] Fix wrong bitshift for Heiman battery status (#164) We forgot to fix the bitshift for the battery status. Sorry. @merlinschumacher --- converters/fromZigbee.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 0424e2046d75f..645466d20a9f3 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -679,7 +679,7 @@ const converters = { const zoneStatus = msg.data.zoneStatus; return { smoke: (zoneStatus & 1) > 0, // Bit 1 = Alarm: Smoke - battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator + battery_low: (zoneStatus & 1<<3) > 0, // Bit 4 = Battery LOW indicator }; }, }, @@ -691,7 +691,7 @@ const converters = { return { water_leak: (zoneStatus & 1) > 0, // Bit 1 = Alarm: Water leak tamper: (zoneStatus & 1<<2) > 0, // Bit 3 = Tamper status - battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator + battery_low: (zoneStatus & 1<<3) > 0, // Bit 4 = Battery LOW indicator }; }, }, @@ -703,7 +703,7 @@ const converters = { return { contact: (zoneStatus & 1) > 0, // Bit 1 = Alarm: Contact detection tamper: (zoneStatus & 1<<2) > 0, // Bit 3 = Tamper status - battery_low: (zoneStatus & 1<<4) > 0, // Bit 4 = Battery LOW indicator + battery_low: (zoneStatus & 1<<3) > 0, // Bit 4 = Battery LOW indicator }; }, }, From ab607f3e2d195c273e908c6393dde14b776f4e1a Mon Sep 17 00:00:00 2001 From: EmmanuelLM <32359407+EmmanuelLM@users.noreply.github.com> Date: Thu, 13 Dec 2018 20:03:15 +0000 Subject: [PATCH 387/676] Update devices.js (#163) * Update devices.js Add Innr B22 RGBW (BY 185 C) * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 856a9d52ae4ef..273d013deb481 100644 --- a/devices.js +++ b/devices.js @@ -1020,6 +1020,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, + { + zigbeeModel: ['BY 185 C'], + model: 'BY 185 C', + vendor: 'Innr', + description: 'B22 Bulb RGBW', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, { zigbeeModel: ['RB 285 C'], model: 'RB 285 C', From dc0c8e165f570e5c03ae108ac878a8080a135611 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 14 Dec 2018 21:43:04 +0100 Subject: [PATCH 388/676] Add support for SP 120. https://github.com/Koenkk/zigbee2mqtt/issues/588 --- converters/fromZigbee.js | 21 +++++++++++++++++++++ devices.js | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 645466d20a9f3..ded49f20eef72 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -847,6 +847,27 @@ const converters = { }; }, }, + SP120_power: { + cid: 'haElectricalMeasurement', + type: 'attReport', + convert: (model, msg, publish, options) => { + const result = {}; + + if (msg.data.data.hasOwnProperty('activePower')) { + result.power = msg.data.data['activePower']; + } + + if (msg.data.data.hasOwnProperty('rmsCurrent')) { + result.current = msg.data.data['rmsCurrent'] / 1000; + } + + if (msg.data.data.hasOwnProperty('rmsVoltage')) { + result.voltage = msg.data.data['rmsVoltage']; + } + + return result; + }, + }, STS_PRS_251_presence: { cid: 'genBinaryInput', type: 'attReport', diff --git a/devices.js b/devices.js index 273d013deb481..fcbd826193add 100644 --- a/devices.js +++ b/devices.js @@ -1173,6 +1173,40 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['SP 120'], + model: 'SP 120', + vendor: 'Innr', + description: 'Smart plug', + supports: 'on/off, power measurement', + fromZigbee: [fz.ignore_electrical_change, fz.SP120_power, fz.generic_state, fz.ignore_onoff_change], + toZigbee: [tz.on_off], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const onOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const activePower = { + direction: 0, attrId: 1291, dataType: 41, minRepIntval: 1, maxRepIntval: 300, repChange: 1, + }; + + const rmsCurrent = { + direction: 0, attrId: 1288, dataType: 33, minRepIntval: 1, maxRepIntval: 300, repChange: 100, + }; + + const rmsVoltage = { + direction: 0, attrId: 1285, dataType: 33, minRepIntval: 1, maxRepIntval: 300, repChange: 1, + }; + + const electricalCfg = [rmsCurrent, rmsVoltage, activePower]; + const actions = [ + (cb) => device.foundation('genOnOff', 'configReport', [onOff], foundationCfg, cb), + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('haElectricalMeasurement', 'configReport', electricalCfg, foundationCfg, cb), + (cb) => device.bind('haElectricalMeasurement', coordinator, cb), + ]; + + execute(device, actions, callback); + }, + }, // Sylvania { From 087e6c3e3da98e0ae5cf86408faee65151b92eb3 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 14 Dec 2018 21:45:52 +0100 Subject: [PATCH 389/676] 7.0.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 00feee1a6f655..72bd5f4cd194e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.1", + "version": "7.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 720433da8e930..4a5380dcb4158 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.1", + "version": "7.0.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 3c86c65ceb2bb546354f147e3cd0e53a7893e69f Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 15 Dec 2018 20:07:15 +0100 Subject: [PATCH 390/676] Add support for ZCTS-808 and ZPIR-8000. https://github.com/Koenkk/zigbee2mqtt/issues/677 --- converters/fromZigbee.js | 20 ++++++++++++++++++++ devices.js | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index ded49f20eef72..52134f9d6efd0 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1063,6 +1063,26 @@ const converters = { }; }, }, + ias_contact_dev_change: { + cid: 'ssIasZone', + type: 'devChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.zoneStatus; + return { + contact: (zoneStatus & 1) > 0, + }; + }, + }, + ias_contact_status_change: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.zoneStatus; + return { + contact: (zoneStatus & 1) > 0, + }; + }, + }, // Ignore converters (these message dont need parsing). ignore_doorlock_change: { diff --git a/devices.js b/devices.js index fcbd826193add..90005040011a3 100644 --- a/devices.js +++ b/devices.js @@ -1505,6 +1505,42 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + { + zigbeeModel: ['VMS_ADUROLIGHT'], + model: 'ZPIR-8000', + vendor: 'Trust', + description: 'Motion Sensor', + supports: 'occupancy', + fromZigbee: [fz.ias_zone_motion_dev_change, fz.ias_zone_motion_status_change], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + ]; + + execute(device, actions, callback); + }, + }, + { + zigbeeModel: ['CSW_ADUROLIGHT'], + model: 'ZCTS-808', + vendor: 'Trust', + description: 'Wireless contact sensor', + supports: 'contact', + fromZigbee: [fz.ias_contact_dev_change, fz.ias_contact_status_change], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + ]; + + execute(device, actions, callback); + }, + }, // Paulmann { From 7b68b4effc00cf16fa362d56edc3f671d8a3822a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 15 Dec 2018 21:45:28 +0100 Subject: [PATCH 391/676] Support temperature, humidity and pressure precision. https://github.com/Koenkk/zigbee2mqtt/issues/708 --- converters/fromZigbee.js | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 52134f9d6efd0..fa18c016c7919 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -77,6 +77,19 @@ const voltageMap = [ [Infinity, 100], ]; +const defaultPrecision = { + temperature: 2, + humidity: 2, + pressure: 1, +}; + +const precisionRoundOptions = (number, options, type) => { + const key = `${type}_precision`; + const defaultValue = defaultPrecision[type]; + const precision = options && options.hasOwnProperty(key) ? options[key] : defaultValue; + return precisionRound(number, precision); +}; + const precisionRound = (number, precision) => { const factor = Math.pow(10, precision); return Math.round(number * factor) / factor; @@ -220,14 +233,17 @@ const converters = { type: 'attReport', convert: (model, msg, publish, options) => { if (msg.data.data['65281']) { + const temperature = parseFloat(msg.data.data['65281']['100']) / 100.0; + const humidity = parseFloat(msg.data.data['65281']['101']) / 100.0; const result = { - temperature: parseFloat(msg.data.data['65281']['100']) / 100.0, - humidity: parseFloat(msg.data.data['65281']['101']) / 100.0, + temperature: precisionRoundOptions(temperature, options, 'temperature'), + humidity: precisionRoundOptions(humidity, options, 'humidity'), }; // Check if contains pressure (WSDCGQ11LM only) if (msg.data.data['65281'].hasOwnProperty('102')) { - result.pressure = parseFloat(msg.data.data['65281']['102']) / 100.0; + const pressure = parseFloat(msg.data.data['65281']['102']) / 100.0; + result.pressure = precisionRoundOptions(pressure, options, 'pressure'); } return result; @@ -275,7 +291,8 @@ const converters = { cid: 'msTemperatureMeasurement', type: 'attReport', convert: (model, msg, publish, options) => { - return {temperature: parseFloat(msg.data.data['measuredValue']) / 100.0}; + const temperature = parseFloat(msg.data.data['measuredValue']) / 100.0; + return {temperature: precisionRoundOptions(temperature, options, 'temperature')}; }, }, MFKZQ01LM_action_multistate: { @@ -368,7 +385,8 @@ const converters = { cid: 'msRelativeHumidity', type: 'attReport', convert: (model, msg, publish, options) => { - return {humidity: parseFloat(msg.data.data['measuredValue']) / 100.0}; + const humidity = parseFloat(msg.data.data['measuredValue']) / 100.0; + return {humidity: precisionRoundOptions(humidity, options, 'humidity')}; }, }, generic_occupancy: { @@ -489,7 +507,8 @@ const converters = { cid: 'msPressureMeasurement', type: 'attReport', convert: (model, msg, publish, options) => { - return {pressure: msg.data.data['measuredValue']}; + const pressure = parseFloat(msg.data.data['measuredValue']); + return {pressure: precisionRoundOptions(pressure, options, 'pressure')}; }, }, WXKG02LM_click: { @@ -567,7 +586,7 @@ const converters = { power: precisionRound(data['152'], 2), voltage: precisionRound(data['150'] * 0.1, 1), consumption: precisionRound(data['149'], 2), - temperature: precisionRound(data['3'], 2), + temperature: precisionRoundOptions(data['3'], options, 'temperature'), }; } }, @@ -581,7 +600,7 @@ const converters = { return { power: precisionRound(data['152'], 2), consumption: precisionRound(data['149'], 2), - temperature: precisionRound(data['3'], 2), + temperature: precisionRoundOptions(data['3'], options, 'temperature'), }; } }, @@ -595,7 +614,7 @@ const converters = { return { power: precisionRound(data['152'], 2), consumption: precisionRound(data['149'], 2), - temperature: precisionRound(data['3'], 2), + temperature: precisionRoundOptions(data['3'], options, 'temperature'), }; } }, From 12db456bab848e2239ae3fb3659328e1e2194fba Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 15 Dec 2018 21:49:30 +0100 Subject: [PATCH 392/676] 7.0.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 72bd5f4cd194e..93b4e60c9075d 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.2", + "version": "7.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4a5380dcb4158..4d1b56088f161 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.2", + "version": "7.0.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 2c0d76922122870c59a0e9aa59dd2c1db86df896 Mon Sep 17 00:00:00 2001 From: quarcko <31532153+quarcko@users.noreply.github.com> Date: Tue, 18 Dec 2018 18:16:38 +0200 Subject: [PATCH 393/676] Added fz.xiaomi_power to QBKG11LM & QBKG12LM --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 90005040011a3..dae9e316a46cf 100644 --- a/devices.js +++ b/devices.js @@ -154,7 +154,7 @@ const devices = [ supports: 'on/off, power measurement', fromZigbee: [ fz.QBKG04LM_QBKG11LM_state, fz.QBKG11LM_power, fz.ignore_onoff_change, fz.ignore_basic_change, - fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_analog_change, fz.ignore_analog_report, + fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_analog_change, fz.xiaomi_power, ], toZigbee: [tz.on_off], }, @@ -180,7 +180,7 @@ const devices = [ supports: 'on/off, power measurement', fromZigbee: [ fz.QBKG03LM_QBKG12LM_state, fz.QBKG12LM_power, fz.ignore_analog_change, fz.ignore_basic_change, - fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.ignore_analog_report, + fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.xiaomi_power, ], toZigbee: [tz.on_off], ep: (device) => { From dc64d35b31a75758c68596eed1225bf0652f7d2b Mon Sep 17 00:00:00 2001 From: boojew Date: Tue, 18 Dec 2018 12:33:25 -0500 Subject: [PATCH 394/676] Add support for EcoSmart A19 RGB Bulb (#165) * Add support for EcoSmart A19 RGB Bulb * Update devices.js * Update devices.js * Update devices.js --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index dae9e316a46cf..48706b9b1ba0c 100644 --- a/devices.js +++ b/devices.js @@ -1789,6 +1789,17 @@ const devices = [ fromZigbee: generic.light_onoff_brightness().fromZigbee, toZigbee: generic.light_onoff_brightness().toZigbee, }, + + // EcoSmart + { + zigbeeModel: ['zhaRGBW'], + model: 'D1821', + vendor: 'EcoSmart', + description: 'A19 RGB bulb', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + }, ]; module.exports = devices; From 91cba4eecb5fc4565646056be8ed0e1b4eae957e Mon Sep 17 00:00:00 2001 From: Liad Shani Date: Wed, 19 Dec 2018 18:37:33 +0200 Subject: [PATCH 395/676] Added support for Xiaomi Aqara LED bulb (ZNLDP12LM) (#168) * Added support for Xiaomi Aqara LED bulb (ZNLDP12LM). https://github.com/Koenkk/zigbee2mqtt/issues/621 * Update devices.js --- converters/fromZigbee.js | 24 ++++++++++++++++++++++++ devices.js | 13 +++++++++++++ 2 files changed, 37 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index fa18c016c7919..e7b657f045881 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -591,6 +591,20 @@ const converters = { } }, }, + xiaomi_bulb_interval: { + cid: 'genBasic', + type: 'attReport', + convert: (model, msg, publish, options) => { + if (msg.data.data['65281']) { + const data = msg.data.data['65281']; + return { + state: data['100'] === 1 ? 'ON' : 'OFF', + brightness: data['101'], + color_temp: data['102'], + }; + } + }, + }, QBKG11LM_power: { cid: 'genBasic', type: 'attReport', @@ -1184,6 +1198,16 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_light_brightness_report: { + cid: 'genLevelCtrl', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, + ignore_light_color_colortemp_report: { + cid: 'lightingColorCtrl', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; diff --git a/devices.js b/devices.js index 48706b9b1ba0c..4216b668d91f8 100644 --- a/devices.js +++ b/devices.js @@ -72,6 +72,19 @@ const execute = (device, actions, callback, delay) => { const devices = [ // Xiaomi + { + zigbeeModel: ['lumi.light.aqcn02'], + model: 'ZNLDP12LM', + vendor: 'Xiaomi', + description: 'Aqara smart LED bulb', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: [ + fz.light_brightness, fz.light_color_colortemp, fz.generic_state, fz.xiaomi_bulb_interval, + fz.ignore_light_brightness_report, fz.ignore_light_color_colortemp_report, fz.ignore_onoff_change, + fz.ignore_basic_change, + ], + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, { zigbeeModel: ['lumi.sensor_switch'], model: 'WXKG01LM', From 18f4bfb09ad4bd9b1b14c3cfc9b53a647f5fd459 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 19 Dec 2018 17:38:46 +0100 Subject: [PATCH 396/676] 7.0.4 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 93b4e60c9075d..e5c0116596012 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.3", + "version": "7.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4d1b56088f161..8526b7153167f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.3", + "version": "7.0.4", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 5ace593290b0fd44cb31bec61ebd55016f316501 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 21 Dec 2018 19:31:55 +0100 Subject: [PATCH 397/676] Export converters. https://github.com/Koenkk/zigbee2mqtt/issues/15 --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index e9da87d4fb454..2ba330bd2b062 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,12 @@ 'use strict'; const devices = require('./devices'); +const toZigbee = require('./converters/toZigbee'); +const fromZigbee = require('./converters/fromZigbee'); module.exports = { devices: devices, findByZigbeeModel: (model) => devices.find((d) => d.zigbeeModel.includes(model)), + toZigbeeConverters: toZigbee, + fromZigbeeConverters: fromZigbee, }; From 0baff9c700bc3e895d30deea30ed83468f3f8e0b Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 21 Dec 2018 19:35:32 +0100 Subject: [PATCH 398/676] 7.0.5 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e5c0116596012..b5808945240ec 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.4", + "version": "7.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8526b7153167f..34addf10e58be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.4", + "version": "7.0.5", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 679625699fd416baafd3e61fe85064f530bb3bcb Mon Sep 17 00:00:00 2001 From: dnaphreak Date: Fri, 21 Dec 2018 14:10:31 -0500 Subject: [PATCH 399/676] modify Sylvania bulb model#74283 (#169) * modify Sylvania bulb model#74283 updated zigbeeModel to include "10 Year" identifier * Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 4216b668d91f8..2afbbbe4b1ffa 100644 --- a/devices.js +++ b/devices.js @@ -1250,7 +1250,7 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, }, { - zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM'], + zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM', 'LIGHTIFY A19 ON/OFF/DIM 10 Year'], model: '74283', vendor: 'Sylvania', description: 'LIGHTIFY LED soft white dimmable A19', From 945492300862cb326faca3b4fa44571e50e47909 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 24 Dec 2018 16:31:22 +0100 Subject: [PATCH 400/676] Update GL-C-008 eps. https://github.com/Koenkk/zigbee2mqtt/issues/747 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 2afbbbe4b1ffa..b65362634f036 100644 --- a/devices.js +++ b/devices.js @@ -1471,7 +1471,7 @@ const devices = [ ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; - } else if (device.epList.toString() === '10,11,13') { + } else if (device.epList.toString() === '10,11,13' || device.epList.toString() === '11,13') { return {'': 11}; } else { return {}; From 6a3a1ee50263c54c9328569d20462115bc187084 Mon Sep 17 00:00:00 2001 From: Der-Jan Date: Mon, 24 Dec 2018 19:07:01 +0100 Subject: [PATCH 401/676] Added OSRAM MR16 (#171) * Added OSRAM MR16 * Update devices.js * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index b65362634f036..b4d2a007a0acd 100644 --- a/devices.js +++ b/devices.js @@ -1011,6 +1011,15 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['MR16 TW OSRAM'], + model: 'AC03648', + vendor: 'OSRAM', + description: 'SMART+ spot GU5.3 tunable white', + supports: generic.light_onoff_brightness_colortemp().supports, + fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + }, // Hive { From d11318eb468fab168e0209dc5147cbe67c66442c Mon Sep 17 00:00:00 2001 From: Karl Q Date: Wed, 26 Dec 2018 04:07:20 -0800 Subject: [PATCH 402/676] added the 3325-S motion sensor and the 4257050-RZHAC plug (#172) * added the 3325-S motion sensor and the 4257050-RZHAC plug * Update devices.js * Update devices.js --- devices.js | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index b4d2a007a0acd..635a14e8ceb2c 100644 --- a/devices.js +++ b/devices.js @@ -1493,7 +1493,7 @@ const devices = [ zigbeeModel: ['PGC313'], model: 'STSS-MULT-001', vendor: 'SmartThings', - description: 'SmartSense multi sensor', + description: 'Multipurpose sensor', supports: 'contact', fromZigbee: [fz.smartthings_contact], toZigbee: [], @@ -1502,7 +1502,7 @@ const devices = [ zigbeeModel: ['tagv4'], model: 'STS-PRS-251', vendor: 'SmartThings', - description: 'SmartThings arrival sensor', + description: 'Arrival sensor', supports: 'presence', fromZigbee: [fz.STS_PRS_251_presence, fz.STS_PRS_251_battery, fz.ignore_power_change, fz.STS_PRS_251_beeping], toZigbee: [tz.STS_PRS_251_beep], @@ -1516,6 +1516,30 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['3325-S'], + model: '3325-S', + vendor: 'SmartThings', + description: 'Motion sensor (2015 model)', + supports: 'occupancy and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.ias_zone_motion_dev_change, + fz.ias_zone_motion_status_change, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), + ]; + execute(device, actions, callback); + }, + }, // Trust { @@ -1712,7 +1736,7 @@ const devices = [ // Centralite Swiss Plug { - zigbeeModel: ['4256251-RZHAC'], + zigbeeModel: ['4256251-RZHAC', '4257050-RZHAC'], model: '4256251-RZHAC', vendor: 'Centralite', description: 'White Swiss power outlet switch with power meter', From 9739de729a3fe48ab1857bd9db1ea3776661c2f2 Mon Sep 17 00:00:00 2001 From: Mihal Malostanidis Date: Wed, 26 Dec 2018 17:42:23 +0200 Subject: [PATCH 403/676] Devices refactor (#173) * Add Iris 3326-L motion and temperature sensor * Add support for Iris 3326-L motion/temp sensor * Add density for xiaomi gas leak sensor * Support for Iris contact sensor model 3320-L * Support Iris contact sensor model 3320-L * Update fromZigbee.js * Update devices.js * Update devices.js Add support for Innr BY 185 C (Innr B22) * lint: Fix long line * fix: Missing callback SmartThings arrival sensor would never finish configuring * Dangling coma for eslint * Return references to generic type objects * Refactor `execute` helper * Fix new upstream devices according refactor --- converters/fromZigbee.js | 13 + devices.js | 662 +++++++++++++++++++-------------------- 2 files changed, 344 insertions(+), 331 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index e7b657f045881..d112d64709029 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -747,6 +747,19 @@ const converters = { return {gas: msg.data.zoneStatus === 1}; }, }, + JTQJBF01LMBW_gas_density: { + cid: 'genBasic', + type: 'attReport', + convert: (model, msg, publish, options) => { + const data = msg.data.data; + if (data && data['65281']) { + const basicAttrs = data['65281']; + if (basicAttrs.hasOwnProperty('100')) { + return {density: basicAttrs['100']}; + } + } + }, + }, JTQJBF01LMBW_sensitivity: { cid: 'ssIasZone', type: 'devChange', diff --git a/devices.js b/devices.js index 635a14e8ceb2c..93ad7787c562b 100644 --- a/devices.js +++ b/devices.js @@ -5,69 +5,64 @@ const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); const generic = { - light_onoff_brightness: () => { - return { - supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.light_state], - toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition, tz.light_alert], - }; - }, - light_onoff_brightness_colortemp: () => { - return { - supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], - toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], - }; - }, - light_onoff_brightness_colorxy: () => { - return { - supports: 'on/off, brightness, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], - toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], - }; - }, - light_onoff_brightness_colortemp_colorxy: () => { - return { - supports: 'on/off, brightness, color temperature, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], - toZigbee: [ - tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition, - tz.light_alert, - ], - }; + light_onoff_brightness: { + supports: 'on/off, brightness', + fromZigbee: [fz.light_brightness, fz.light_state], + toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition, tz.light_alert], + }, + light_onoff_brightness_colortemp: { + supports: 'on/off, brightness, color temperature', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], + toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], + }, + light_onoff_brightness_colorxy: { + supports: 'on/off, brightness, color xy', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], + toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], + }, + light_onoff_brightness_colortemp_colorxy: { + supports: 'on/off, brightness, color temperature, color xy', + fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], + toZigbee: [ + tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition, + tz.light_alert, + ], }, }; const foundationCfg = {manufSpec: 0, disDefaultRsp: 0}; const execute = (device, actions, callback, delay) => { - if (device) { - delay = delay || 300; - actions = actions.reverse(); + if (!device) { + callback(false); + return; + } + delay || (delay = 300); + const len = actions.length; + let nextActionIndex = 0; - const next = () => { - if (actions.length === 0) { - callback(true); - return; - } + const next = () => { + if (nextActionIndex === len) { + callback(true); + return; + } - setTimeout(() => { - const action = actions.pop(); - action((error) => { - debug(`Configured '${action.toString()}' with result '${error ? error : 'OK'}'`); - if (error) { - callback(false); - } else { - next(); - } - }); - }, delay); - }; + const nextAction = actions[nextActionIndex++]; - next(); - } else { - callback(false); - } + setTimeout(nextAction, + delay, + (error) => { + debug(`Configured '${nextAction.toString()}' with result '${error ? error : 'OK'}'`); + if (error) { + callback(false); + return; + } + next(); + } + ); + }; + + next(); }; const devices = [ @@ -77,13 +72,13 @@ const devices = [ model: 'ZNLDP12LM', vendor: 'Xiaomi', description: 'Aqara smart LED bulb', - supports: generic.light_onoff_brightness_colortemp().supports, + supports: generic.light_onoff_brightness_colortemp.supports, fromZigbee: [ fz.light_brightness, fz.light_color_colortemp, fz.generic_state, fz.xiaomi_bulb_interval, fz.ignore_light_brightness_report, fz.ignore_light_color_colortemp_report, fz.ignore_onoff_change, fz.ignore_basic_change, ], - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['lumi.sensor_switch'], @@ -330,7 +325,12 @@ const devices = [ vendor: 'Xiaomi', description: 'MiJia gas leak detector ', supports: 'gas', - fromZigbee: [fz.JTQJBF01LMBW_gas, fz.JTQJBF01LMBW_sensitivity, fz.ignore_basic_change], + fromZigbee: [ + fz.JTQJBF01LMBW_gas, + fz.JTQJBF01LMBW_sensitivity, + fz.JTQJBF01LMBW_gas_density, + fz.ignore_basic_change, + ], toZigbee: [tz.JTQJBF01LMBW_sensitivity, tz.JTQJBF01LMBW_selfest], }, { @@ -363,72 +363,72 @@ const devices = [ model: 'LED1545G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['TRADFRI bulb E27 WS clear 950lm', 'TRADFRI bulb E26 WS clear 950lm'], model: 'LED1546G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26/E27 950 lumen, dimmable, white spectrum, clear', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm'], model: 'LED1623G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['TRADFRI bulb GU10 WS 400lm'], model: 'LED1537R6', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable, white spectrum', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['TRADFRI bulb GU10 W 400lm'], model: 'LED1650R5', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['TRADFRI bulb E14 WS opal 400lm', 'TRADFRI bulb E12 WS opal 400lm'], model: 'LED1536G5', vendor: 'IKEA', description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable, white spectrum, opal white', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['TRADFRI bulb E26 opal 1000lm', 'TRADFRI bulb E26 W opal 1000lm'], model: 'LED1622G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26 1000 lumen, dimmable, opal white', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['TRADFRI bulb E27 CWS opal 600lm', 'TRADFRI bulb E26 CWS opal 600lm'], model: 'LED1624G9', vendor: 'IKEA', description: 'TRADFRI LED bulb E27/E26 600 lumen, dimmable, color, opal white', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: [ @@ -438,9 +438,9 @@ const devices = [ model: 'LED1649C5', vendor: 'IKEA', description: 'TRADFRI LED bulb E12/E14/E17 400 lumen, dimmable warm white, chandelier opal', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['TRADFRI wireless dimmer'], @@ -463,45 +463,45 @@ const devices = [ model: 'ICPSHC24-10EU-IL-1', vendor: 'IKEA', description: 'TRADFRI driver for wireless control (10 watt)', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['TRADFRI transformer 30W'], model: 'ICPSHC24-30EU-IL-1', vendor: 'IKEA', description: 'TRADFRI driver for wireless control (30 watt)', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['FLOALT panel WS 30x30'], model: 'L1527', vendor: 'IKEA', description: 'FLOALT LED light panel, dimmable, white spectrum (30x30 cm)', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['FLOALT panel WS 60x60'], model: 'L1529', vendor: 'IKEA', description: 'FLOALT LED light panel, dimmable, white spectrum (60x60 cm)', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['FLOALT panel WS 30x90'], model: 'L1528', vendor: 'IKEA', description: 'FLOALT LED light panel, dimmable, white spectrum (30x90 cm)', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['TRADFRI control outlet'], @@ -529,153 +529,153 @@ const devices = [ model: '7299760PH', vendor: 'Philips', description: 'Hue Bloom', - supports: generic.light_onoff_brightness_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, }, { zigbeeModel: ['LLC020'], model: '7146060PH', vendor: 'Philips', description: 'Hue Go', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['LWB004'], model: '433714', vendor: 'Philips', description: 'Hue Lux A19 bulb E27', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['LWB006', 'LWB014'], model: '9290011370', vendor: 'Philips', description: 'Hue white A60 bulb E27', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['LWB010'], model: '8718696449691', vendor: 'Philips', description: 'Hue White Single bulb B22', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['LST001'], model: '7299355PH', vendor: 'Philips', description: 'Hue white and color ambiance LightStrip', - supports: generic.light_onoff_brightness_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, }, { zigbeeModel: ['LST002'], model: '915005106701', vendor: 'Philips', description: 'Hue white and color ambiance LightStrip plus', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT012', 'LCT014', 'LCT015', 'LCT016'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E26/E27/E14', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['LCT002'], model: '9290002579A', vendor: 'Philips', description: 'Hue white and color ambiance BR30', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['LCT003'], model: '8718696485880', vendor: 'Philips', description: 'Hue white and color ambiance GU10', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['LCT024'], model: '915005733701', vendor: 'Philips', description: 'Hue White and color ambiance Play Lightbar', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['LTW012'], model: '8718696695203', vendor: 'Philips', description: 'Hue white ambiance E14', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['LTW013'], model: '8718696598283', vendor: 'Philips', description: 'Hue white ambiance GU10', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['LTW010', 'LTW001', 'LTW004'], model: '8718696548738', vendor: 'Philips', description: 'Hue white ambiance E26/E27', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['LTC001'], model: '3261030P7', vendor: 'Philips', description: 'Hue Being', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['LTC015'], model: '3216331P5', vendor: 'Philips', description: 'Philips Hue White ambiance Aurelle Rectangle Panel Light', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['LLC010'], model: '7199960PH', vendor: 'Philips', description: 'Hue Iris', - supports: generic.light_onoff_brightness_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, }, { zigbeeModel: ['RWL020', 'RWL021'], @@ -746,9 +746,9 @@ const devices = [ model: 'F7C033', vendor: 'Belkin', description: 'WeMo smart LED bulb', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, // EDP @@ -828,36 +828,36 @@ const devices = [ model: '4058075816718', vendor: 'OSRAM', description: 'SMART+ outdoor wall lantern RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['Classic A60 RGBW'], model: 'AA69697', vendor: 'OSRAM', description: 'Classic A60 RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['CLA60 RGBW OSRAM'], model: 'AC03645', vendor: 'OSRAM', description: 'LIGHTIFY LED CLA60 E27 RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['CLA60 TW OSRAM'], model: 'AC03642', vendor: 'OSRAM', description: 'SMART+ CLASSIC A 60 TW', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { // AA70155 is model number of both bulbs. @@ -865,63 +865,63 @@ const devices = [ model: 'AA70155', vendor: 'OSRAM', description: 'LIGHTIFY LED A19 tunable white / Classic A60 TW', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['PAR16 50 TW'], model: 'AA68199', vendor: 'OSRAM', description: 'LIGHTIFY LED PAR16 50 GU10 tunable white', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['Classic B40 TW - LIGHTIFY'], model: 'AB32840', vendor: 'OSRAM', description: 'LIGHTIFY LED Classic B40 tunable white', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['Ceiling TW OSRAM'], model: '4058075816794', vendor: 'OSRAM', description: 'Smart+ Ceiling TW', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['Classic A60 W clear - LIGHTIFY'], model: 'AC03641', vendor: 'OSRAM', description: 'LIGHTIFY LED Classic A60 clear', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['Surface Light W �C LIGHTIFY'], model: '4052899926158', vendor: 'OSRAM', description: 'LIGHTIFY Surface Light TW', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['Surface Light TW'], model: 'AB401130055', vendor: 'OSRAM', description: 'LIGHTIFY Surface Light LED Tunable White', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['Plug 01'], @@ -947,45 +947,45 @@ const devices = [ model: '4052899926110', vendor: 'OSRAM', description: 'Flex RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['LIGHTIFY Outdoor Flex RGBW'], model: '4058075036185', vendor: 'OSRAM', description: 'Outdoor Flex RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['Gardenpole RGBW-Lightify'], model: '4058075036147', vendor: 'OSRAM', description: 'Smart+ Gardenpole RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['PAR 16 50 RGBW - LIGHTIFY'], model: 'AB35996', vendor: 'OSRAM', description: 'Smart+ Spot GU10 Multicolor', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['B40 DIM Z3'], model: 'AC08562', vendor: 'OSRAM', description: 'SMART+ Candle E14 Dimmable White', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['Motion Sensor-A'], @@ -1016,9 +1016,9 @@ const devices = [ model: 'AC03648', vendor: 'OSRAM', description: 'SMART+ spot GU5.3 tunable white', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, // Hive @@ -1027,9 +1027,9 @@ const devices = [ model: 'HALIGHTDIMWWE27', vendor: 'Hive', description: 'Active light dimmable', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, // Innr @@ -1038,162 +1038,162 @@ const devices = [ model: 'RB 185 C', vendor: 'Innr', description: 'E27 Bulb RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['BY 185 C'], model: 'BY 185 C', vendor: 'Innr', description: 'B22 Bulb RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['RB 285 C'], model: 'RB 285 C', vendor: 'Innr', description: 'E27 Bulb RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['RB 165'], model: 'RB 165', vendor: 'Innr', description: 'E27 Bulb', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['RB 175 W'], model: 'RB 175 W', vendor: 'Innr', description: 'E27 Bulb warm dimming', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['RS 125'], model: 'RS 125', vendor: 'Innr', description: 'GU10 Spot', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['RS 128 T'], model: 'RS 128 T', vendor: 'Innr', description: 'GU10 Spot 350 lm, dimmable, white spectrum', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['RB 145'], model: 'RB 145', vendor: 'Innr', description: 'E14 Candle', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['RB 248 T'], model: 'RB 248 T', vendor: 'Innr', description: 'E14 Candle with white spectrum', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['BY 165', 'BY 265'], model: 'BY 165', vendor: 'Innr', description: 'B22 Bulb dimmable', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['PL 110'], model: 'PL 110', vendor: 'Innr', description: 'Puck Light', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['ST 110'], model: 'ST 110', vendor: 'Innr', description: 'Strip Light', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['UC 110'], model: 'UC 110', vendor: 'Innr', description: 'Under Cabinet Light', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['DL 110 N'], model: 'DL 110 N', vendor: 'Innr', description: 'Spot narrow', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['DL 110 W'], model: 'DL 110 W', vendor: 'Innr', description: 'Spot wide', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['SL 110 N'], model: 'SL 110 N', vendor: 'Innr', description: 'Spot Flex narrow', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['SL 110 M'], model: 'SL 110 M', vendor: 'Innr', description: 'Spot Flex medium', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['SL 110 W'], model: 'SL 110 W', vendor: 'Innr', description: 'Spot Flex wide', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['SP 120'], @@ -1236,45 +1236,45 @@ const devices = [ model: '73742', vendor: 'Sylvania', description: 'LIGHTIFY LED adjustable white RT 5/6', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['LIGHTIFY BR Tunable White'], model: '73740', vendor: 'Sylvania', description: 'LIGHTIFY LED adjustable white BR30', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['LIGHTIFY A19 RGBW'], model: '73693', vendor: 'Sylvania', description: 'LIGHTIFY LED RGBW A19', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, { zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM', 'LIGHTIFY A19 ON/OFF/DIM 10 Year'], model: '74283', vendor: 'Sylvania', description: 'LIGHTIFY LED soft white dimmable A19', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['A19 W 10 year'], model: '74696', vendor: 'Sylvania', description: 'LIGHTIFY LED soft white dimmable A19', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['PLUG'], @@ -1300,9 +1300,9 @@ const devices = [ model: '74282', vendor: 'Sylvania', description: 'Smart Home adjustable white MR16 LED bulb', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, // GE @@ -1311,9 +1311,9 @@ const devices = [ model: '22670', vendor: 'GE', description: 'Link smart LED light bulb, BR30 soft white (2700K)', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['45852'], @@ -1360,45 +1360,45 @@ const devices = [ model: 'E11-G13', vendor: 'Sengled', description: 'Element Classic (A19)', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['E11-G23', 'E11-G33'], model: 'E11-G23/E11-G33', vendor: 'Sengled', description: 'Element Classic (A60)', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['Z01-CIA19NAE26'], model: 'Z01-CIA19NAE26', vendor: 'Sengled', description: 'Element Touch (A19)', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['Z01-A19NAE26'], model: 'Z01-A19NAE26', vendor: 'Sengled', description: 'Element Plus (A19)', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['E11-N1EA'], model: 'E11-N1EA', vendor: 'Sengled', description: 'Element Plus Color (A19)', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, // JIAWEN @@ -1407,9 +1407,9 @@ const devices = [ model: 'K2RGBW01', vendor: 'JIAWEN', description: 'Wireless Bulb E27 9W RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, // Netvox @@ -1440,9 +1440,9 @@ const devices = [ model: 'NL08-0800', vendor: 'Nanoleaf', description: 'Smart Ivy Bulb E27', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, // Nue @@ -1474,9 +1474,9 @@ const devices = [ model: 'GL-C-008', vendor: 'Gledopto', description: 'Zigbee LED controller RGB + CCT / RGBW / WWCW / Dimmer', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1510,7 +1510,7 @@ const devices = [ const device = shepherd.find(ieeeAddr, 1); const actions = [ (cb) => device.report('genBinaryInput', 'presentValue', 10, 30, 1, cb), - (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 3600), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 3600, cb), ]; execute(device, actions, callback); @@ -1547,9 +1547,9 @@ const devices = [ model: 'ZLED-2709', vendor: 'Trust', description: 'Smart Dimmable LED Bulb', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['VMS_ADUROLIGHT'], @@ -1594,18 +1594,18 @@ const devices = [ model: '50045', vendor: 'Paulmann', description: 'SmartHome Zigbee LED-stripe', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, { zigbeeModel: ['RGBW light'], model: '50049', vendor: 'Paulmann', description: 'SmartHome Yourled RGB Controller', - supports: generic.light_onoff_brightness_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, }, // Bitron Home @@ -1707,9 +1707,9 @@ const devices = [ model: '53170161', vendor: 'Commercial Electric', description: 'Matte White Recessed Retrofit Smart Led Downlight - 4 Inch', - supports: generic.light_onoff_brightness_colortemp().supports, - fromZigbee: generic.light_onoff_brightness_colortemp().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp().toZigbee, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, // ilux @@ -1718,9 +1718,9 @@ const devices = [ model: '900008-WW', vendor: 'ilux', description: 'Dimmable A60 E27 LED Bulb', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, // Dresden Elektronik @@ -1729,9 +1729,9 @@ const devices = [ model: 'Mega23M12', vendor: 'Dresden Elektronik', description: 'ZigBee Light Link wireless electronic ballast', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, // Centralite Swiss Plug @@ -1831,9 +1831,9 @@ const devices = [ model: '421786', vendor: 'Calex', description: 'LED A60 Zigbee GLS-lamp', - supports: generic.light_onoff_brightness().supports, - fromZigbee: generic.light_onoff_brightness().fromZigbee, - toZigbee: generic.light_onoff_brightness().toZigbee, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, }, // EcoSmart @@ -1842,9 +1842,9 @@ const devices = [ model: 'D1821', vendor: 'EcoSmart', description: 'A19 RGB bulb', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, ]; From febb4f4138db57e41e46d43df9633a1db9c6beb5 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 26 Dec 2018 17:27:22 +0100 Subject: [PATCH 404/676] Support LTFY004. https://github.com/Koenkk/zigbee2mqtt/issues/715 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 93ad7787c562b..3b57a292634dd 100644 --- a/devices.js +++ b/devices.js @@ -1304,6 +1304,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, + { + zigbeeModel: ['LIGHTIFY Gardenspot RGB'], + model: 'LTFY004', + vendor: 'Sylvania', + description: 'LIGHTIFY LED gardenspot mini RGB', + supports: generic.light_onoff_brightness_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, + }, // GE { From 2a5cd5f7838e9e98e34949f91edbae6bd30aa08f Mon Sep 17 00:00:00 2001 From: Evildime Date: Thu, 27 Dec 2018 21:06:50 +0100 Subject: [PATCH 405/676] Add support for Xiaomi Aqara Curtain Motor (ZNCLDJ11LM) (#170) * Add support for Xiaomi Aqara Curtain Motor (ZNCLDJ11LM) * Changed presentValue to position, removed attReport * Updated files to fix lint issues * Use GenAnalogOutput devChange to report position * Update toZigbee.js * Update toZigbee.js * Update devices.js * Update toZigbee.js * Update toZigbee.js * Update devices.js --- converters/fromZigbee.js | 38 ++++++++++++++++++++++++++++++++++++++ converters/toZigbee.js | 39 +++++++++++++++++++++++++++++++++++++++ devices.js | 13 +++++++++++++ 3 files changed, 90 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index d112d64709029..c2647703b125e 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -698,6 +698,34 @@ const converters = { } }, }, + ZNCLDJ11LM_curtain_genAnalogOutput_change: { + cid: 'genAnalogOutput', + type: 'devChange', + convert: (model, msg, publish, options) => { + let running = false; + + if (msg.data.data['61440']) { + running = msg.data.data['61440'] !== 0; + } + + const position = precisionRound(msg.data.data['presentValue'], 2); + return {position: position, running: running}; + }, + }, + ZNCLDJ11LM_curtain_genAnalogOutput_report: { + cid: 'genAnalogOutput', + type: 'attReport', + convert: (model, msg, publish, options) => { + let running = false; + + if (msg.data.data['61440']) { + running = msg.data.data['61440'] !== 0; + } + + const position = precisionRound(msg.data.data['presentValue'], 2); + return {position: position, running: running}; + }, + }, JTYJGD01LMBW_smoke: { cid: 'ssIasZone', type: 'statusChange', @@ -1221,6 +1249,16 @@ const converters = { type: 'attReport', convert: (model, msg, publish, options) => null, }, + ignore_closuresWindowCovering_change: { + cid: 'closuresWindowCovering', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, + ignore_closuresWindowCovering_report: { + cid: 'closuresWindowCovering', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 49b59773b037b..2ae4dbd0930dd 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -308,6 +308,45 @@ const converters = { } }, }, + ZNCLDJ11LM_control: { + key: 'state', + convert: (key, value, message, type) => { + const lookup = { + 'open': 'upOpen', + 'close': 'downClose', + 'stop': 'stop', + 'on': 'upOpen', + 'off': 'downClose', + }; + + value = value.toLowerCase(); + if (lookup[value]) { + return { + cid: 'closuresWindowCovering', + cmd: lookup[value], + cmdType: 'functional', + zclData: {}, + cfg: cfg.default, + }; + } + }, + }, + ZNCLDJ11LM_control_position: { + key: 'position', + convert: (key, value, message, type) => { + return { + cid: 'genAnalogOutput', + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: 0x0055, + dataType: 0x39, + attrData: value, + }], + cfg: cfg.default, + }; + }, + }, // Ignore converters ignore_transition: { diff --git a/devices.js b/devices.js index 3b57a292634dd..1181f10e8e55e 100644 --- a/devices.js +++ b/devices.js @@ -353,6 +353,19 @@ const devices = [ ], toZigbee: [tz.DJT11LM_vibration_sensitivity], }, + { + zigbeeModel: ['lumi.curtain'], + model: 'ZNCLDJ11LM', + description: 'Aqara curtain motor', + supports: 'open, close, stop, position', + vendor: 'Xiaomi', + fromZigbee: [ + fz.ZNCLDJ11LM_curtain_genAnalogOutput_change, fz.ZNCLDJ11LM_curtain_genAnalogOutput_report, + fz.ignore_closuresWindowCovering_change, fz.ignore_closuresWindowCovering_report, + fz.ignore_basic_change, fz.ignore_basic_report, + ], + toZigbee: [tz.ZNCLDJ11LM_control, tz.ZNCLDJ11LM_control_position], + }, // IKEA { From d996a56c14f186fbd3ea7e79bc8ffd64d390bc6e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 27 Dec 2018 21:13:04 +0100 Subject: [PATCH 406/676] Remove unknown_data from DJT11LM. https://github.com/Koenkk/zigbee2mqtt/issues/295 --- converters/fromZigbee.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index c2647703b125e..3bf7545e3b539 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -828,10 +828,6 @@ const converters = { const data = msg.data.data['1283']; result.angle = data; } - if (msg.data.data['1285']) { - const data = msg.data.data['1285']; - result.unknown_data = data; - } if (msg.data.data['1288']) { const data = msg.data.data['1288']; From a62de1b6cb085120d61917765d9cc1d7669683ef Mon Sep 17 00:00:00 2001 From: DJTerentjev Date: Thu, 27 Dec 2018 23:18:12 +0300 Subject: [PATCH 407/676] Add GL-S-007Z (#176) * Add GL-S-007Z * Support GL-S-007Z. https://github.com/Koenkk/zigbee2mqtt/issues/682 --- devices.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/devices.js b/devices.js index 1181f10e8e55e..1d152855bcacd 100644 --- a/devices.js +++ b/devices.js @@ -1509,6 +1509,24 @@ const devices = [ } }, }, + { + zigbeeModel: ['GL-S-007Z'], + model: 'GL-S-007Z', + vendor: 'Gledopto', + description: 'Smart RGBW GU10', + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + ep: (device) => { + if (device.epList.toString() === '11,12,13') { + return {'': 12}; + } else if (device.epList.toString() === '10,11,13' || device.epList.toString() === '11,13') { + return {'': 11}; + } else { + return {}; + } + }, + }, // SmartThings { From ce77b7e94c17fa4fb0b68b91578a394cb7b7aa7f Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 27 Dec 2018 21:48:40 +0100 Subject: [PATCH 408/676] Support Airam LED OP A60 ZB 9W/827 E27. https://github.com/Koenkk/zigbee-shepherd-converters/issues/175 --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index 1d152855bcacd..4206465ee6e03 100644 --- a/devices.js +++ b/devices.js @@ -1886,6 +1886,17 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, + + // Airam + { + zigbeeModel: ['ZBT-DimmableLight'], + model: '4713407', + vendor: 'Airam', + description: 'LED OP A60 ZB 9W/827 E27', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, ]; module.exports = devices; From 4538298c8f6858d90c00f12227abe39e63693276 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 27 Dec 2018 21:55:47 +0100 Subject: [PATCH 409/676] 7.0.6 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b5808945240ec..ccac2841d7a31 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.5", + "version": "7.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 34addf10e58be..5a3022b4c936b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.5", + "version": "7.0.6", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 98435fdad0e16acb6b0326d621396b671b7d5f26 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 27 Dec 2018 22:35:20 +0100 Subject: [PATCH 410/676] Calculate battery voltage with 2700-3000 range. https://github.com/Koenkk/zigbee2mqtt/issues/142 --- converters/fromZigbee.js | 78 +++------------------------------------- 1 file changed, 4 insertions(+), 74 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3bf7545e3b539..33d1f757a9deb 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -11,72 +11,6 @@ const clickLookup = { const occupancyTimeout = 90; // In seconds -const voltageMap = [ - [2000, 0], - [2186, 1], - [2373, 2], - [2563, 3], - [2626, 4], - [2675, 5], - [2717, 6], - [2753, 7], - [2784, 8], - [2813, 9], - [2838, 10], - [2859, 11], - [2875, 12], - [2891, 13], - [2905, 14], - [2915, 15], - [2921, 16], - [2926, 17], - [2931, 18], - [2936, 19], - [2939, 20], - [2942, 21], - [2945, 22], - [2949, 23], - [2951, 24], - [2953, 25], - [2955, 26], - [2957, 27], - [2959, 28], - [2961, 29], - [2964, 30], - [2966, 31], - [2968, 32], - [2969, 33], - [2971, 34], - [2973, 35], - [2974, 36], - [2976, 37], - [2978, 38], - [2980, 39], - [2982, 40], - [2984, 41], - [2986, 42], - [2988, 43], - [2990, 44], - [2991, 46], - [2992, 48], - [2993, 49], - [2994, 51], - [2995, 53], - [2996, 55], - [2997, 57], - [2998, 59], - [2999, 61], - [3000, 64], - [3001, 66], - [3002, 69], - [3003, 77], - [3004, 90], - [3005, 98], - [3028, 99], - [3211, 100], - [Infinity, 100], -]; - const defaultPrecision = { temperature: 2, humidity: 2, @@ -217,14 +151,10 @@ const converters = { } if (voltage) { - for (let i = 0; i < voltageMap.length; i++) { - if (voltageMap[i][0] > voltage) { - return { - battery: parseFloat(voltageMap[i][1].toFixed(2)), - voltage: voltage, - }; - } - } + return { + battery: parseFloat(toPercentage(voltage, 2700, 3000)), + voltage: voltage, + }; } }, }, From 1da45a4d764d6e8d0eb496e32cc90fa0dbf73445 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 27 Dec 2018 22:47:04 +0100 Subject: [PATCH 411/676] 7.0.7 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ccac2841d7a31..7eed9cddfaed0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.6", + "version": "7.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 5a3022b4c936b..d7214d33ed168 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.6", + "version": "7.0.7", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 0e082135552ea745407df27492baf0e453d0a52b Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 29 Dec 2018 20:06:39 +0100 Subject: [PATCH 412/676] Add GL-B-008Z. https://github.com/Koenkk/zigbee-shepherd-converters/pull/178 --- devices.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/devices.js b/devices.js index 4206465ee6e03..330e605ed8461 100644 --- a/devices.js +++ b/devices.js @@ -1527,6 +1527,24 @@ const devices = [ } }, }, + { + zigbeeModel: ['GL-B-008Z'], + model: 'GL-B-008Z', + vendor: 'GLEDOPTO', + description: 'Smart 12W E27 RGB / CW LED bulb', + supports: generic.light_onoff_brightness_colortemp_colorxy().supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + ep: (device) => { + if (device.epList.toString() === '11,12,13') { + return {'': 12}; + } else if (device.epList.toString() === '10,11,13' || device.epList.toString() === '11,13') { + return {'': 11}; + } else { + return {}; + } + }, + }, // SmartThings { From dd4f8437609616356108ac1475c5ff8cd1b2ea0f Mon Sep 17 00:00:00 2001 From: Evildime Date: Sat, 29 Dec 2018 22:47:42 +0100 Subject: [PATCH 413/676] Removed brackets of light_onoff_brightness_colortemp_colorxy in new GL-B-008Z (#179) --- devices.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index 330e605ed8461..15456bfd5dae3 100644 --- a/devices.js +++ b/devices.js @@ -1532,9 +1532,9 @@ const devices = [ model: 'GL-B-008Z', vendor: 'GLEDOPTO', description: 'Smart 12W E27 RGB / CW LED bulb', - supports: generic.light_onoff_brightness_colortemp_colorxy().supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy().fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy().toZigbee, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; From c144801bf45da0d95bcf2f48c2e187bd20506a97 Mon Sep 17 00:00:00 2001 From: Evildime Date: Sun, 30 Dec 2018 00:42:58 +0100 Subject: [PATCH 414/676] Support setting color by hex value (#180) * Support setting color by hex value * Added support for leading # in color hex value --- converters/toZigbee.js | 4 ++++ converters/utils.js | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 2ae4dbd0930dd..cb11ca696c81c 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -136,6 +136,10 @@ const converters = { const xy = utils.rgbToXY(rgb[0], rgb[1], rgb[2]); value.x = xy.x; value.y = xy.y; + } else if (value.hasOwnProperty('hex')) { + const xy = utils.hexToXY(value.hex); + value.x = xy.x; + value.y = xy.y; } return { diff --git a/converters/utils.js b/converters/utils.js index dd8cfc07141d8..a8467fc88f857 100644 --- a/converters/utils.js +++ b/converters/utils.js @@ -34,6 +34,23 @@ function rgbToXY(red, green, blue) { return {x: Number.parseFloat(x), y: Number.parseFloat(y)}; } +function hexToXY(hex) { + const rgb = hexToRgb(hex); + return rgbToXY(rgb.r, rgb.g, rgb.b); +} + +function hexToRgb(hex) { + hex = hex.replace('#', ''); + const bigint = parseInt(hex, 16); + const r = (bigint >> 16) & 255; + const g = (bigint >> 8) & 255; + const b = bigint & 255; + + return {r: r, g: g, b: b}; +} + module.exports = { rgbToXY: rgbToXY, + hexToXY: hexToXY, + hexToRgb: hexToRgb, }; From b3108478f4d1efdbec9856e2a8fa8705cee0da6f Mon Sep 17 00:00:00 2001 From: orientalsniper <6079191+orientalsniper@users.noreply.github.com> Date: Tue, 1 Jan 2019 07:05:13 -0500 Subject: [PATCH 415/676] Support for LTW011 (#183) * Update devices.js Added support for LTW011 * Update devices.js * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 15456bfd5dae3..f5b56dfc91db0 100644 --- a/devices.js +++ b/devices.js @@ -636,6 +636,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, + { + zigbeeModel: ['LTW011'], + model: '464800', + vendor: 'Philips', + description: 'Hue white ambiance BR30 flood light', + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + }, { zigbeeModel: ['LTW012'], model: '8718696695203', From 80a191cef0d13d0f2ccfb495382121a05cdfa91f Mon Sep 17 00:00:00 2001 From: simonrath <44604276+simonrath@users.noreply.github.com> Date: Tue, 1 Jan 2019 13:10:14 +0100 Subject: [PATCH 416/676] Add support for Bitron Smart Plug with metering 16A (902010/25) (#181) * Update devices.js Add support for Bitron Smart Plug with metering 16A (902010/25) * Update fromZigbee.js Add converter bitron_power * Update fromZigbee.js * Update devices.js * Update fromZigbee.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 7 +++++++ devices.js | 21 +++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 33d1f757a9deb..edbab6c72a4fc 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -105,6 +105,13 @@ const holdUpdateBrightness324131092621 = (deviceID) => { const converters = { + bitron_power: { + cid: 'seMetering', + type: 'attReport', + convert: (model, msg, publish, options) => { + return {power: parseFloat(msg.data.data['instantaneousDemand']) / 10.0}; + }, + }, bitron_occupancy: { cid: 'ssIasZone', type: 'statusChange', diff --git a/devices.js b/devices.js index f5b56dfc91db0..85bdb10c8610a 100644 --- a/devices.js +++ b/devices.js @@ -1675,11 +1675,11 @@ const devices = [ toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, }, - // Bitron Home + // Bitron { zigbeeModel: ['902010/22'], model: 'AV2010/22', - vendor: 'Bitron Home', + vendor: 'Bitron', description: 'Wireless motion detector', supports: 'occupancy', fromZigbee: [fz.bitron_occupancy], @@ -1695,6 +1695,23 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['902010/25'], + model: 'AV2010/25', + vendor: 'Bitron', + description: 'Video wireless socket', + supports: 'on/off, power measurement', + fromZigbee: [fz.generic_state, fz.ignore_onoff_change, fz.ignore_metering_change, fz.bitron_power], + toZigbee: [tz.on_off], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.report('seMetering', 'instantaneousDemand', 10, 60, 1, cb), + (cb) => device.bind('genOnOff', coordinator, cb), + ]; + execute(device, actions, callback); + }, + }, // Iris { From e2ba25f9ae21547939fa1e3e831ca42ee47ef414 Mon Sep 17 00:00:00 2001 From: Phil Hawthorne Date: Tue, 1 Jan 2019 23:26:23 +1100 Subject: [PATCH 417/676] Support Home Assistant flashing light bulbs (#187) * Support Home Assistant flashing light bulbs Home Assistant sends the "flash" key in the Zigbee message to tell lightbulbs to flash. The value sent from Home Assistant is the number of seconds for the bulb to flash. 2 for "short" and 10 for "long". See #157 * Fix linting for hass lightbulb flashing * More lint fixing for hass light flash --- converters/toZigbee.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index cb11ca696c81c..7ab94bf3e7d98 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -168,7 +168,7 @@ const converters = { }, }, light_alert: { - key: ['alert'], + key: ['alert', 'flash'], convert: (key, value, message, type) => { const cid = 'genIdentify'; if (type === 'set') { @@ -177,6 +177,13 @@ const converters = { 'lselect': 0x01, 'none': 0xFF, }; + if (key === 'flash') { + if (value === 2) { + value = 'select'; + } else if (value === 10) { + value = 'lselect'; + } + } return { cid: cid, cmd: 'triggerEffect', From 2e3b0854f30728c64a645c4e21fb5ab26cbac4d3 Mon Sep 17 00:00:00 2001 From: netztrip <40369349+netztrip@users.noreply.github.com> Date: Tue, 1 Jan 2019 13:28:22 +0100 Subject: [PATCH 418/676] Add support for round Hue Aurelle LTC016 (#186) * Add support for round Hue Aurelle LTC016 * Update devices.js * Update devices.js --- devices.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 85bdb10c8610a..1ebb7e270ef7d 100644 --- a/devices.js +++ b/devices.js @@ -685,7 +685,16 @@ const devices = [ zigbeeModel: ['LTC015'], model: '3216331P5', vendor: 'Philips', - description: 'Philips Hue White ambiance Aurelle Rectangle Panel Light', + description: 'Hue white ambiance Aurelle rectangle panel light', + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + }, + { + zigbeeModel: ['LTC016'], + model: '3216431P5', + vendor: 'Philips', + description: 'Hue white ambiance Aurelle round panel light', supports: generic.light_onoff_brightness_colortemp.supports, fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, From 8f8ac28b38cc048a51f971b470b364041e4272b3 Mon Sep 17 00:00:00 2001 From: allofmex Date: Tue, 1 Jan 2019 13:55:07 +0100 Subject: [PATCH 419/676] Hue motion sensor SML001 improved (#184) * Fix occupancy implementation for Hue SML001 Old implementation fails if there is continous motion because timer interupts. Hue motion sensor sends both messages (occupancy true and false), so we don't need the publish timer. * Travis CI errors fixed * More Travis fixes * Hopefully the last indent fix... * Reverted changes in bind Its not needed anymore since not timeout used for sml001 --- converters/fromZigbee.js | 17 +++++++++++++++++ devices.js | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index edbab6c72a4fc..69a66bb402a24 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -327,6 +327,23 @@ const converters = { }, }, generic_occupancy: { + // This is for occupancy sensor that send motion start AND stop messages + // Note: options.occupancy_timeout not available yet, to implement it will be + // needed to update device report intervall as well, see devices.js + cid: 'msOccupancySensing', + type: 'attReport', + convert: (model, msg, publish, options) => { + if (msg.data.data.occupancy === 0) { + return {occupancy: false}; + } else if (msg.data.data.occupancy === 1) { + return {occupancy: true}; + } + }, + }, + generic_occupancy_no_off_msg: { + // This is for occupancy sensor that only send a message when motion detected, + // but do not send a motion stop. + // Therefore we need to publish the no_motion detected by ourselves. cid: 'msOccupancySensing', type: 'attReport', convert: (model, msg, publish, options) => { diff --git a/devices.js b/devices.js index 1ebb7e270ef7d..f0fe8bbd9b4e3 100644 --- a/devices.js +++ b/devices.js @@ -226,7 +226,7 @@ const devices = [ vendor: 'Xiaomi', description: 'MiJia human body movement sensor', supports: 'occupancy', - fromZigbee: [fz.xiaomi_battery_3v, fz.generic_occupancy, fz.ignore_basic_change], + fromZigbee: [fz.xiaomi_battery_3v, fz.generic_occupancy_no_off_msg, fz.ignore_basic_change], toZigbee: [], }, { @@ -236,7 +236,7 @@ const devices = [ description: 'Aqara human body movement and illuminance sensor', supports: 'occupancy and illuminance', fromZigbee: [ - fz.xiaomi_battery_3v, fz.generic_occupancy, fz.generic_illuminance, fz.ignore_basic_change, + fz.xiaomi_battery_3v, fz.generic_occupancy_no_off_msg, fz.generic_illuminance, fz.ignore_basic_change, fz.ignore_illuminance_change, fz.ignore_occupancy_change, ], toZigbee: [], From 5a286b68fe481c9792a2cd7c3b49715d709f1df7 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 1 Jan 2019 21:07:23 +0100 Subject: [PATCH 420/676] ignore_onoff_change for CC2530 router. https://github.com/Koenkk/Z-Stack-firmware/issues/18 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index f0fe8bbd9b4e3..59e124e73c282 100644 --- a/devices.js +++ b/devices.js @@ -804,7 +804,7 @@ const devices = [ vendor: 'Custom devices (DiY)', description: '[CC2530 router](http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/)', supports: 'state, description, type, rssi', - fromZigbee: [fz.CC2530ROUTER_state, fz.CC2530ROUTER_meta], + fromZigbee: [fz.CC2530ROUTER_state, fz.CC2530ROUTER_meta, fz.ignore_onoff_change], toZigbee: [], }, { From 3f2138b311ea5fd26e037096dd1a134f9e2e7afa Mon Sep 17 00:00:00 2001 From: netztrip <40369349+netztrip@users.noreply.github.com> Date: Tue, 1 Jan 2019 21:28:08 +0100 Subject: [PATCH 421/676] Add support for Hue white ambiance Still LTC003 (#188) * Add support for round Hue Aurelle LTC016 * Update devices.js * Add support for Hue white ambiance Still LTC003 * Update devices.js * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 59e124e73c282..72d5557663723 100644 --- a/devices.js +++ b/devices.js @@ -681,6 +681,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, + { + zigbeeModel: ['LTC003'], + model: '3261331P7', + vendor: 'Philips', + description: 'Hue white ambiance Still', + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + }, { zigbeeModel: ['LTC015'], model: '3216331P5', From bec8e023f18094448af37be4a7e22ca02ad4df1b Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 1 Jan 2019 21:35:42 +0100 Subject: [PATCH 422/676] 7.0.8 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7eed9cddfaed0..6a4b35902b844 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.7", + "version": "7.0.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d7214d33ed168..85c929922640b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.7", + "version": "7.0.8", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From ffef13d62ea091f45e195f25f8ca51d766992d4c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 1 Jan 2019 21:58:19 +0100 Subject: [PATCH 423/676] Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 72d5557663723..3fb61b002da9a 100644 --- a/devices.js +++ b/devices.js @@ -1557,7 +1557,7 @@ const devices = [ { zigbeeModel: ['GL-B-008Z'], model: 'GL-B-008Z', - vendor: 'GLEDOPTO', + vendor: 'Gledopto', description: 'Smart 12W E27 RGB / CW LED bulb', supports: generic.light_onoff_brightness_colortemp_colorxy.supports, fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, From 152a8ed42b044284c7088f55761b032f29fabc71 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 1 Jan 2019 22:00:12 +0100 Subject: [PATCH 424/676] 7.0.9 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 6a4b35902b844..b8bf11744cbc7 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.8", + "version": "7.0.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 85c929922640b..be1fcd4b6ee3d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.8", + "version": "7.0.9", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 90c48764d81782089b33ac8fd5c370378fe650b3 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 1 Jan 2019 15:47:32 -0600 Subject: [PATCH 425/676] Add support for Sengled E12-N14 (BR30) Light --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 3fb61b002da9a..f23302ad35fa7 100644 --- a/devices.js +++ b/devices.js @@ -1449,6 +1449,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, + { + zigbeeModel: ['E12-N14'], + model: 'E12-N14', + vendor: 'Sengled', + description: 'Element Classic (BR30)', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, // JIAWEN { From 9e17a2c0a0f5b80e827405f24cbe717621161c33 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Wed, 2 Jan 2019 22:08:19 +0100 Subject: [PATCH 426/676] new devices (#174) * HOMA2023 * FNB56-ZCW25FB1.9 * 'GL-C-007', 'GL-S-007Z' * XY12S-15 * RB 178 T * GL-D-003Z * corr little bugs * RB 178 T corr * Update devices.js * Update devices.js * Update devices.js * Update devices.js * Update devices.js * Update devices.js * Update devices.js --- devices.js | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index f23302ad35fa7..dd62f3e050052 100644 --- a/devices.js +++ b/devices.js @@ -1118,6 +1118,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness.fromZigbee, toZigbee: generic.light_onoff_brightness.toZigbee, }, + { + zigbeeModel: ['RB 178 T'], + model: 'RB 178 T', + vendor: 'Innr', + description: 'Smart bulb tunable white E27', + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + }, { zigbeeModel: ['RS 125'], model: 'RS 125', @@ -1528,7 +1537,7 @@ const devices = [ // Gledopto { - zigbeeModel: ['GLEDOPTO', 'GL-C-008'], + zigbeeModel: ['GLEDOPTO', 'GL-C-008', 'GL-C-007'], model: 'GL-C-008', vendor: 'Gledopto', description: 'Zigbee LED controller RGB + CCT / RGBW / WWCW / Dimmer', @@ -1581,6 +1590,33 @@ const devices = [ } }, }, + { + zigbeeModel: ['GL-D-003Z'], + model: 'GL-D-003Z', + vendor: 'Gledopto', + description: 'LED RGB + CCT downlight ', + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + ep: (device) => { + if (device.epList.toString() === '11,12,13') { + return {'': 12}; + } else if (device.epList.toString() === '10,11,13') { + return {'': 11}; + } else { + return {}; + } + }, + }, + { + zigbeeModel: ['HOMA2023'], + model: 'GD-CZ-006', + vendor: 'Gledopto', + description: 'Zigbee LED Driver', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, // SmartThings { From 79ee093b407069bbe62017ff07bec6f399a6d0da Mon Sep 17 00:00:00 2001 From: Joscha Middendorf Date: Thu, 3 Jan 2019 08:22:32 +0100 Subject: [PATCH 427/676] Requested PR for "Incorrect Battery Readings #568" (#191) * Requested PR for "Incorrect Battery Readings #568" This is my "Second attempt" first try on Java Script Please have a look on the xiaomi_battery_3v block beginning in line 168 and the function toPercentageCR2032 beginning in line 43. I'd love if this works. ;-) * Update fromZigbee.js * Update fromZigbee.js * Update fromZigbee.js * Update fromZigbee.js * Update fromZigbee.js changed "Percentage" to "percentage" * Use Math.round instead of toFixed --- converters/fromZigbee.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 69a66bb402a24..07617ea7ecf90 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -40,6 +40,26 @@ const toPercentage = (value, min, max) => { return (normalised * 100).toFixed(2); }; +const toPercentageCR2032 = (voltage) => { + let percentage = null; + + if (voltage < 2100) { + percentage = 0; + } else if (voltage < 2440) { + percentage = 6 - ((2440 - voltage) * 6) / 340; + } else if (voltage < 2740) { + percentage = 18 - ((2740 - voltage) * 12) / 300; + } else if (voltage < 2900) { + percentage = 42 - ((2900 - voltage) * 24) / 160; + } else if (voltage < 3000) { + percentage = 100 - ((3000 - voltage) * 58) / 100; + } else if (voltage >= 3000) { + percentage = 100; + } + + return Math.round(percentage); +}; + const numberWithinRange = (number, min, max) => { if (number > max) { return max; @@ -159,7 +179,7 @@ const converters = { if (voltage) { return { - battery: parseFloat(toPercentage(voltage, 2700, 3000)), + battery: parseFloat(toPercentageCR2032(voltage)), voltage: voltage, }; } From 936436d544c44275f3a1d097f3a7fb9f932eaad6 Mon Sep 17 00:00:00 2001 From: allofmex Date: Thu, 3 Jan 2019 14:37:33 +0100 Subject: [PATCH 428/676] Occupancy pirOtoUdelay (#185) * Fix occupancy implementation for Hue SML001 Old implementation fails if there is continous motion because timer interupts. Hue motion sensor sends both messages (occupancy true and false), so we don't need the publish timer. * occupancy_pirOToUDelay implemented (for hue motion sensor) * Travis CI errors fixed * More Travis fixes * Hopefully the last indent fix... * Indents fixed * Reverted changes in bind Its not needed anymore since not timeout used for sml001 * Renamed keys to occupancy_timeout Lint fixes * Lint fix * default endpoint for sml001 --- converters/toZigbee.js | 41 ++++++++++++++++++++++++++++++++++++++++- devices.js | 9 ++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 7ab94bf3e7d98..d142970c1fee3 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -55,6 +55,42 @@ const converters = { } }, }, + generic_occupancy_timeout: { + // set delay after motion detector changes from occupied to unoccupied + key: ['occupancy_timeout'], + convert: (key, value, message, type) => { + const cid = 'msOccupancySensing'; // 1030 + const attrId = zclId.attr(cid, 'pirOToUDelay').value; // = 16 + + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: attrId, + dataType: 33, // uint16 + // hue_sml001: + // in seconds, minimum 10 seconds, <10 values result + // in 10 seconds delay + // make sure you write to second endpoint! + attrData: value, + }], + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{ + attrId: attrId, + }], + cfg: cfg.default, + }; + } + }, + }, light_brightness: { key: ['brightness', 'brightness_percent'], convert: (key, value, message, type) => { @@ -197,7 +233,10 @@ const converters = { } }, }, - /* Note when send the command to set sensitivity, press button on the device to make it wakeup*/ + /* + * Note when send the command to set sensitivity, press button on the device + * to make it wakeup + */ DJT11LM_vibration_sensitivity: { key: ['sensitivity'], convert: (key, value, message, type) => { diff --git a/devices.js b/devices.js index dd62f3e050052..e6087d7eb5f03 100644 --- a/devices.js +++ b/devices.js @@ -761,7 +761,14 @@ const devices = [ fz.ignore_occupancy_change, fz.generic_illuminance, fz.ignore_illuminance_change, fz.ignore_temperature_change, ], - toZigbee: [], + toZigbee: [tz.generic_occupancy_timeout], + ep: (device) => { + return { + '': 2, // default + 'ep1': 1, + 'ep2': 2, // e.g. for write to msOccupancySensing + }; + }, configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 2); From 5326f1e9d57c7c8c9f8895f2d8857a640a20197d Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 5 Jan 2019 16:11:07 +0100 Subject: [PATCH 429/676] added support for IKEA SURTE light door 38x64 (#195) * added support for IKEA SURTE light door 38x64 * removed example comments of ikea surte device --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index e6087d7eb5f03..b242528acd698 100644 --- a/devices.js +++ b/devices.js @@ -516,6 +516,15 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, + { + zigbeeModel: ['SURTE door WS 38x64'], + model: 'L1531', + vendor: 'IKEA', + description: 'SURTE door light panel, dimmable, white spectrum (38x64 cm)', + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + }, { zigbeeModel: ['TRADFRI control outlet'], model: 'E1603', From b8f7fb23c7248b9f00f294b1b78daa49f95ceae5 Mon Sep 17 00:00:00 2001 From: sebastianheierhoff <6094238+sebastianheierhoff@users.noreply.github.com> Date: Sat, 5 Jan 2019 20:49:57 +0100 Subject: [PATCH 430/676] Experimental ecozy support (WIP) (#132) * ecozy: Initial commit using foundation/write * Combined get/setOccupiedHeatingSetpoint * Fast forward to current master * Removing store[deviceID] * Remove store[deviceID] * Added further converters for ecozy * Fixing device configuration * Fixing Bind/ Report * Fixing ecozy * Fixing ecozy * Fixing ecozy * Fixing ecozy * Fixing ecozy * Fixing ecozy * Fixing ecozy * Fixing ecozy * Fixing ecozy * Fixing ecozy * Update devices.js * Update toZigbee.js * Update fromZigbee.js --- converters/fromZigbee.js | 62 ++++++- converters/toZigbee.js | 340 +++++++++++++++++++++++++++++++++++++++ devices.js | 37 +++++ 3 files changed, 438 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 07617ea7ecf90..3308dcae330ef 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1018,6 +1018,13 @@ const converters = { return {battery: precisionRound(msg.data.data['batteryPercentageRemaining'], 2) / 2}; }, }, + generic_battery_voltage: { + cid: 'genPowerCfg', + type: 'attReport', + convert: (model, msg, publish, options) => { + return {voltage: msg.data.data['batteryVoltage'] / 100}; + }, + }, ICTC_G_1_move: { cid: 'genLevelCtrl', type: 'cmdMove', @@ -1127,7 +1134,60 @@ const converters = { }; }, }, - + thermostat_dev_change: { + cid: 'hvacThermostat', + type: 'devChange', + convert: (model, msg, publish, options) => { + return { + local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100, + // Signed difference in 0.01 degrees Celsius between the previous temperature setpoint and the new + // temperature setpoint. + local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10, + // Specifies whether the heated/cooled space is occupied or not. + // If bit 0 = 1, the space is occupied, else it is unoccupied + occupancy: msg.data.data['occupancy'], + occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100, + unoccupied_heating_setpoint: precisionRound(msg.data.data['unoccupiedHeatingSetpoint'], 2) / 100, + // start_of_week: value.start_of_week, // 0x00 = Sunday to 0x06 = Saturday + // number_of_daily_transitions: value.number_of_daily_transitions, + // number_of_weeky_transitions: value.number_of_weeky_transitions, + weekly_schedule: msg.data.data['weeklySchedule'], + // The signed difference in 0.01 degrees Celsius between the previous temperature setpoint and + // the new temperature setpoint. + setpoint_change_amount: msg.data.data['setpointChangeAmount'] / 100, + // 0x00 Manual, user-initiated setpoint change via the thermostat + // 0x01 Schedule/internal programming-initiated setpoint change + // 0x02 Externally-initiated setpoint change (e.g., DRLC cluster command, attribute write) + setpoint_change_source: msg.data.data['setpointChangeSource'], + setpoint_change_source_timestamp: msg.data.data['setpointChangeSourceTimeStamp'], + remote_sensing: msg.data.data['remoteSensing'], + control_sequence_of_operation: msg.data.data['ctrlSeqeOfOper'], + system_mode: msg.data.data['systemMode'], + running_state: msg.data.data['runningState'], + }; + }, + }, + thermostat_att_report: { + cid: 'hvacThermostat', + type: 'attReport', + convert: (model, msg, publish, options) => { + return { + local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100, + local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10, + occupancy: msg.data.data['occupancy'], + occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100, + unoccupied_heating_setpoint: precisionRound(msg.data.data['unoccupiedHeatingSetpoint'], 2) / 100, + weekly_schedule: msg.data.data['weeklySchedule'], + setpoint_change_amount: msg.data.data['setpointChangeAmount'] / 100, + setpoint_change_source: msg.data.data['setpointChangeSource'], + setpoint_change_source_timestamp: msg.data.data['setpointChangeSourceTimeStamp'], + remote_sensing: msg.data.data['remoteSensing'], + control_sequence_of_operation: msg.data.data['ctrlSeqeOfOper'], + system_mode: msg.data.data['systemMode'], + running_state: msg.data.data['runningState'], + }; + }, + }, // Ignore converters (these message dont need parsing). ignore_doorlock_change: { cid: 'closuresDoorLock', diff --git a/converters/toZigbee.js b/converters/toZigbee.js index d142970c1fee3..1aff14ac99195 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -233,6 +233,346 @@ const converters = { } }, }, + thermostat_local_temperature: { + key: 'local_temperature', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'localTemp'; + if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_local_temperature_calibration: { + key: 'local_temperature_calibration', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'localTemperatureCalibration'; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: attrId, + dataType: zclId.attrType(cid, attrId).value, + attrData: Math.round(value * 10), + }], + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_occupancy: { + key: 'occupancy', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'ocupancy'; + if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_occupied_heating_setpoint: { + key: 'occupied_heating_setpoint', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'occupiedHeatingSetpoint'; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: zclId.attr(cid, attrId).value, + dataType: zclId.attrType(cid, attrId).value, + attrData: Math.round(value) * 100, + }], + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_unoccupied_heating_setpoint: { + key: 'unoccupied_heating_setpoint', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'unoccupiedHeatingSetpoint'; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: zclId.attr(cid, attrId).value, + dataType: zclId.attrType(cid, attrId).value, + attrData: Math.round(value) * 100, // TODO: Lookup in Zigbee documentation + }], + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_remote_sensing: { + key: 'remote_sensing', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'remoteSensing'; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + // Bit 0 = 0 – local temperature sensed internally + // Bit 0 = 1 – local temperature sensed remotely + // Bit 1 = 0 – outdoor temperature sensed internally + // Bit 1 = 1 – outdoor temperature sensed remotely + // Bit 2 = 0 – occupancy sensed internally + // Bit 2 = 1 – occupancy sensed remotely + attrId: zclId.attr(cid, attrId).value, + dataType: zclId.attrType(cid, attrId).value, + attrData: value, // TODO: Lookup in Zigbee documentation + }], + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_control_sequence_of_operation: { + key: 'control_sequence_of_operation', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'ctrlSeqeOfOper'; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + // 0x00 Cooling Only Heat and Emergency are not possible + // 0x01 Cooling With Reheat Heat and Emergency are not possible + // 0x02 Heating Only Cool and precooling are not possible + // 0x03 Heating With Reheat Cool and precooling are not possible + // 0x04 Cooling and Heating 4-pipes: All modes are possible + // 0x05 Cooling and Heating 4-pipes with Reheat: All modes are possible + attrId: zclId.attr(cid, attrId).value, + dataType: zclId.attrType(cid, attrId).value, + attrData: value, + }], + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_system_mode: { + key: 'system_mode', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'systemMode'; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + // 0x00 Off + // 0x01 Auto + // 0x03 Cool + // 0x04 Heat + // 0x05 Emergency heating + // 0x06 Precooling + // 0x07 Fan only + // 0x08 Dry + // 0x09 Sleep + attrId: zclId.attr(cid, attrId).value, + dataType: zclId.attrType(cid, attrId).value, + attrData: value, + }], + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_setpoint_raise_lower: { + key: 'setpoint_raise_lower', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'setpointRaiseLower'; + if (type === 'set') { + return { + cid: cid, + cmd: 'setpointRaiseLower', + cmdType: 'functional', + zclData: { + dataType: zclId.attrType(cid, attrId).value, + attrData: Math.round(value) * 100, // TODO: Combine mode and amount in attrData? + mode: value.mode, + amount: Math.round(value.amount) * 100, + }, + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_weekly_schedule: { + key: 'weekly_schedule', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'weeklySchedule'; + if (type === 'set') { + return { + cid: cid, + cmd: 'setWeeklySchedule', + cmdType: 'functional', + zclData: { + dataType: zclId.attrType(cid, attrId).value, + attrData: value, // TODO: Combine attributes in attrData? + temperature_setpoint_hold: value.temperature_setpoint_hold, + temperature_setpoint_hold_duration: value.temperature_setpoint_hold_duration, + thermostat_programming_operation_mode: value.thermostat_programming_operation_mode, + thermostat_running_state: value.thermostat_running_state, + }, + cfg: cfg.default, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'getWeeklySchedule', + cmdType: 'functional', + zclData: {}, + cfg: cfg.default, + }; + } + }, + }, + thermostat_clear_weekly_schedule: { + key: 'clear_weekly_schedule', + attr: [], + convert: (key, value, message, type) => { + return { + cid: 'hvacThermostat', + cmd: 'clearWeeklySchedule', + type: 'functional', + zclData: {}, + }; + }, + }, + thermostat_relay_status_log: { + key: 'relay_status_log', + attr: [], + convert: (key, value, message, type) => { + return { + cid: 'hvacThermostat', + cmd: 'getRelayStatusLog', + type: 'functional', + zclData: {}, + }; + }, + }, + thermostat_weekly_schedule_rsp: { + key: 'weekly_schedule_rsp', + attr: [], + convert: (key, value, message, type) => { + return { + cid: 'hvacThermostat', + cmd: 'getWeeklyScheduleRsp', + type: 'functional', + zclData: { + number_of_transitions: value.numoftrans, // TODO: Lookup in Zigbee documentation + day_of_week: value.dayofweek, + mode: value.mode, + thermoseqmode: value.thermoseqmode, + }, + }; + }, + }, + thermostat_relay_status_log_rsp: { + key: 'relay_status_log_rsp', + attr: [], + convert: (key, value, message, type) => { + return { + cid: 'hvacThermostat', + cmd: 'getRelayStatusLogRsp', + type: 'functional', + zclData: { + time_of_day: value.timeofday, // TODO: Lookup in Zigbee documentation + relay_status: value.relaystatus, + local_temperature: value.localtemp, + humidity: value.humidity, + setpoint: value.setpoint, + unread_entries: value.unreadentries, + }, + }; + }, + }, /* * Note when send the command to set sensitivity, press button on the device * to make it wakeup diff --git a/devices.js b/devices.js index b242528acd698..adc08dcd83cfe 100644 --- a/devices.js +++ b/devices.js @@ -878,6 +878,43 @@ const devices = [ }, }, + // eCozy + { + zigbeeModel: ['Thermostat'], + model: '1TST-EU', + vendor: 'eCozy', + description: 'Smart heating thermostat', + supports: 'temperature, occupancy, un-/occupied heating, schedule', + fromZigbee: [ + fz.ignore_basic_change, fz.generic_battery_voltage, + fz.thermostat_att_report, fz.thermostat_dev_change, + ], + toZigbee: [ + tz.factory_reset, tz.thermostat_local_temperature, tz.thermostat_local_temperature_calibration, + tz.thermostat_occupancy, tz.thermostat_occupied_heating_setpoint, + tz.thermostat_unoccupied_heating_setpoint, tz.thermostat_setpoint_raise_lower, + tz.thermostat_remote_sensing, tz.thermostat_control_sequence_of_operation, tz.thermostat_system_mode, + tz.thermostat_weekly_schedule, tz.thermostat_clear_weekly_schedule, tz.thermostat_weekly_schedule_rsp, + tz.thermostat_relay_status_log, tz.thermostat_relay_status_log_rsp, + ], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 3); + const actions = [ + // from https://github.com/ckpt-martin/Hubitat/blob/master/eCozy/eCozy-ZigBee-Thermostat-Driver.groovy + (cb) => device.bind('genBasic', coordinator, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('genIdentify', coordinator, cb), + (cb) => device.bind('genTime', coordinator, cb), + (cb) => device.bind('genPollCtrl', coordinator, cb), + (cb) => device.bind('hvacThermostat', coordinator, cb), + (cb) => device.bind('hvacUserInterfaceCfg', coordinator, cb), + (cb) => device.report('hvacThermostat', 'localTemp', 5, 30, 0, cb), + ]; + + execute(device, actions, callback); + }, + }, + // OSRAM { zigbeeModel: ['Outdoor Lantern W RGBW OSRAM'], From ae8469468ccae6466d44d5e999f871a0c6681c44 Mon Sep 17 00:00:00 2001 From: MarkAdamson Date: Sat, 5 Jan 2019 19:59:56 +0000 Subject: [PATCH 431/676] Add support for Hive HALIGHTDIMWWB22 (Bayonet mount) (#194) * Add support for Hive HALIGHTDIMWWB22 (Bayonet mount) * Update devices.js --- devices.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index adc08dcd83cfe..e39e73a2d7612 100644 --- a/devices.js +++ b/devices.js @@ -1119,7 +1119,16 @@ const devices = [ zigbeeModel: ['FWBulb01'], model: 'HALIGHTDIMWWE27', vendor: 'Hive', - description: 'Active light dimmable', + description: 'Active smart bulb white LED (E27)', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, + { + zigbeeModel: ['FWBulb02UK'], + model: 'HALIGHTDIMWWB22', + vendor: 'Hive', + description: 'Active smart bulb white LED (B22)', supports: generic.light_onoff_brightness.supports, fromZigbee: generic.light_onoff_brightness.fromZigbee, toZigbee: generic.light_onoff_brightness.toZigbee, From 83e1b760343a5cb2ab9171124356f123cf440e28 Mon Sep 17 00:00:00 2001 From: davidedmundson Date: Sat, 5 Jan 2019 20:09:37 +0000 Subject: [PATCH 432/676] Support Samsung SmartSense Multi (#192) * Support Samsung SmartSense Multi Support the contact attribute of the slightly older Samsung SmartThings range, "SmartSense Multi". * Update devices.js --- converters/fromZigbee.js | 12 ++++++++++++ devices.js | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3308dcae330ef..be7f523a96b22 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1134,6 +1134,17 @@ const converters = { }; }, }, + smartsense_multi: { + cid: 'ssIasZone', + type: 'attReport', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.data.zoneStatus; + return { + contact: !(zoneStatus & 1), // Bit 1 = Contact + // Bit 5 = Currently always set? + }; + }, + }, thermostat_dev_change: { cid: 'hvacThermostat', type: 'devChange', @@ -1188,6 +1199,7 @@ const converters = { }; }, }, + // Ignore converters (these message dont need parsing). ignore_doorlock_change: { cid: 'closuresDoorLock', diff --git a/devices.js b/devices.js index e39e73a2d7612..2cc6e0bfb5d7d 100644 --- a/devices.js +++ b/devices.js @@ -1732,6 +1732,31 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['3321-S'], + model: '3321-S', + vendor: 'SmartThings', + description: 'Multi Sensor (2015 model)', + supports: 'contact and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.smartsense_multi, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 300, 600, 1, cb), + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.report('ssIasZone', 'zoneStatus', 0, 1000, null, cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', { + enrollrspcode: 1, + zoneid: 23, + }, cb), + ]; + execute(device, actions, callback); + }, + }, // Trust { From 2a5a0d535e6213300939340a3eb33d8b82b2e392 Mon Sep 17 00:00:00 2001 From: Mark Grosen Date: Sun, 6 Jan 2019 05:40:39 -0800 Subject: [PATCH 433/676] Add GE 45856 light switch (#197) * Add GE 45856 light switch Only supports on/off - device also reports elecrical usage, but not supported yet. * Update devices.js --- devices.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/devices.js b/devices.js index 2cc6e0bfb5d7d..e851db17c3ef9 100644 --- a/devices.js +++ b/devices.js @@ -1454,6 +1454,25 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['45856'], + model: '45856GE', + vendor: 'GE', + description: 'In-wall smart switch', + supports: 'on/off', + fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + toZigbee: [tz.on_off, tz.ignore_transition], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, { zigbeeModel: ['45857'], model: '45857GE', From 3e0c2f61dbddbbe4374de142e743c1f961d4302e Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Sun, 6 Jan 2019 14:53:27 +0100 Subject: [PATCH 434/676] FNB56-SKT1EHG1.2 (#198) * GLEDOPTO GL-B-008Z * HGZB-20-DE https://www.amazon.de/Intelligente-Steckdose-kompatibel-SmartThings-Steuerung/dp/B07GYG5GRP * Update devices.js * Update devices.js * Update devices.js --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index e851db17c3ef9..7620dac48b6d2 100644 --- a/devices.js +++ b/devices.js @@ -2110,6 +2110,17 @@ const devices = [ fromZigbee: generic.light_onoff_brightness.fromZigbee, toZigbee: generic.light_onoff_brightness.toZigbee, }, + + // Smart Home Pty + { + zigbeeModel: ['FNB56-SKT1EHG1.2'], + model: 'HGZB-20-DE', + vendor: 'Smart Home Pty', + description: 'Power plug', + supports: 'on/off', + fromZigbee: [fz.generic_state_change], + toZigbee: [tz.on_off], + }, ]; module.exports = devices; From 18c255a08eee95eaebb16dfb188a2a9cb7cf7381 Mon Sep 17 00:00:00 2001 From: Kryzek Date: Sun, 6 Jan 2019 16:00:36 +0200 Subject: [PATCH 435/676] Airam Led OP A60 ZB 9W/827 E27 improvement & Airam Remote information (#196) * Airam Led OP A60 ZB 9W/827 E27 improvement & Airam Remote information * Update fromZigbee.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 9 +++++++++ devices.js | 24 +++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index be7f523a96b22..f476fdbd71714 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1134,6 +1134,15 @@ const converters = { }; }, }, + light_brightness_report: { + cid: 'genLevelCtrl', + type: 'attReport', + convert: (model, msg, publish, options) => { + return { + brightness: msg.data.data['currentLevel'], + }; + }, + }, smartsense_multi: { cid: 'ssIasZone', type: 'attReport', diff --git a/devices.js b/devices.js index 7620dac48b6d2..258545d70bff2 100644 --- a/devices.js +++ b/devices.js @@ -2107,8 +2107,30 @@ const devices = [ vendor: 'Airam', description: 'LED OP A60 ZB 9W/827 E27', supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, + fromZigbee: [fz.light_state, fz.light_brightness_report, fz.light_brightness, fz.light_state], toZigbee: generic.light_onoff_brightness.toZigbee, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 0, maxRepIntval: 1000, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, + { + zigbeeModel: ['ZBT-Remote-EU-DIMV1A2'], + model: 'AIRAM-CTR.U', + vendor: 'Airam', + description: 'CTR.U remote (can only be used to control the Airam 4713407 bulb)', + supports: 'on/off', + fromZigbee: [], + toZigbee: [], }, // Smart Home Pty From 69f8d25b218b2d15de59b1599babc4c125811156 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 6 Jan 2019 15:02:50 +0100 Subject: [PATCH 436/676] Log configure error. #768 --- devices.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index 258545d70bff2..586848a29b5f9 100644 --- a/devices.js +++ b/devices.js @@ -34,7 +34,7 @@ const foundationCfg = {manufSpec: 0, disDefaultRsp: 0}; const execute = (device, actions, callback, delay) => { if (!device) { - callback(false); + callback(false, 'No device'); return; } delay || (delay = 300); @@ -43,7 +43,7 @@ const execute = (device, actions, callback, delay) => { const next = () => { if (nextActionIndex === len) { - callback(true); + callback(true, ''); return; } @@ -54,7 +54,7 @@ const execute = (device, actions, callback, delay) => { (error) => { debug(`Configured '${nextAction.toString()}' with result '${error ? error : 'OK'}'`); if (error) { - callback(false); + callback(false, error); return; } next(); From 648e2ebe74fc844c347e09002da385e20001eab6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 6 Jan 2019 15:02:56 +0100 Subject: [PATCH 437/676] 7.0.10 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b8bf11744cbc7..a83e5104642d0 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.9", + "version": "7.0.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index be1fcd4b6ee3d..894b9414ff5ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.9", + "version": "7.0.10", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From f5ce1af7a2b438042b9d293f90248d5a0a06c0f6 Mon Sep 17 00:00:00 2001 From: boojew Date: Tue, 8 Jan 2019 12:46:27 -0500 Subject: [PATCH 438/676] Add Support for EcoSmart Bright White Bulbs (#200) * Update devices.js * Update devices.js * update --- devices.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/devices.js b/devices.js index 586848a29b5f9..de34b0c847696 100644 --- a/devices.js +++ b/devices.js @@ -2099,6 +2099,26 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, }, + { + // eslint-disable-next-line + zigbeeModel: ['\u0000\u0002\u0000\u0004\u0000\f^I\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000e'], + model: 'D1531', + vendor: 'EcoSmart', + description: 'A19 bright white bulb', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, + { + // eslint-disable-next-line + zigbeeModel: ['\u0000\u0002\u0000\u0004\u0012 �P\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000e'], + model: 'D1532', + vendor: 'EcoSmart', + description: 'A19 soft white bulb', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, // Airam { From 4a3529bdc557bef0162896c83f9e0961853e2ee5 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Tue, 8 Jan 2019 18:46:57 +0100 Subject: [PATCH 439/676] Bitron-Video Wall Thermostat (#199) * added Bitron Wall Thermostat * added Bitron fromZigbee convertes bitron_battery (should be usefull for all bitron battery powered devices) bitron_thermostat_att_report bitron_thermostat_dev_change * Update fromZigbee.js * Update devices.js * Update devices.js * Update devices.js * Update fromZigbee.js * Update toZigbee.js i changed the calculation of the input values so that you can also set half degrees. before: 21.3 -> 21.0 21.4 -> 21.0 21.5 -> 22.0 now: 21.3 -> 21.5 21.4 -> 21.5 21.5 -> 21.5 * Update fromZigbee.js * added temperature_display_mode + running_state * Update devices.js * Trailing spaces * Update fromZigbee.js * Update fromZigbee.js * Update fromZigbee.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 62 ++++++++++++++++++++++++++++++++++++++++ converters/toZigbee.js | 42 +++++++++++++++++++++++++-- devices.js | 36 +++++++++++++++++++++++ 3 files changed, 138 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index f476fdbd71714..54b322206c906 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -158,6 +158,68 @@ const converters = { return {occupancy: true}; }, }, + bitron_battery: { + cid: 'genPowerCfg', + type: 'attReport', + convert: (model, msg, publish, options) => { + const battery = {max: 3200, min: 2500}; + const voltage = msg.data.data['batteryVoltage'] * 100; + return { + battery: toPercentage(voltage, battery.min, battery.max), + voltage: voltage, + }; + }, + }, + bitron_thermostat_att_report: { + cid: 'hvacThermostat', + type: 'attReport', + convert: (model, msg, publish, options) => { + const result = {}; + if (typeof msg.data.data['localTemp'] == 'number') { + result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; + } + if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { + result.local_temperature_calibration = + precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; + } + if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { + result.occupied_heating_setpoint = + precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; + } + if (typeof msg.data.data['runningState'] == 'number') { + result.running_state = msg.data.data['runningState']; + } + if (typeof msg.data.data['batteryAlarmState'] == 'number') { + result.battery_alarm_state = msg.data.data['batteryAlarmState']; + } + return result; + }, + }, + bitron_thermostat_dev_change: { + cid: 'hvacThermostat', + type: 'devChange', + convert: (model, msg, publish, options) => { + const result = {}; + if (typeof msg.data.data['localTemp'] == 'number') { + result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; + } + if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { + result.local_temperature_calibration = + precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; + } + if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { + result.occupied_heating_setpoint = + precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; + } + if (typeof msg.data.data['runningState'] == 'number') { + result.running_state = msg.data.data['runningState']; + } + if (typeof msg.data.data['batteryAlarmState'] == 'number') { + result.battery_alarm_state = msg.data.data['batteryAlarmState']; + } + return result; + }, + }, smartthings_contact: { cid: 'ssIasZone', type: 'statusChange', diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 1aff14ac99195..2fe3d0084e955 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -305,7 +305,7 @@ const converters = { zclData: [{ attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, - attrData: Math.round(value) * 100, + attrData: (Math.round((value * 2).toFixed(1))/2).toFixed(1) * 100, }], cfg: cfg.default, }; @@ -333,7 +333,7 @@ const converters = { zclData: [{ attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, - attrData: Math.round(value) * 100, // TODO: Lookup in Zigbee documentation + attrData: (Math.round((value * 2).toFixed(1))/2).toFixed(1) * 100, }], cfg: cfg.default, }; @@ -573,6 +573,44 @@ const converters = { }; }, }, + thermostat_running_state: { + key: 'running_state', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'runningState'; + if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, + thermostat_temperature_display_mode: { + key: 'temperature_display_mode', + convert: (key, value, message, type) => { + const cid = 'hvacUserInterfaceCfg'; + const attrId = 'tempDisplayMode'; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + // 0x00 Temperature in °C + // 0x01 Temperature in °F + attrId: zclId.attr(cid, attrId).value, + dataType: zclId.attrType(cid, attrId).value, + attrData: value, + }], + cfg: cfg.default, + }; + } + }, + }, /* * Note when send the command to set sensitivity, press button on the device * to make it wakeup diff --git a/devices.js b/devices.js index de34b0c847696..29b1345b571b6 100644 --- a/devices.js +++ b/devices.js @@ -1881,6 +1881,42 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['902010/32'], + model: 'AV2010/32', + vendor: 'Bitron', + description: 'Wireless wall thermostat with relay', + supports: 'temperature, heating/cooling system control', + fromZigbee: [ + fz.ignore_basic_change, fz.bitron_thermostat_att_report, + fz.bitron_thermostat_dev_change, fz.bitron_battery, + ], + toZigbee: [ + tz.thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature_calibration, + tz.thermostat_local_temperature, tz.thermostat_running_state, + tz.thermostat_temperature_display_mode, + ], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genBasic', coordinator, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('genIdentify', coordinator, cb), + (cb) => device.bind('genTime', coordinator, cb), + (cb) => device.bind('genPollCtrl', coordinator, cb), + (cb) => device.bind('hvacThermostat', coordinator, cb), + (cb) => device.bind('hvacUserInterfaceCfg', coordinator, cb), + (cb) => device.report('hvacThermostat', 'localTemp', 300, 3600, 0, cb), + (cb) => device.report('hvacThermostat', 'localTemperatureCalibration', 1, 0, 0, cb), + (cb) => device.report('hvacThermostat', 'occupiedHeatingSetpoint', 1, 0, 1, cb), + (cb) => device.report('hvacThermostat', 'runningState', 1, 0, 0, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 43200, 0, cb), + (cb) => device.report('genPowerCfg', 'batteryAlarmState', 1, 0, 1, cb), + ]; + + execute(device, actions, callback); + }, + }, // Iris { From 80d2bade0adcfeb977836857597bb6312d844708 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Tue, 8 Jan 2019 18:54:06 +0100 Subject: [PATCH 440/676] FB56-ZCW11HG1.2 (#202) * GLEDOPTO GL-B-008Z * HGZB-20-DE https://www.amazon.de/Intelligente-Steckdose-kompatibel-SmartThings-Steuerung/dp/B07GYG5GRP * Update devices.js * Update devices.js * Update devices.js * FB56-ZCW11HG1.2 https://uploads.tapatalk-cdn.com/20190106/dcf0f59343233342d004319d05c04bc0.jpg * FB56-ZCW11HG1.2 * FB56-ZCW11HG1.2 i miss this device * rebase * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 29b1345b571b6..3ea0d0d486332 100644 --- a/devices.js +++ b/devices.js @@ -2190,6 +2190,15 @@ const devices = [ }, // Smart Home Pty + { + zigbeeModel: ['FB56-ZCW11HG1.2'], + model: 'HGZB-07A', + vendor: 'Smart Home Pty', + description: 'RGBW Downlight', + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + }, { zigbeeModel: ['FNB56-SKT1EHG1.2'], model: 'HGZB-20-DE', From 0dba40904e8460799c25a4ad37922c4ad5bf5314 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 8 Jan 2019 19:11:01 +0100 Subject: [PATCH 441/676] Filter non-realistic WSDCGQ11LM and WSDCGQ01LM temperature reports. https://github.com/Koenkk/zigbee2mqtt/issues/798 --- converters/fromZigbee.js | 14 ++++++++++++++ devices.js | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 54b322206c906..ed44964794feb 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -314,6 +314,20 @@ const converters = { return {temperature: precisionRoundOptions(temperature, options, 'temperature')}; }, }, + xiaomi_temperature: { + cid: 'msTemperatureMeasurement', + type: 'attReport', + convert: (model, msg, publish, options) => { + const temperature = parseFloat(msg.data.data['measuredValue']) / 100.0; + + // https://github.com/Koenkk/zigbee2mqtt/issues/798 + // Sometimes the sensor publishes non-realistic vales, as the sensor only works from + // -20 till +60, don't produce messages beyond these values. + if (temperature > -25 && temperature < 65) { + return {temperature: precisionRoundOptions(temperature, options, 'temperature')}; + } + }, + }, MFKZQ01LM_action_multistate: { cid: 'genMultistateInput', type: 'attReport', diff --git a/devices.js b/devices.js index 3ea0d0d486332..f4a8999d9188d 100644 --- a/devices.js +++ b/devices.js @@ -202,7 +202,7 @@ const devices = [ description: 'MiJia temperature & humidity sensor ', supports: 'temperature and humidity', fromZigbee: [ - fz.xiaomi_battery_3v, fz.WSDCGQ01LM_WSDCGQ11LM_interval, fz.generic_temperature, fz.xiaomi_humidity, + fz.xiaomi_battery_3v, fz.WSDCGQ01LM_WSDCGQ11LM_interval, fz.xiaomi_temperature, fz.xiaomi_humidity, fz.ignore_basic_change, ], toZigbee: [], @@ -214,7 +214,7 @@ const devices = [ description: 'Aqara temperature, humidity and pressure sensor', supports: 'temperature, humidity and pressure', fromZigbee: [ - fz.xiaomi_battery_3v, fz.generic_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, + fz.xiaomi_battery_3v, fz.xiaomi_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, fz.ignore_basic_change, fz.ignore_temperature_change, fz.ignore_humidity_change, fz.ignore_pressure_change, fz.WSDCGQ01LM_WSDCGQ11LM_interval, ], From 3e2e4409881b44df38c046d9737001e4d3e56353 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 8 Jan 2019 19:13:53 +0100 Subject: [PATCH 442/676] Filter non-realistic WSDCGQ11LM and WSDCGQ01LM humidity reports. https://github.com/Koenkk/zigbee2mqtt/issues/798 --- converters/fromZigbee.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index ed44964794feb..68585469bbc53 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -419,7 +419,13 @@ const converters = { type: 'attReport', convert: (model, msg, publish, options) => { const humidity = parseFloat(msg.data.data['measuredValue']) / 100.0; - return {humidity: precisionRoundOptions(humidity, options, 'humidity')}; + + // https://github.com/Koenkk/zigbee2mqtt/issues/798 + // Sometimes the sensor publishes non-realistic vales, it should only publish message + // in the 0 - 100 range, don't produce messages beyond these values. + if (humidity >= 0 && humidity <= 100) { + return {humidity: precisionRoundOptions(humidity, options, 'humidity')}; + } }, }, generic_occupancy: { From de6cb7907f0246e2d706ab4efcbfa10a13ce00d6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 8 Jan 2019 19:24:12 +0100 Subject: [PATCH 443/676] 7.0.11 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a83e5104642d0..86f4bdba20d00 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.10", + "version": "7.0.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 894b9414ff5ad..e4e0977d18734 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.10", + "version": "7.0.11", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 5f272ef7d1916565d8b1123110001a9461209456 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 8 Jan 2019 21:48:42 +0100 Subject: [PATCH 444/676] Support E1524. https://github.com/Koenkk/zigbee2mqtt/issues/102 --- converters/fromZigbee.js | 77 ++++++++++++++++++++++++++++++++++++++++ devices.js | 16 +++++++++ 2 files changed, 93 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 68585469bbc53..064b9beda3609 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1290,6 +1290,83 @@ const converters = { }; }, }, + E1524_toggle: { + cid: 'genOnOff', + type: 'cmdToggle', + convert: (model, msg, publish, options) => { + return {action: 'toggle'}; + }, + }, + E1524_arrow_click: { + cid: 'genScenes', + type: 'cmdTradfriArrowSingle', + convert: (model, msg, publish, options) => { + const direction = msg.data.data.value === 257 ? 'left' : 'right'; + return {action: `arrow_${direction}_click`}; + }, + }, + E1524_arrow_hold: { + cid: 'genScenes', + type: 'cmdTradfriArrowHold', + convert: (model, msg, publish, options) => { + const direction = msg.data.data.value === 3329 ? 'left' : 'right'; + store[msg.endpoints[0].device.ieeeAddr] = direction; + return {action: `arrow_${direction}_hold`}; + }, + }, + E1524_arrow_release: { + cid: 'genScenes', + type: 'cmdTradfriArrowRelease', + convert: (model, msg, publish, options) => { + const direction = store[msg.endpoints[0].device.ieeeAddr]; + if (direction) { + delete store[msg.endpoints[0].device.ieeeAddr]; + return {action: `arrow_${direction}_release`, duration: msg.data.data.value / 1000}; + } + }, + }, + E1524_brightness_up_click: { + cid: 'genLevelCtrl', + type: 'cmdStepWithOnOff', + convert: (model, msg, publish, options) => { + return {action: `brightness_up_click`}; + }, + }, + E1524_brightness_down_click: { + cid: 'genLevelCtrl', + type: 'cmdStep', + convert: (model, msg, publish, options) => { + return {action: `brightness_down_click`}; + }, + }, + E1524_brightness_up_hold: { + cid: 'genLevelCtrl', + type: 'cmdMoveWithOnOff', + convert: (model, msg, publish, options) => { + return {action: `brightness_up_hold`}; + }, + }, + E1524_brightness_up_release: { + cid: 'genLevelCtrl', + type: 'cmdStopWithOnOff', + convert: (model, msg, publish, options) => { + return {action: `brightness_up_release`}; + }, + }, + E1524_brightness_down_hold: { + cid: 'genLevelCtrl', + type: 'cmdMove', + convert: (model, msg, publish, options) => { + return {action: `brightness_down_hold`}; + }, + }, + E1524_brightness_down_release: { + cid: 'genLevelCtrl', + type: 'cmdStop', + convert: (model, msg, publish, options) => { + return {action: `brightness_down_release`}; + }, + }, // Ignore converters (these message dont need parsing). ignore_doorlock_change: { diff --git a/devices.js b/devices.js index f4a8999d9188d..fd139922a20d8 100644 --- a/devices.js +++ b/devices.js @@ -544,6 +544,22 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['TRADFRI remote control'], + model: 'E1524', + description: 'TRADFRI remote control', + supports: + 'toggle, arrow left/right click/hold/release, brightness up/down click/hold/release ' + + '(**[requires additional setup!]' + + '(https://github.com/Koenkk/zigbee2mqtt/blob/dev/docs/getting_started/pairing_devices.md)**)', + vendor: 'IKEA', + fromZigbee: [ + fz.E1524_toggle, fz.E1524_arrow_click, fz.E1524_arrow_hold, fz.E1524_arrow_release, + fz.E1524_brightness_up_click, fz.E1524_brightness_down_click, fz.E1524_brightness_up_hold, + fz.E1524_brightness_up_release, fz.E1524_brightness_down_hold, fz.E1524_brightness_down_release, + ], + toZigbee: [], + }, // Philips { From cdfac7959ca661461ffc228933c5f6686cf5b630 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 8 Jan 2019 21:48:50 +0100 Subject: [PATCH 445/676] 7.0.12 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 86f4bdba20d00..f0a7934e16c24 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.11", + "version": "7.0.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e4e0977d18734..45e95b624bce1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.11", + "version": "7.0.12", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 5a0342b2cbc8ff5c065ed3cfa1b161e927c4268f Mon Sep 17 00:00:00 2001 From: mkventure <42322917+mkventure@users.noreply.github.com> Date: Wed, 9 Jan 2019 14:56:38 -0500 Subject: [PATCH 446/676] Update devices.js to include Nue HGZB-01A (#203) * Update device.js to include Nue HGZB-01A Device is a mains inline zigbee light controller with brightness. Amazon link: https://www.amazon.com/gp/product/B07FBD96DG/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1 Added and tested device per: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html * remove extranious tab that fails check * Fixed the rest of the tabs - still figuring this out... sorry. * adding space back... * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index fd139922a20d8..a1d067a0c8a06 100644 --- a/devices.js +++ b/devices.js @@ -1631,6 +1631,15 @@ const devices = [ return {'left': 12, 'right': 11}; }, }, + { + zigbeeModel: ['FNB56-ZSW23HG1.1'], + model: 'HGZB-01A', + vendor: 'Nue', + description: 'ZigBee smart light controller', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, // Gledopto { From 70452f8ff8486ea1a6a705295ccaf34f4cd6e0e8 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 10 Jan 2019 17:38:12 +0100 Subject: [PATCH 447/676] Add RTCGQ11LM illuminance interval report. https://github.com/Koenkk/zigbee2mqtt/issues/827 --- converters/fromZigbee.js | 9 +++++++++ devices.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 064b9beda3609..debf1a3014e10 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -247,6 +247,15 @@ const converters = { } }, }, + RTCGQ11LM_interval: { + cid: 'genBasic', + type: 'attReport', + convert: (model, msg, publish, options) => { + if (msg.data.data['65281']) { + return {illuminance: msg.data.data['65281']['11']}; + } + }, + }, WSDCGQ01LM_WSDCGQ11LM_interval: { cid: 'genBasic', type: 'attReport', diff --git a/devices.js b/devices.js index a1d067a0c8a06..242212b30c40a 100644 --- a/devices.js +++ b/devices.js @@ -237,7 +237,7 @@ const devices = [ supports: 'occupancy and illuminance', fromZigbee: [ fz.xiaomi_battery_3v, fz.generic_occupancy_no_off_msg, fz.generic_illuminance, fz.ignore_basic_change, - fz.ignore_illuminance_change, fz.ignore_occupancy_change, + fz.ignore_illuminance_change, fz.ignore_occupancy_change, fz.RTCGQ11LM_interval, ], toZigbee: [], }, From abb8387417470071a0cf1ab4de57e0be112c44e8 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 10 Jan 2019 17:38:44 +0100 Subject: [PATCH 448/676] 7.0.13 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index f0a7934e16c24..f24c82b665727 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.12", + "version": "7.0.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 45e95b624bce1..30c42b4afc2ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.12", + "version": "7.0.13", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From 4c00561d3c1ad3796f35605f44e344301ee94f06 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 10 Jan 2019 18:19:53 +0100 Subject: [PATCH 449/676] Support TRADFRI wireless dimmer battery. https://github.com/Koenkk/zigbee2mqtt/issues/792 --- converters/fromZigbee.js | 9 +++++++++ devices.js | 17 +++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index debf1a3014e10..e4c49e94156de 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1103,6 +1103,15 @@ const converters = { }, }, generic_battery: { + cid: 'genPowerCfg', + type: 'attReport', + convert: (model, msg, publish, options) => { + if (msg.data.data.hasOwnProperty('batteryPercentageRemaining')) { + return {battery: msg.data.data['batteryPercentageRemaining']}; + } + }, + }, + hue_battery: { cid: 'genPowerCfg', type: 'attReport', convert: (model, msg, publish, options) => { diff --git a/devices.js b/devices.js index 242212b30c40a..4c562c9e1b455 100644 --- a/devices.js +++ b/devices.js @@ -4,6 +4,10 @@ const debug = require('debug')('zigbee-shepherd-converters:devices'); const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); +const seconds = { + ONE_DAY: 86400, +}; + const generic = { light_onoff_brightness: { supports: 'on/off, brightness', @@ -463,12 +467,17 @@ const devices = [ supports: 'brightness [0-255], quick rotate for instant 0/255', fromZigbee: [ fz.ICTC_G_1_move, fz.ICTC_G_1_moveWithOnOff, fz.ICTC_G_1_stop, fz.ICTC_G_1_stopWithOnOff, - fz.ICTC_G_1_moveToLevelWithOnOff, + fz.ICTC_G_1_moveToLevelWithOnOff, fz.generic_battery, fz.ignore_power_change, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); - execute(device, [(cb) => device.bind('genLevelCtrl', coordinator, cb)], callback); + const actions = [ + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, seconds.ONE_DAY, 0, cb), + ]; + execute(device, actions, callback); }, }, { @@ -750,7 +759,7 @@ const devices = [ supports: 'on/off', fromZigbee: [ fz._324131092621_on, fz._324131092621_off, fz._324131092621_step, fz._324131092621_stop, - fz.ignore_power_change, fz.generic_battery, + fz.ignore_power_change, fz.hue_battery, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { @@ -782,7 +791,7 @@ const devices = [ description: 'Hue motion sensor', supports: 'occupancy, temperature, illuminance', fromZigbee: [ - fz.generic_battery, fz.generic_occupancy, fz.generic_temperature, + fz.hue_battery, fz.generic_occupancy, fz.generic_temperature, fz.ignore_occupancy_change, fz.generic_illuminance, fz.ignore_illuminance_change, fz.ignore_temperature_change, ], From 3df28a79aa1e7cd2de3aed7b34c2325f90fd69b4 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 10 Jan 2019 18:20:03 +0100 Subject: [PATCH 450/676] 7.0.14 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index f24c82b665727..a27ada40a8376 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.13", + "version": "7.0.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30c42b4afc2ca..5a4e5e7d509f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.13", + "version": "7.0.14", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "repository": { From a9eb7fd979bc5935b7e892ff03d4ecdc60417acb Mon Sep 17 00:00:00 2001 From: netztrip <40369349+netztrip@users.noreply.github.com> Date: Thu, 10 Jan 2019 21:13:11 +0100 Subject: [PATCH 451/676] Add support for Gledopto Zigbee LED controller WW/CW Dimmer (GL-C-006) (#204) --- devices.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/devices.js b/devices.js index 4c562c9e1b455..6f887bc356103 100644 --- a/devices.js +++ b/devices.js @@ -1669,6 +1669,24 @@ const devices = [ } }, }, + { + zigbeeModel: ['GL-C-006'], + model: 'GL-C-006', + vendor: 'Gledopto', + description: 'Zigbee LED controller WW/CW Dimmer', + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + ep: (device) => { + if (device.epList.toString() === '11,12,13') { + return {'': 12}; + } else if (device.epList.toString() === '10,11,13' || device.epList.toString() === '11,13') { + return {'': 11}; + } else { + return {}; + } + }, + }, { zigbeeModel: ['GL-S-007Z'], model: 'GL-S-007Z', From 7c3876f0cc9157eaf5ecf4594983af8def265d03 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 11 Jan 2019 23:04:40 +0100 Subject: [PATCH 452/676] Support 100.424.11. https://github.com/Koenkk/zigbee2mqtt/issues/803 --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index 6f887bc356103..d2a1e6c40739c 100644 --- a/devices.js +++ b/devices.js @@ -2260,6 +2260,17 @@ const devices = [ fromZigbee: [fz.generic_state_change], toZigbee: [tz.on_off], }, + + // Paul Neuhaus + { + zigbeeModel: ['NLG-CCT light '], + model: '100.424.11', + vendor: 'Paul Neuhaus', + description: 'Q-INIGO LED ceiling light', + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + }, ]; module.exports = devices; From d65aa5b6aa16e18d17da63040a50449e479585c5 Mon Sep 17 00:00:00 2001 From: Sander <3908728+sheyden@users.noreply.github.com> Date: Sun, 13 Jan 2019 17:30:39 +0100 Subject: [PATCH 453/676] Add device support for iCasa Zigbee 3.0 Dimmer (#206) * Add device support for iCasa Zigbee 3.0 Dimmer * Update devices.js --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index d2a1e6c40739c..957daba4877bd 100644 --- a/devices.js +++ b/devices.js @@ -2271,6 +2271,17 @@ const devices = [ fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, + + // iCasa + { + zigbeeModel: ['ICZB-IW11D'], + model: 'ICZB-IW11D', + vendor: 'iCasa', + description: 'Zigbee 3.0 Dimmer', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, ]; module.exports = devices; From f0e27ca677809cd85c7eeb21b9fd247ded2d1420 Mon Sep 17 00:00:00 2001 From: Mihal Malostanidis Date: Sun, 13 Jan 2019 18:41:49 +0200 Subject: [PATCH 454/676] Refactors (#207) * Add Iris 3326-L motion and temperature sensor * Use scoped zcl-id * Only package needed files * refactor: Use a Map for findByZigbeeModel * Add `extend` attribute The attribute shallow-merges the model object, with the explicitly defined properties taking precidence Converted all uses of `generic` to `extend` format. --- .eslintrc.json | 1 + converters/toZigbee.js | 2 +- devices.js | 448 +++++++++++------------------------------ index.js | 11 +- npm-shrinkwrap.json | 18 +- package.json | 6 +- 6 files changed, 140 insertions(+), 346 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 3bf858f497e2e..3da300a8d7b87 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,6 @@ { "env": { + "es6": true, "node": true }, "extends": ["eslint:recommended", "google"], diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 2fe3d0084e955..be952f584e87b 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,7 +1,7 @@ 'use strict'; const utils = require('./utils'); -const zclId = require('zcl-id'); +const zclId = require('@zigbee/zcl-id'); const cfg = { default: { diff --git a/devices.js b/devices.js index 957daba4877bd..cf96c036961da 100644 --- a/devices.js +++ b/devices.js @@ -76,13 +76,12 @@ const devices = [ model: 'ZNLDP12LM', vendor: 'Xiaomi', description: 'Aqara smart LED bulb', - supports: generic.light_onoff_brightness_colortemp.supports, + extend: generic.light_onoff_brightness_colortemp, fromZigbee: [ fz.light_brightness, fz.light_color_colortemp, fz.generic_state, fz.xiaomi_bulb_interval, fz.ignore_light_brightness_report, fz.ignore_light_color_colortemp_report, fz.ignore_onoff_change, fz.ignore_basic_change, ], - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, }, { zigbeeModel: ['lumi.sensor_switch'], @@ -380,72 +379,56 @@ const devices = [ model: 'LED1545G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['TRADFRI bulb E27 WS clear 950lm', 'TRADFRI bulb E26 WS clear 950lm'], model: 'LED1546G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26/E27 950 lumen, dimmable, white spectrum, clear', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['TRADFRI bulb E27 opal 1000lm', 'TRADFRI bulb E27 W opal 1000lm'], model: 'LED1623G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, opal white', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['TRADFRI bulb GU10 WS 400lm'], model: 'LED1537R6', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable, white spectrum', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['TRADFRI bulb GU10 W 400lm'], model: 'LED1650R5', vendor: 'IKEA', description: 'TRADFRI LED bulb GU10 400 lumen, dimmable', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['TRADFRI bulb E14 WS opal 400lm', 'TRADFRI bulb E12 WS opal 400lm'], model: 'LED1536G5', vendor: 'IKEA', description: 'TRADFRI LED bulb E12/E14 400 lumen, dimmable, white spectrum, opal white', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['TRADFRI bulb E26 opal 1000lm', 'TRADFRI bulb E26 W opal 1000lm'], model: 'LED1622G12', vendor: 'IKEA', description: 'TRADFRI LED bulb E26 1000 lumen, dimmable, opal white', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['TRADFRI bulb E27 CWS opal 600lm', 'TRADFRI bulb E26 CWS opal 600lm'], model: 'LED1624G9', vendor: 'IKEA', description: 'TRADFRI LED bulb E27/E26 600 lumen, dimmable, color, opal white', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: [ @@ -455,9 +438,7 @@ const devices = [ model: 'LED1649C5', vendor: 'IKEA', description: 'TRADFRI LED bulb E12/E14/E17 400 lumen, dimmable warm white, chandelier opal', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['TRADFRI wireless dimmer'], @@ -485,54 +466,42 @@ const devices = [ model: 'ICPSHC24-10EU-IL-1', vendor: 'IKEA', description: 'TRADFRI driver for wireless control (10 watt)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['TRADFRI transformer 30W'], model: 'ICPSHC24-30EU-IL-1', vendor: 'IKEA', description: 'TRADFRI driver for wireless control (30 watt)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['FLOALT panel WS 30x30'], model: 'L1527', vendor: 'IKEA', description: 'FLOALT LED light panel, dimmable, white spectrum (30x30 cm)', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['FLOALT panel WS 60x60'], model: 'L1529', vendor: 'IKEA', description: 'FLOALT LED light panel, dimmable, white spectrum (60x60 cm)', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['FLOALT panel WS 30x90'], model: 'L1528', vendor: 'IKEA', description: 'FLOALT LED light panel, dimmable, white spectrum (30x90 cm)', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['SURTE door WS 38x64'], model: 'L1531', vendor: 'IKEA', description: 'SURTE door light panel, dimmable, white spectrum (38x64 cm)', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['TRADFRI control outlet'], @@ -576,180 +545,140 @@ const devices = [ model: '7299760PH', vendor: 'Philips', description: 'Hue Bloom', - supports: generic.light_onoff_brightness_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LLC020'], model: '7146060PH', vendor: 'Philips', description: 'Hue Go', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LWB004'], model: '433714', vendor: 'Philips', description: 'Hue Lux A19 bulb E27', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['LWB006', 'LWB014'], model: '9290011370', vendor: 'Philips', description: 'Hue white A60 bulb E27', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['LWB010'], model: '8718696449691', vendor: 'Philips', description: 'Hue White Single bulb B22', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['LST001'], model: '7299355PH', vendor: 'Philips', description: 'Hue white and color ambiance LightStrip', - supports: generic.light_onoff_brightness_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LST002'], model: '915005106701', vendor: 'Philips', description: 'Hue white and color ambiance LightStrip plus', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT012', 'LCT014', 'LCT015', 'LCT016'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E26/E27/E14', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LCT002'], model: '9290002579A', vendor: 'Philips', description: 'Hue white and color ambiance BR30', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LCT003'], model: '8718696485880', vendor: 'Philips', description: 'Hue white and color ambiance GU10', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LCT024'], model: '915005733701', vendor: 'Philips', description: 'Hue White and color ambiance Play Lightbar', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LTW011'], model: '464800', vendor: 'Philips', description: 'Hue white ambiance BR30 flood light', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTW012'], model: '8718696695203', vendor: 'Philips', description: 'Hue white ambiance E14', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTW013'], model: '8718696598283', vendor: 'Philips', description: 'Hue white ambiance GU10', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTW010', 'LTW001', 'LTW004'], model: '8718696548738', vendor: 'Philips', description: 'Hue white ambiance E26/E27', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTC001'], model: '3261030P7', vendor: 'Philips', description: 'Hue Being', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTC003'], model: '3261331P7', vendor: 'Philips', description: 'Hue white ambiance Still', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTC015'], model: '3216331P5', vendor: 'Philips', description: 'Hue white ambiance Aurelle rectangle panel light', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTC016'], model: '3216431P5', vendor: 'Philips', description: 'Hue white ambiance Aurelle round panel light', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LLC010'], model: '7199960PH', vendor: 'Philips', description: 'Hue Iris', - supports: generic.light_onoff_brightness_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['RWL020', 'RWL021'], @@ -827,9 +756,7 @@ const devices = [ model: 'F7C033', vendor: 'Belkin', description: 'WeMo smart LED bulb', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, // EDP @@ -946,36 +873,28 @@ const devices = [ model: '4058075816718', vendor: 'OSRAM', description: 'SMART+ outdoor wall lantern RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['Classic A60 RGBW'], model: 'AA69697', vendor: 'OSRAM', description: 'Classic A60 RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['CLA60 RGBW OSRAM'], model: 'AC03645', vendor: 'OSRAM', description: 'LIGHTIFY LED CLA60 E27 RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['CLA60 TW OSRAM'], model: 'AC03642', vendor: 'OSRAM', description: 'SMART+ CLASSIC A 60 TW', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { // AA70155 is model number of both bulbs. @@ -983,63 +902,49 @@ const devices = [ model: 'AA70155', vendor: 'OSRAM', description: 'LIGHTIFY LED A19 tunable white / Classic A60 TW', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['PAR16 50 TW'], model: 'AA68199', vendor: 'OSRAM', description: 'LIGHTIFY LED PAR16 50 GU10 tunable white', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['Classic B40 TW - LIGHTIFY'], model: 'AB32840', vendor: 'OSRAM', description: 'LIGHTIFY LED Classic B40 tunable white', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['Ceiling TW OSRAM'], model: '4058075816794', vendor: 'OSRAM', description: 'Smart+ Ceiling TW', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['Classic A60 W clear - LIGHTIFY'], model: 'AC03641', vendor: 'OSRAM', description: 'LIGHTIFY LED Classic A60 clear', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['Surface Light W �C LIGHTIFY'], model: '4052899926158', vendor: 'OSRAM', description: 'LIGHTIFY Surface Light TW', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['Surface Light TW'], model: 'AB401130055', vendor: 'OSRAM', description: 'LIGHTIFY Surface Light LED Tunable White', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['Plug 01'], @@ -1065,45 +970,35 @@ const devices = [ model: '4052899926110', vendor: 'OSRAM', description: 'Flex RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LIGHTIFY Outdoor Flex RGBW'], model: '4058075036185', vendor: 'OSRAM', description: 'Outdoor Flex RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['Gardenpole RGBW-Lightify'], model: '4058075036147', vendor: 'OSRAM', description: 'Smart+ Gardenpole RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['PAR 16 50 RGBW - LIGHTIFY'], model: 'AB35996', vendor: 'OSRAM', description: 'Smart+ Spot GU10 Multicolor', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['B40 DIM Z3'], model: 'AC08562', vendor: 'OSRAM', description: 'SMART+ Candle E14 Dimmable White', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['Motion Sensor-A'], @@ -1134,9 +1029,7 @@ const devices = [ model: 'AC03648', vendor: 'OSRAM', description: 'SMART+ spot GU5.3 tunable white', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, // Hive @@ -1145,18 +1038,14 @@ const devices = [ model: 'HALIGHTDIMWWE27', vendor: 'Hive', description: 'Active smart bulb white LED (E27)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['FWBulb02UK'], model: 'HALIGHTDIMWWB22', vendor: 'Hive', description: 'Active smart bulb white LED (B22)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, // Innr @@ -1165,171 +1054,133 @@ const devices = [ model: 'RB 185 C', vendor: 'Innr', description: 'E27 Bulb RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['BY 185 C'], model: 'BY 185 C', vendor: 'Innr', description: 'B22 Bulb RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['RB 285 C'], model: 'RB 285 C', vendor: 'Innr', description: 'E27 Bulb RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['RB 165'], model: 'RB 165', vendor: 'Innr', description: 'E27 Bulb', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['RB 175 W'], model: 'RB 175 W', vendor: 'Innr', description: 'E27 Bulb warm dimming', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['RB 178 T'], model: 'RB 178 T', vendor: 'Innr', description: 'Smart bulb tunable white E27', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['RS 125'], model: 'RS 125', vendor: 'Innr', description: 'GU10 Spot', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['RS 128 T'], model: 'RS 128 T', vendor: 'Innr', description: 'GU10 Spot 350 lm, dimmable, white spectrum', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['RB 145'], model: 'RB 145', vendor: 'Innr', description: 'E14 Candle', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['RB 248 T'], model: 'RB 248 T', vendor: 'Innr', description: 'E14 Candle with white spectrum', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['BY 165', 'BY 265'], model: 'BY 165', vendor: 'Innr', description: 'B22 Bulb dimmable', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['PL 110'], model: 'PL 110', vendor: 'Innr', description: 'Puck Light', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['ST 110'], model: 'ST 110', vendor: 'Innr', description: 'Strip Light', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['UC 110'], model: 'UC 110', vendor: 'Innr', description: 'Under Cabinet Light', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['DL 110 N'], model: 'DL 110 N', vendor: 'Innr', description: 'Spot narrow', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['DL 110 W'], model: 'DL 110 W', vendor: 'Innr', description: 'Spot wide', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['SL 110 N'], model: 'SL 110 N', vendor: 'Innr', description: 'Spot Flex narrow', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['SL 110 M'], model: 'SL 110 M', vendor: 'Innr', description: 'Spot Flex medium', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['SL 110 W'], model: 'SL 110 W', vendor: 'Innr', description: 'Spot Flex wide', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['SP 120'], @@ -1372,45 +1223,35 @@ const devices = [ model: '73742', vendor: 'Sylvania', description: 'LIGHTIFY LED adjustable white RT 5/6', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LIGHTIFY BR Tunable White'], model: '73740', vendor: 'Sylvania', description: 'LIGHTIFY LED adjustable white BR30', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LIGHTIFY A19 RGBW'], model: '73693', vendor: 'Sylvania', description: 'LIGHTIFY LED RGBW A19', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM', 'LIGHTIFY A19 ON/OFF/DIM 10 Year'], model: '74283', vendor: 'Sylvania', description: 'LIGHTIFY LED soft white dimmable A19', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['A19 W 10 year'], model: '74696', vendor: 'Sylvania', description: 'LIGHTIFY LED soft white dimmable A19', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['PLUG'], @@ -1436,18 +1277,14 @@ const devices = [ model: '74282', vendor: 'Sylvania', description: 'Smart Home adjustable white MR16 LED bulb', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LIGHTIFY Gardenspot RGB'], model: 'LTFY004', vendor: 'Sylvania', description: 'LIGHTIFY LED gardenspot mini RGB', - supports: generic.light_onoff_brightness_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, // GE @@ -1456,9 +1293,7 @@ const devices = [ model: '22670', vendor: 'GE', description: 'Link smart LED light bulb, BR30 soft white (2700K)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['45852'], @@ -1524,54 +1359,42 @@ const devices = [ model: 'E11-G13', vendor: 'Sengled', description: 'Element Classic (A19)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['E11-G23', 'E11-G33'], model: 'E11-G23/E11-G33', vendor: 'Sengled', description: 'Element Classic (A60)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['Z01-CIA19NAE26'], model: 'Z01-CIA19NAE26', vendor: 'Sengled', description: 'Element Touch (A19)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['Z01-A19NAE26'], model: 'Z01-A19NAE26', vendor: 'Sengled', description: 'Element Plus (A19)', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, { zigbeeModel: ['E11-N1EA'], model: 'E11-N1EA', vendor: 'Sengled', description: 'Element Plus Color (A19)', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['E12-N14'], model: 'E12-N14', vendor: 'Sengled', description: 'Element Classic (BR30)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, // JIAWEN @@ -1580,9 +1403,7 @@ const devices = [ model: 'K2RGBW01', vendor: 'JIAWEN', description: 'Wireless Bulb E27 9W RGBW', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, // Netvox @@ -1613,9 +1434,7 @@ const devices = [ model: 'NL08-0800', vendor: 'Nanoleaf', description: 'Smart Ivy Bulb E27', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, // Nue @@ -1645,9 +1464,7 @@ const devices = [ model: 'HGZB-01A', vendor: 'Nue', description: 'ZigBee smart light controller', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, // Gledopto @@ -1656,9 +1473,7 @@ const devices = [ model: 'GL-C-008', vendor: 'Gledopto', description: 'Zigbee LED controller RGB + CCT / RGBW / WWCW / Dimmer', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1674,9 +1489,7 @@ const devices = [ model: 'GL-C-006', vendor: 'Gledopto', description: 'Zigbee LED controller WW/CW Dimmer', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1692,9 +1505,7 @@ const devices = [ model: 'GL-S-007Z', vendor: 'Gledopto', description: 'Smart RGBW GU10', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1710,9 +1521,7 @@ const devices = [ model: 'GL-B-008Z', vendor: 'Gledopto', description: 'Smart 12W E27 RGB / CW LED bulb', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1728,9 +1537,7 @@ const devices = [ model: 'GL-D-003Z', vendor: 'Gledopto', description: 'LED RGB + CCT downlight ', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1746,9 +1553,7 @@ const devices = [ model: 'GD-CZ-006', vendor: 'Gledopto', description: 'Zigbee LED Driver', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, // SmartThings @@ -1835,9 +1640,7 @@ const devices = [ model: 'ZLED-2709', vendor: 'Trust', description: 'Smart Dimmable LED Bulb', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['VMS_ADUROLIGHT'], @@ -1882,18 +1685,14 @@ const devices = [ model: '50045', vendor: 'Paulmann', description: 'SmartHome Zigbee LED-stripe', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { zigbeeModel: ['RGBW light'], model: '50049', vendor: 'Paulmann', description: 'SmartHome Yourled RGB Controller', - supports: generic.light_onoff_brightness_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, // Bitron @@ -1992,7 +1791,7 @@ const devices = [ zigbeeModel: ['3326-L'], model: '3326-L', vendor: 'Iris', - description: 'Motion sensor', + description: 'Motion and temperature sensor', supports: 'occupancy and temperature', fromZigbee: [ fz.generic_temperature, fz.ignore_temperature_change, fz.ias_zone_motion_dev_change, @@ -2048,9 +1847,7 @@ const devices = [ model: '53170161', vendor: 'Commercial Electric', description: 'Matte White Recessed Retrofit Smart Led Downlight - 4 Inch', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, // ilux @@ -2059,9 +1856,7 @@ const devices = [ model: '900008-WW', vendor: 'ilux', description: 'Dimmable A60 E27 LED Bulb', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, // Dresden Elektronik @@ -2070,9 +1865,7 @@ const devices = [ model: 'Mega23M12', vendor: 'Dresden Elektronik', description: 'ZigBee Light Link wireless electronic ballast', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, // Centralite Swiss Plug @@ -2172,9 +1965,7 @@ const devices = [ model: '421786', vendor: 'Calex', description: 'LED A60 Zigbee GLS-lamp', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, // EcoSmart @@ -2183,9 +1974,7 @@ const devices = [ model: 'D1821', vendor: 'EcoSmart', description: 'A19 RGB bulb', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { // eslint-disable-next-line @@ -2193,9 +1982,7 @@ const devices = [ model: 'D1531', vendor: 'EcoSmart', description: 'A19 bright white bulb', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, { // eslint-disable-next-line @@ -2203,9 +1990,7 @@ const devices = [ model: 'D1532', vendor: 'EcoSmart', description: 'A19 soft white bulb', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, // Airam @@ -2214,9 +1999,8 @@ const devices = [ model: '4713407', vendor: 'Airam', description: 'LED OP A60 ZB 9W/827 E27', - supports: generic.light_onoff_brightness.supports, + extend: generic.light_onoff_brightness, fromZigbee: [fz.light_state, fz.light_brightness_report, fz.light_brightness, fz.light_state], - toZigbee: generic.light_onoff_brightness.toZigbee, configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; @@ -2247,9 +2031,7 @@ const devices = [ model: 'HGZB-07A', vendor: 'Smart Home Pty', description: 'RGBW Downlight', - supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: ['FNB56-SKT1EHG1.2'], @@ -2267,9 +2049,7 @@ const devices = [ model: '100.424.11', vendor: 'Paul Neuhaus', description: 'Q-INIGO LED ceiling light', - supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, - toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + extend: generic.light_onoff_brightness_colortemp, }, // iCasa @@ -2284,4 +2064,6 @@ const devices = [ }, ]; -module.exports = devices; +module.exports = devices.map((device) => + device.extend ? Object.assign({}, device.extend, device) : device +); diff --git a/index.js b/index.js index 2ba330bd2b062..9cbdfb0a5b9f1 100644 --- a/index.js +++ b/index.js @@ -4,9 +4,16 @@ const devices = require('./devices'); const toZigbee = require('./converters/toZigbee'); const fromZigbee = require('./converters/fromZigbee'); +const byZigbeeModel = new Map(); +for (const device of devices) { + for (const zigbeeModel of device.zigbeeModel) { + byZigbeeModel.set(zigbeeModel, device); + } +} + module.exports = { - devices: devices, - findByZigbeeModel: (model) => devices.find((d) => d.zigbeeModel.includes(model)), + devices, + findByZigbeeModel: (model) => byZigbeeModel.get(model), toZigbeeConverters: toZigbee, fromZigbeeConverters: fromZigbee, }; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a27ada40a8376..314c9ba4e055e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -24,6 +24,15 @@ "js-tokens": "^4.0.0" } }, + "@zigbee/zcl-id": { + "version": "0.5.0-2", + "resolved": "https://registry.npmjs.org/@zigbee/zcl-id/-/zcl-id-0.5.0-2.tgz", + "integrity": "sha512-TwM+I9rOvVyI5r3TipAAGCBVDshdedlo9xYCY+WmBlKXeF3GQhaCV5vFkEEaIUa3O9oa2+gIFnFjLiccxl7EPg==", + "requires": { + "busyman": "^0.3.0", + "enum": "^2.5.0" + } + }, "acorn": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", @@ -961,15 +970,6 @@ "requires": { "mkdirp": "^0.5.1" } - }, - "zcl-id": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/zcl-id/-/zcl-id-0.4.0.tgz", - "integrity": "sha512-XN7diHjvF/qQmrs78xURDEpZcw7Y5+R0ScuNwR3X+xfUfJo94Dj9UGkKniSzOATEZWlLZjg/P23y4GwKFRMptA==", - "requires": { - "busyman": "^0.3.0", - "enum": "^2.5.0" - } } } } diff --git a/package.json b/package.json index 5a4e5e7d509f3..f7e2468691a61 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,10 @@ "version": "7.0.14", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", + "files": [ + "/index.js", + "/converters" + ], "repository": { "type": "git", "url": "git+https://github.com/Koenkk/zigbee-shepherd-converters.git" @@ -26,8 +30,8 @@ }, "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", "dependencies": { + "@zigbee/zcl-id": "^0.5.0-2", "debounce": "*", - "zcl-id": "*", "debug": "3.2.6" }, "devDependencies": { From bbaea2efa8ecc0f737544b8684567ddc16e8e0c5 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 13 Jan 2019 18:14:07 +0100 Subject: [PATCH 455/676] Fix missing color temperature from #207 --- devices.js | 56 ++++++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/devices.js b/devices.js index cf96c036961da..d4d18bc21c62a 100644 --- a/devices.js +++ b/devices.js @@ -552,7 +552,7 @@ const devices = [ model: '7146060PH', vendor: 'Philips', description: 'Hue Go', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LWB004'], @@ -587,35 +587,35 @@ const devices = [ model: '915005106701', vendor: 'Philips', description: 'Hue white and color ambiance LightStrip plus', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT012', 'LCT014', 'LCT015', 'LCT016'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E26/E27/E14', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LCT002'], model: '9290002579A', vendor: 'Philips', description: 'Hue white and color ambiance BR30', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LCT003'], model: '8718696485880', vendor: 'Philips', description: 'Hue white and color ambiance GU10', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LCT024'], model: '915005733701', vendor: 'Philips', description: 'Hue White and color ambiance Play Lightbar', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LTW011'], @@ -873,21 +873,21 @@ const devices = [ model: '4058075816718', vendor: 'OSRAM', description: 'SMART+ outdoor wall lantern RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['Classic A60 RGBW'], model: 'AA69697', vendor: 'OSRAM', description: 'Classic A60 RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['CLA60 RGBW OSRAM'], model: 'AC03645', vendor: 'OSRAM', description: 'LIGHTIFY LED CLA60 E27 RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['CLA60 TW OSRAM'], @@ -970,28 +970,28 @@ const devices = [ model: '4052899926110', vendor: 'OSRAM', description: 'Flex RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LIGHTIFY Outdoor Flex RGBW'], model: '4058075036185', vendor: 'OSRAM', description: 'Outdoor Flex RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['Gardenpole RGBW-Lightify'], model: '4058075036147', vendor: 'OSRAM', description: 'Smart+ Gardenpole RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['PAR 16 50 RGBW - LIGHTIFY'], model: 'AB35996', vendor: 'OSRAM', description: 'Smart+ Spot GU10 Multicolor', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['B40 DIM Z3'], @@ -1054,21 +1054,21 @@ const devices = [ model: 'RB 185 C', vendor: 'Innr', description: 'E27 Bulb RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['BY 185 C'], model: 'BY 185 C', vendor: 'Innr', description: 'B22 Bulb RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['RB 285 C'], model: 'RB 285 C', vendor: 'Innr', description: 'E27 Bulb RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['RB 165'], @@ -1237,7 +1237,7 @@ const devices = [ model: '73693', vendor: 'Sylvania', description: 'LIGHTIFY LED RGBW A19', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM', 'LIGHTIFY A19 ON/OFF/DIM 10 Year'], @@ -1387,7 +1387,7 @@ const devices = [ model: 'E11-N1EA', vendor: 'Sengled', description: 'Element Plus Color (A19)', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['E12-N14'], @@ -1403,7 +1403,7 @@ const devices = [ model: 'K2RGBW01', vendor: 'JIAWEN', description: 'Wireless Bulb E27 9W RGBW', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, // Netvox @@ -1473,7 +1473,7 @@ const devices = [ model: 'GL-C-008', vendor: 'Gledopto', description: 'Zigbee LED controller RGB + CCT / RGBW / WWCW / Dimmer', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1505,7 +1505,7 @@ const devices = [ model: 'GL-S-007Z', vendor: 'Gledopto', description: 'Smart RGBW GU10', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1521,7 +1521,7 @@ const devices = [ model: 'GL-B-008Z', vendor: 'Gledopto', description: 'Smart 12W E27 RGB / CW LED bulb', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1537,7 +1537,7 @@ const devices = [ model: 'GL-D-003Z', vendor: 'Gledopto', description: 'LED RGB + CCT downlight ', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1865,7 +1865,7 @@ const devices = [ model: 'Mega23M12', vendor: 'Dresden Elektronik', description: 'ZigBee Light Link wireless electronic ballast', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, // Centralite Swiss Plug @@ -1974,7 +1974,7 @@ const devices = [ model: 'D1821', vendor: 'EcoSmart', description: 'A19 RGB bulb', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { // eslint-disable-next-line @@ -2031,7 +2031,7 @@ const devices = [ model: 'HGZB-07A', vendor: 'Smart Home Pty', description: 'RGBW Downlight', - extend: generic.light_onoff_brightness_colorxy, + extend: generic.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['FNB56-SKT1EHG1.2'], @@ -2058,9 +2058,7 @@ const devices = [ model: 'ICZB-IW11D', vendor: 'iCasa', description: 'Zigbee 3.0 Dimmer', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, + extend: generic.light_onoff_brightness, }, ]; From 1a53cc6e144e641e2b3d19cb7084090471bf6f9e Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 13 Jan 2019 18:18:32 +0100 Subject: [PATCH 456/676] Hue power-on behavior (#209) * added Hue Power-on Converter tested with GU10. needs Firmware 1.46 hue_power_on_behavior // default / enable / disable / configure hue_power_on_behavior, // default = 1 // on - lamps on after power loss with configured brightness, color temperature, color // off - lamps off after power loss // recover - lamps on after power loss with last state hue_power_on_brightness // brightness when hue_power_on_behavior = on, same settings as brightness converter // default = 255 hue_power_on_color_temperature // color temperature when hue_power_on_behavior = on, same settings as colortemp converter // default = 366 to-do: hue_power_on_color (must be added by someone with appropriate bulb) * Update toZigbee.js * Hue specific settings generic hue settings with power-on converter * Update toZigbee.js * fixed 'null' values as discussed here: https://github.com/Koenkk/zigbee2mqtt/issues/848 * Update fromZigbee.js * Update fromZigbee.js * Update toZigbee.js * Update devices.js * Update devices.js --- converters/toZigbee.js | 67 ++++++++++++++++++++++++++++++++++++++++++ devices.js | 64 +++++++++++++++++++++++++++------------- 2 files changed, 111 insertions(+), 20 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index be952f584e87b..68a577533055d 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -91,6 +91,73 @@ const converters = { } }, }, + hue_power_on_behavior: { + key: ['hue_power_on_behavior'], + convert: (key, value, message, type) => { + const lookup = { + 'default': 0x01, + 'on': 0x01, + 'off': 0x00, + 'recover': 0xff, + }; + + if (type === 'set') { + return { + cid: 'genOnOff', + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: 0x4003, + dataType: 0x30, + attrData: lookup[value], + }], + cfg: cfg.default, + }; + } + }, + }, + hue_power_on_brightness: { + key: ['hue_power_on_brightness'], + convert: (key, value, message, type) => { + if (type === 'set') { + if (value === 'default') { + value = 255; + } + return { + cid: 'genLevelCtrl', + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: 0x4000, + dataType: 0x20, + attrData: value, + }], + cfg: cfg.default, + }; + } + }, + }, + hue_power_on_color_temperature: { + key: ['hue_power_on_color_temperature'], + convert: (key, value, message, type) => { + if (type === 'set') { + if (value === 'default') { + value = 366; + } + return { + cid: 'lightingColorCtrl', + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: 0x4010, + dataType: 0x21, + attrData: value, + }], + cfg: cfg.default, + }; + } + }, + }, light_brightness: { key: ['brightness', 'brightness_percent'], convert: (key, value, message, type) => { diff --git a/devices.js b/devices.js index d4d18bc21c62a..f76ac31ce3dfe 100644 --- a/devices.js +++ b/devices.js @@ -34,6 +34,30 @@ const generic = { }, }; +const tzHuePowerOnBehavior = [tz.hue_power_on_behavior, tz.hue_power_on_brightness, tz.hue_power_on_color_temperature]; +const hue = { + light_onoff_brightness: { + supports: generic.light_onoff_brightness.supports + ', power-on behavior', + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee.concat(tzHuePowerOnBehavior), + }, + light_onoff_brightness_colortemp: { + supports: generic.light_onoff_brightness_colortemp.supports + ', power-on behavior', + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee.concat(tzHuePowerOnBehavior), + }, + light_onoff_brightness_colorxy: { + supports: generic.light_onoff_brightness_colorxy.supports + ', power-on behavior', + fromZigbee: generic.light_onoff_brightness_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colorxy.toZigbee.concat(tzHuePowerOnBehavior), + }, + light_onoff_brightness_colortemp_colorxy: { + supports: generic.light_onoff_brightness_colortemp_colorxy.supports + ', power-on behavior', + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee.concat(tzHuePowerOnBehavior), + }, +}; + const foundationCfg = {manufSpec: 0, disDefaultRsp: 0}; const execute = (device, actions, callback, delay) => { @@ -545,140 +569,140 @@ const devices = [ model: '7299760PH', vendor: 'Philips', description: 'Hue Bloom', - extend: generic.light_onoff_brightness_colorxy, + extend: hue.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LLC020'], model: '7146060PH', vendor: 'Philips', description: 'Hue Go', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: hue.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LWB004'], model: '433714', vendor: 'Philips', description: 'Hue Lux A19 bulb E27', - extend: generic.light_onoff_brightness, + extend: hue.light_onoff_brightness, }, { zigbeeModel: ['LWB006', 'LWB014'], model: '9290011370', vendor: 'Philips', description: 'Hue white A60 bulb E27', - extend: generic.light_onoff_brightness, + extend: hue.light_onoff_brightness, }, { zigbeeModel: ['LWB010'], model: '8718696449691', vendor: 'Philips', description: 'Hue White Single bulb B22', - extend: generic.light_onoff_brightness, + extend: hue.light_onoff_brightness, }, { zigbeeModel: ['LST001'], model: '7299355PH', vendor: 'Philips', description: 'Hue white and color ambiance LightStrip', - extend: generic.light_onoff_brightness_colorxy, + extend: hue.light_onoff_brightness_colorxy, }, { zigbeeModel: ['LST002'], model: '915005106701', vendor: 'Philips', description: 'Hue white and color ambiance LightStrip plus', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: hue.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LCT001', 'LCT007', 'LCT010', 'LCT012', 'LCT014', 'LCT015', 'LCT016'], model: '9290012573A', vendor: 'Philips', description: 'Hue white and color ambiance E26/E27/E14', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: hue.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LCT002'], model: '9290002579A', vendor: 'Philips', description: 'Hue white and color ambiance BR30', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: hue.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LCT003'], model: '8718696485880', vendor: 'Philips', description: 'Hue white and color ambiance GU10', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: hue.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LCT024'], model: '915005733701', vendor: 'Philips', description: 'Hue White and color ambiance Play Lightbar', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: hue.light_onoff_brightness_colortemp_colorxy, }, { zigbeeModel: ['LTW011'], model: '464800', vendor: 'Philips', description: 'Hue white ambiance BR30 flood light', - extend: generic.light_onoff_brightness_colortemp, + extend: hue.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTW012'], model: '8718696695203', vendor: 'Philips', description: 'Hue white ambiance E14', - extend: generic.light_onoff_brightness_colortemp, + extend: hue.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTW013'], model: '8718696598283', vendor: 'Philips', description: 'Hue white ambiance GU10', - extend: generic.light_onoff_brightness_colortemp, + extend: hue.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTW010', 'LTW001', 'LTW004'], model: '8718696548738', vendor: 'Philips', description: 'Hue white ambiance E26/E27', - extend: generic.light_onoff_brightness_colortemp, + extend: hue.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTC001'], model: '3261030P7', vendor: 'Philips', description: 'Hue Being', - extend: generic.light_onoff_brightness_colortemp, + extend: hue.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTC003'], model: '3261331P7', vendor: 'Philips', description: 'Hue white ambiance Still', - extend: generic.light_onoff_brightness_colortemp, + extend: hue.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTC015'], model: '3216331P5', vendor: 'Philips', description: 'Hue white ambiance Aurelle rectangle panel light', - extend: generic.light_onoff_brightness_colortemp, + extend: hue.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LTC016'], model: '3216431P5', vendor: 'Philips', description: 'Hue white ambiance Aurelle round panel light', - extend: generic.light_onoff_brightness_colortemp, + extend: hue.light_onoff_brightness_colortemp, }, { zigbeeModel: ['LLC010'], model: '7199960PH', vendor: 'Philips', description: 'Hue Iris', - extend: generic.light_onoff_brightness_colorxy, + extend: hue.light_onoff_brightness_colorxy, }, { zigbeeModel: ['RWL020', 'RWL021'], From 907de29c74bca898a130537e0eda75cd57cd17b6 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Sun, 13 Jan 2019 18:38:34 +0100 Subject: [PATCH 457/676] fixed 'null' values in thermostat converters. (#210) * fixed 'null' values in thermostat converters. as discussed here: https://github.com/Koenkk/zigbee2mqtt/issues/848 * Update fromZigbee.js * Update fromZigbee.js * Update fromZigbee.js * Update fromZigbee.js * Update fromZigbee.js * Update fromZigbee.js --- converters/fromZigbee.js | 130 ++++++++++++++++++++++++++------------- 1 file changed, 88 insertions(+), 42 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index e4c49e94156de..a6b2ace63b2ca 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1258,54 +1258,100 @@ const converters = { cid: 'hvacThermostat', type: 'devChange', convert: (model, msg, publish, options) => { - return { - local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100, - // Signed difference in 0.01 degrees Celsius between the previous temperature setpoint and the new - // temperature setpoint. - local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10, - // Specifies whether the heated/cooled space is occupied or not. - // If bit 0 = 1, the space is occupied, else it is unoccupied - occupancy: msg.data.data['occupancy'], - occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100, - unoccupied_heating_setpoint: precisionRound(msg.data.data['unoccupiedHeatingSetpoint'], 2) / 100, - // start_of_week: value.start_of_week, // 0x00 = Sunday to 0x06 = Saturday - // number_of_daily_transitions: value.number_of_daily_transitions, - // number_of_weeky_transitions: value.number_of_weeky_transitions, - weekly_schedule: msg.data.data['weeklySchedule'], - // The signed difference in 0.01 degrees Celsius between the previous temperature setpoint and - // the new temperature setpoint. - setpoint_change_amount: msg.data.data['setpointChangeAmount'] / 100, - // 0x00 Manual, user-initiated setpoint change via the thermostat - // 0x01 Schedule/internal programming-initiated setpoint change - // 0x02 Externally-initiated setpoint change (e.g., DRLC cluster command, attribute write) - setpoint_change_source: msg.data.data['setpointChangeSource'], - setpoint_change_source_timestamp: msg.data.data['setpointChangeSourceTimeStamp'], - remote_sensing: msg.data.data['remoteSensing'], - control_sequence_of_operation: msg.data.data['ctrlSeqeOfOper'], - system_mode: msg.data.data['systemMode'], - running_state: msg.data.data['runningState'], - }; + const result = {}; + if (typeof msg.data.data['localTemp'] == 'number') { + result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; + } + if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { + result.local_temperature_calibration = + precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; + } + if (typeof msg.data.data['occupancy'] == 'number') { + result.occupancy = msg.data.data['occupancy']; + } + if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { + result.occupied_heating_setpoint = + precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; + } + if (typeof msg.data.data['unoccupiedHeatingSetpoint'] == 'number') { + result.unoccupied_heating_setpoint = + precisionRound(msg.data.data['unoccupiedHeatingSetpoint'], 2) / 100; + } + if (typeof msg.data.data['weeklySchedule'] == 'number') { + result.weekly_schedule = msg.data.data['weeklySchedule']; + } + if (typeof msg.data.data['setpointChangeAmount'] == 'number') { + result.setpoint_change_amount = msg.data.data['setpointChangeAmount'] / 100; + } + if (typeof msg.data.data['setpointChangeSource'] == 'number') { + result.setpoint_change_source = msg.data.data['setpointChangeSource']; + } + if (typeof msg.data.data['setpointChangeSourceTimeStamp'] == 'number') { + result.setpoint_change_source_timestamp = msg.data.data['setpointChangeSourceTimeStamp']; + } + if (typeof msg.data.data['remoteSensing'] == 'number') { + result.remote_sensing = msg.data.data['remoteSensing']; + } + if (typeof msg.data.data['ctrlSeqeOfOper'] == 'number') { + result.control_sequence_of_operation = msg.data.data['ctrlSeqeOfOper']; + } + if (typeof msg.data.data['systemMode'] == 'number') { + result.system_mode = msg.data.data['systemMode']; + } + if (typeof msg.data.data['runningState'] == 'number') { + result.running_state = msg.data.data['runningState']; + } + return result; }, }, thermostat_att_report: { cid: 'hvacThermostat', type: 'attReport', convert: (model, msg, publish, options) => { - return { - local_temperature: precisionRound(msg.data.data['localTemp'], 2) / 100, - local_temperature_calibration: precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10, - occupancy: msg.data.data['occupancy'], - occupied_heating_setpoint: precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100, - unoccupied_heating_setpoint: precisionRound(msg.data.data['unoccupiedHeatingSetpoint'], 2) / 100, - weekly_schedule: msg.data.data['weeklySchedule'], - setpoint_change_amount: msg.data.data['setpointChangeAmount'] / 100, - setpoint_change_source: msg.data.data['setpointChangeSource'], - setpoint_change_source_timestamp: msg.data.data['setpointChangeSourceTimeStamp'], - remote_sensing: msg.data.data['remoteSensing'], - control_sequence_of_operation: msg.data.data['ctrlSeqeOfOper'], - system_mode: msg.data.data['systemMode'], - running_state: msg.data.data['runningState'], - }; + const result = {}; + if (typeof msg.data.data['localTemp'] == 'number') { + result.local_temperature = precisionRound(msg.data.data['localTemp'], 2) / 100; + } + if (typeof msg.data.data['localTemperatureCalibration'] == 'number') { + result.local_temperature_calibration = + precisionRound(msg.data.data['localTemperatureCalibration'], 2) / 10; + } + if (typeof msg.data.data['occupancy'] == 'number') { + result.occupancy = msg.data.data['occupancy']; + } + if (typeof msg.data.data['occupiedHeatingSetpoint'] == 'number') { + result.occupied_heating_setpoint = + precisionRound(msg.data.data['occupiedHeatingSetpoint'], 2) / 100; + } + if (typeof msg.data.data['unoccupiedHeatingSetpoint'] == 'number') { + result.unoccupied_heating_setpoint = + precisionRound(msg.data.data['unoccupiedHeatingSetpoint'], 2) / 100; + } + if (typeof msg.data.data['weeklySchedule'] == 'number') { + result.weekly_schedule = msg.data.data['weeklySchedule']; + } + if (typeof msg.data.data['setpointChangeAmount'] == 'number') { + result.setpoint_change_amount = msg.data.data['setpointChangeAmount'] / 100; + } + if (typeof msg.data.data['setpointChangeSource'] == 'number') { + result.setpoint_change_source = msg.data.data['setpointChangeSource']; + } + if (typeof msg.data.data['setpointChangeSourceTimeStamp'] == 'number') { + result.setpoint_change_source_timestamp = msg.data.data['setpointChangeSourceTimeStamp']; + } + if (typeof msg.data.data['remoteSensing'] == 'number') { + result.remote_sensing = msg.data.data['remoteSensing']; + } + if (typeof msg.data.data['ctrlSeqeOfOper'] == 'number') { + result.control_sequence_of_operation = msg.data.data['ctrlSeqeOfOper']; + } + if (typeof msg.data.data['systemMode'] == 'number') { + result.system_mode = msg.data.data['systemMode']; + } + if (typeof msg.data.data['runningState'] == 'number') { + result.running_state = msg.data.data['runningState']; + } + return result; }, }, E1524_toggle: { From 07ea0db9e3e23c32bc74916c34d6aa11a2bcf041 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 13 Jan 2019 18:46:04 +0100 Subject: [PATCH 458/676] 7.0.15 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 314c9ba4e055e..a7b1f0b545aaa 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.14", + "version": "7.0.15", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f7e2468691a61..9588dad7f94a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.14", + "version": "7.0.15", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 40c312922932bea03186f1bbd12f06c450ce63d6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 13 Jan 2019 18:57:56 +0100 Subject: [PATCH 459/676] Add devices.js to files. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9588dad7f94a8..fc69de1b2d77a 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "index.js", "files": [ "/index.js", - "/converters" + "/converters", + "/devices.js" ], "repository": { "type": "git", From 79ba11350070c94da8835662d3db0f76b4f58999 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 13 Jan 2019 18:57:59 +0100 Subject: [PATCH 460/676] 7.0.16 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a7b1f0b545aaa..45d7702aae7eb 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.15", + "version": "7.0.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index fc69de1b2d77a..92f7ab5c4f7a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.15", + "version": "7.0.16", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From bf38d8421250dfadb223c3b21806d900b13a9601 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 14 Jan 2019 17:21:12 +0100 Subject: [PATCH 461/676] Trim null characters on spaces when searching for zigbee model. https://github.com/Koenkk/zigbee2mqtt/issues/810 --- .travis.yml | 1 + converters/toZigbee.js | 2 +- index.js | 10 +- npm-shrinkwrap.json | 338 +++++++++++++++++++++++++++++------------ package.json | 11 +- test/index.test.js | 19 +++ 6 files changed, 282 insertions(+), 99 deletions(-) create mode 100644 test/index.test.js diff --git a/.travis.yml b/.travis.yml index 8280989b91a1b..2777eef7f4079 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ install: - npm install script: + - npm test - npm run verify - npm run eslint diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 68a577533055d..83575d06bc39b 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,7 +1,7 @@ 'use strict'; const utils = require('./utils'); -const zclId = require('@zigbee/zcl-id'); +const zclId = require('zcl-id'); const cfg = { default: { diff --git a/index.js b/index.js index 9cbdfb0a5b9f1..54fe11f834418 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,15 @@ for (const device of devices) { module.exports = { devices, - findByZigbeeModel: (model) => byZigbeeModel.get(model), + findByZigbeeModel: (model) => { + let device = byZigbeeModel.get(model); + + if (!device) { + device = byZigbeeModel.get(model.replace(/\0.*$/g,'').trim()); + } + + return device; + }, toZigbeeConverters: toZigbee, fromZigbeeConverters: fromZigbee, }; diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 45d7702aae7eb..41089d4e972cc 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -24,19 +24,10 @@ "js-tokens": "^4.0.0" } }, - "@zigbee/zcl-id": { - "version": "0.5.0-2", - "resolved": "https://registry.npmjs.org/@zigbee/zcl-id/-/zcl-id-0.5.0-2.tgz", - "integrity": "sha512-TwM+I9rOvVyI5r3TipAAGCBVDshdedlo9xYCY+WmBlKXeF3GQhaCV5vFkEEaIUa3O9oa2+gIFnFjLiccxl7EPg==", - "requires": { - "busyman": "^0.3.0", - "enum": "^2.5.0" - } - }, "acorn": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.4.tgz", - "integrity": "sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==", + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.5.tgz", + "integrity": "sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg==", "dev": true }, "acorn-jsx": { @@ -46,9 +37,9 @@ "dev": true }, "ajv": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", - "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", + "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -59,7 +50,7 @@ }, "ansi-escapes": { "version": "3.1.0", - "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", "dev": true }, @@ -87,6 +78,17 @@ "sprintf-js": "~1.0.2" } }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -103,30 +105,40 @@ "concat-map": "0.0.1" } }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, "busyman": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/busyman/-/busyman-0.3.0.tgz", "integrity": "sha1-FN6kn2JgfOSy0wsgPGMG72zKiKc=" }, - "caller-path": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", - "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", - "dev": true, - "requires": { - "callsites": "^0.2.0" - } - }, "callsites": { - "version": "0.2.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", - "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", + "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", "dev": true }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -140,6 +152,11 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" + }, "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", @@ -176,6 +193,12 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -208,12 +231,26 @@ "ms": "^2.1.1" } }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -238,9 +275,9 @@ "dev": true }, "eslint": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.9.0.tgz", - "integrity": "sha512-g4KWpPdqN0nth+goDNICNXGfJF7nNnepthp46CAlJoJtC5K/cLu3NgCM3AHu1CkJ5Hzt9V0Y0PBAO6Ay/gGb+w==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.12.0.tgz", + "integrity": "sha512-LntwyPxtOHrsJdcSwyQKVtHofPHdv+4+mFwEe91r2V13vqpM8yLr7b1sW+Oo/yheOPkWYsYlYJCkzlFAt8KV7g==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -252,7 +289,7 @@ "eslint-scope": "^4.0.0", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", - "espree": "^4.0.0", + "espree": "^5.0.0", "esquery": "^1.0.1", "esutils": "^2.0.2", "file-entry-cache": "^2.0.0", @@ -260,9 +297,9 @@ "glob": "^7.1.2", "globals": "^11.7.0", "ignore": "^4.0.6", + "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "inquirer": "^6.1.0", - "is-resolvable": "^1.1.0", "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", @@ -275,7 +312,6 @@ "pluralize": "^7.0.0", "progress": "^2.0.0", "regexpp": "^2.0.1", - "require-uncached": "^1.0.3", "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", @@ -284,9 +320,9 @@ }, "dependencies": { "debug": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.0.tgz", - "integrity": "sha512-heNPJUJIqC+xB6ayLAMHaIrmN9HKa7aQO8MGqKpvCA+uJYVcvR6l5kgdrhRuwPFHU7P5/A1w0BjByPHwpfTDKg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" @@ -323,9 +359,9 @@ "dev": true }, "espree": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-4.1.0.tgz", - "integrity": "sha512-I5BycZW6FCVIub93TeVY1s7vjhP9CY6cXCznIRfiig7nRviKZYdRnj/sHEWC6A7WE9RDWOFq9+7OsWSYz8qv2w==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", + "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", "dev": true, "requires": { "acorn": "^6.0.2", @@ -441,6 +477,11 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" + }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", @@ -456,9 +497,9 @@ } }, "globals": { - "version": "11.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.9.0.tgz", - "integrity": "sha512-5cJVtyXWH8PiJPVLZzzoIizXx944O4OmRro5MWKx5fT4MgcN7OfaMutPeaTdJCCURwbWdhhcCWcKIffPnmTzBg==", + "version": "11.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", + "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", "dev": true }, "graceful-fs": { @@ -467,12 +508,24 @@ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -488,6 +541,16 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "import-fresh": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", + "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", @@ -511,9 +574,9 @@ "dev": true }, "inquirer": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.0.tgz", - "integrity": "sha512-QIEQG4YyQ2UYZGDC4srMZ7BjHOmNk1lR2JQj5UknBapklm6WHA+VVH7N+sUdX3A7NeCfGF8o4X1S3Ao7nAcIeg==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz", + "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==", "dev": true, "requires": { "ansi-escapes": "^3.0.0", @@ -527,8 +590,25 @@ "run-async": "^2.2.0", "rxjs": "^6.1.0", "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", + "strip-ansi": "^5.0.0", "through": "^2.3.6" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "dev": true + }, + "strip-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "dev": true, + "requires": { + "ansi-regex": "^4.0.0" + } + } } }, "is-buffer": { @@ -548,12 +628,6 @@ "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, - "is-resolvable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", - "dev": true - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -567,9 +641,9 @@ "dev": true }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.12.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz", + "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -621,19 +695,78 @@ }, "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "mkdirp": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" } }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "ms": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", @@ -697,13 +830,22 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "parent-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", + "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, "path-is-absolute": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, @@ -719,6 +861,11 @@ "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=" + }, "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", @@ -732,9 +879,9 @@ "dev": true }, "progress": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", - "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "punycode": { @@ -749,20 +896,10 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, - "require-uncached": { - "version": "1.0.3", - "resolved": "http://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", - "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", - "dev": true, - "requires": { - "caller-path": "^0.1.0", - "resolve-from": "^1.0.0" - } - }, "resolve-from": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", - "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "restore-cursor": { @@ -776,12 +913,12 @@ } }, "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "glob": "^7.0.5" + "glob": "^7.1.3" } }, "run-async": { @@ -836,11 +973,13 @@ "dev": true }, "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.0.0.tgz", + "integrity": "sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==", "dev": true, "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", "is-fullwidth-code-point": "^2.0.0" } }, @@ -885,14 +1024,14 @@ } }, "table": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/table/-/table-5.1.0.tgz", - "integrity": "sha512-e542in22ZLhD/fOIuXs/8yDZ9W61ltF8daM88rkRNtgTIct+vI2fTnAyu/Db2TCfEcI8i7mjZz6meLq0nW7TYg==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/table/-/table-5.2.1.tgz", + "integrity": "sha512-qmhNs2GEHNqY5fd2Mo+8N1r2sw/rvTAAvBZTaTx+Y7PHLypqyrxr1MdIu0pLw6Xvl/Gi4ONu/sdceP8vvUjkyA==", "dev": true, "requires": { - "ajv": "^6.5.3", - "lodash": "^4.17.10", - "slice-ansi": "1.0.0", + "ajv": "^6.6.1", + "lodash": "^4.17.11", + "slice-ansi": "2.0.0", "string-width": "^2.1.1" } }, @@ -904,7 +1043,7 @@ }, "through": { "version": "2.3.8", - "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, @@ -932,6 +1071,11 @@ "prelude-ls": "~1.1.2" } }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -970,6 +1114,14 @@ "requires": { "mkdirp": "^0.5.1" } + }, + "zcl-id": { + "version": "git+https://github.com/Koenkk/zcl-id.git#509f77ab620ece6ad8e83a008283457a5280c8db", + "from": "git+https://github.com/Koenkk/zcl-id.git#509f77ab620ece6ad8e83a008283457a5280c8db", + "requires": { + "busyman": "^0.3.0", + "enum": "^2.5.0" + } } } } diff --git a/package.json b/package.json index 92f7ab5c4f7a3..8352453654a99 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ ], "scripts": { "verify": "node test/verify.js", - "eslint": "node_modules/.bin/eslint ." + "eslint": "node_modules/.bin/eslint .", + "test": "mocha --recursive" }, "author": "Koen Kanters", "license": "MIT", @@ -31,12 +32,14 @@ }, "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", "dependencies": { - "@zigbee/zcl-id": "^0.5.0-2", + "zcl-id": "git+https://github.com/Koenkk/zcl-id.git#509f77ab620ece6ad8e83a008283457a5280c8db", "debounce": "*", - "debug": "3.2.6" + "debug": "3.2.6", + "chai": "*" }, "devDependencies": { "eslint": "*", - "eslint-config-google": "*" + "eslint-config-google": "*", + "mocha": "*" } } diff --git a/test/index.test.js b/test/index.test.js new file mode 100644 index 0000000000000..f0d56d7e19530 --- /dev/null +++ b/test/index.test.js @@ -0,0 +1,19 @@ +const chai = require('chai'); +const index = require('../index'); + +describe('index.js', () => { + it('Find device by model ID', () => { + const device = index.findByZigbeeModel('WaterSensor-N'); + chai.assert.strictEqual(device.model, 'HS1WL'); + }); + + it('Find device by model ID with strange characters', () => { + const device = index.findByZigbeeModel('lumi.remote.b1acn01\u0000\u0000\u0000\u0000\u0000\u0000'); + chai.assert.strictEqual(device.model, 'WXKG11LM'); + }); + + it('Find device by model ID without strange characters', () => { + const device = index.findByZigbeeModel('lumi.sensor_switch.aq2\u0000\u0000\u0000\u0000\u0000\u0000'); + chai.assert.strictEqual(device.model, 'WXKG11LM'); + }); +}); From b0d2ce9dc745150586534748e27f34c4d7813bfe Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 14 Jan 2019 17:24:22 +0100 Subject: [PATCH 462/676] 7.0.17 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 41089d4e972cc..76fdc2c6a28cf 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.16", + "version": "7.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8352453654a99..b766fb4778669 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.16", + "version": "7.0.17", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 08bdf311b97a839fc94aae1e2674fc47017b9a71 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 14 Jan 2019 17:32:32 +0100 Subject: [PATCH 463/676] Fix linting error. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 54fe11f834418..098c5ea80bec6 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ module.exports = { let device = byZigbeeModel.get(model); if (!device) { - device = byZigbeeModel.get(model.replace(/\0.*$/g,'').trim()); + device = byZigbeeModel.get(model.replace(/\0.*$/g, '').trim()); } return device; From 41b259227ab8285387c087011517bddc167bd374 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 14 Jan 2019 17:32:42 +0100 Subject: [PATCH 464/676] 7.0.18 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 76fdc2c6a28cf..2540fa3c4f55e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.17", + "version": "7.0.18", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b766fb4778669..4db9248cecb41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.17", + "version": "7.0.18", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 708f4302a75d732db430e678d472b808d375df2a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 14 Jan 2019 18:14:34 +0100 Subject: [PATCH 465/676] Update battery cfg for TRADFRI wireless dimmer. https://github.com/Koenkk/zigbee2mqtt/issues/792 --- devices.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index f76ac31ce3dfe..9c3e0561b0eb7 100644 --- a/devices.js +++ b/devices.js @@ -477,10 +477,14 @@ const devices = [ toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); + const cfg = { + direction: 0, attrId: 33, dataType: 32, minRepIntval: 0, maxRepIntval: seconds.ONE_DAY, repChange: 0, + }; + const actions = [ (cb) => device.bind('genLevelCtrl', coordinator, cb), (cb) => device.bind('genPowerCfg', coordinator, cb), - (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, seconds.ONE_DAY, 0, cb), + (cb) => device.foundation('genPowerCfg', 'configReport', [cfg], foundationCfg, cb), ]; execute(device, actions, callback); }, From 4e0ba4dbde8a01182135b0305f0e8a018ec19cf9 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 14 Jan 2019 18:15:17 +0100 Subject: [PATCH 466/676] 7.0.19 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2540fa3c4f55e..49cf47581eb94 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.18", + "version": "7.0.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4db9248cecb41..4cc7065f3e087 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.18", + "version": "7.0.19", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 1c9ab0cc62fc4a5ad5582b3f57002f9836a54f70 Mon Sep 17 00:00:00 2001 From: Paul Tiedtke Date: Tue, 15 Jan 2019 20:25:27 +0100 Subject: [PATCH 467/676] Fix documentation for Xiaomi Wireless Wall Switch (#211) * Fix documentation for Xiaomi Wireless Wall Switch * Update devices.js --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 9c3e0561b0eb7..e033f98ecdb11 100644 --- a/devices.js +++ b/devices.js @@ -145,7 +145,7 @@ const devices = [ model: 'WXKG03LM', vendor: 'Xiaomi', description: 'Aqara single key wireless wall switch', - supports: 'single click', + supports: 'single, double, hold, release and long click', fromZigbee: [ fz.xiaomi_battery_3v, fz.WXKG03LM_click, fz.ignore_basic_change, fz.xiaomi_action_click_multistate, fz.ignore_multistate_change, @@ -157,7 +157,7 @@ const devices = [ model: 'WXKG02LM', vendor: 'Xiaomi', description: 'Aqara double key wireless wall switch', - supports: 'left, right and both click', + supports: 'left, right, both click (and double, long click for left, right and both depending on model)', fromZigbee: [ fz.xiaomi_battery_3v, fz.WXKG02LM_click, fz.ignore_basic_change, fz.WXKG02LM_click_multistate, fz.ignore_multistate_change, From 4a5a0d9f176675fe9000d4ac452052368d91c870 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Tue, 15 Jan 2019 20:27:42 +0100 Subject: [PATCH 468/676] TRADFRI Driver 10W (#214) same device as TRADFRI transformer 10W but other name --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index e033f98ecdb11..402c6cc8432af 100644 --- a/devices.js +++ b/devices.js @@ -490,7 +490,7 @@ const devices = [ }, }, { - zigbeeModel: ['TRADFRI transformer 10W'], + zigbeeModel: ['TRADFRI transformer 10W', 'TRADFRI Driver 10W'], model: 'ICPSHC24-10EU-IL-1', vendor: 'IKEA', description: 'TRADFRI driver for wireless control (10 watt)', From 8ed89bbb1123f11fefc8cc282cbb6e763fcc5e29 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 15 Jan 2019 20:32:17 +0100 Subject: [PATCH 469/676] =?UTF-8?q?ToZigbee=20onoff;=20don=E2=80=99t=20cra?= =?UTF-8?q?sh=20on=20wrong=20value=20type.=20https://github.com/Koenkk/zig?= =?UTF-8?q?bee-shepherd-converters/issues/212?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- converters/toZigbee.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 83575d06bc39b..93d228764275f 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -36,6 +36,10 @@ const converters = { const cid = 'genOnOff'; const attrId = 'onOff'; + if (typeof value !== 'string') { + return; + } + if (type === 'set') { return { cid: cid, From 1cf4503849f71e6687c58ef1661b2182f7d907c0 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 15 Jan 2019 21:12:53 +0100 Subject: [PATCH 470/676] Fix tradfri wireless dimmer report interval. https://github.com/Koenkk/zigbee2mqtt/issues/792 --- devices.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/devices.js b/devices.js index 402c6cc8432af..a638adef76ac1 100644 --- a/devices.js +++ b/devices.js @@ -4,8 +4,8 @@ const debug = require('debug')('zigbee-shepherd-converters:devices'); const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); -const seconds = { - ONE_DAY: 86400, +const repInterval = { + MAX: 65535, }; const generic = { @@ -478,7 +478,7 @@ const devices = [ configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfg = { - direction: 0, attrId: 33, dataType: 32, minRepIntval: 0, maxRepIntval: seconds.ONE_DAY, repChange: 0, + direction: 0, attrId: 33, dataType: 32, minRepIntval: 0, maxRepIntval: repInterval.MAX, repChange: 0, }; const actions = [ From 689bc0119507d0b12902141e08b69409d1515b3c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 15 Jan 2019 21:15:07 +0100 Subject: [PATCH 471/676] 7.0.20 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 49cf47581eb94..8a541088c2baf 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.19", + "version": "7.0.20", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4cc7065f3e087..4a478be0db764 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.19", + "version": "7.0.20", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From d9a73cf931fc6baaad34d33f08cbbe86222cbf71 Mon Sep 17 00:00:00 2001 From: pnewnam Date: Thu, 17 Jan 2019 06:12:44 +1100 Subject: [PATCH 472/676] Add support for Sengled model E1A-AC2 (#215) * Add support for Sengled model E1A-AC2 Adding support for Sengled downlights (https://www.sengled.com.au/shop/element-downlight-single/) * Update devices.js --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index a638adef76ac1..14d1b7927047b 100644 --- a/devices.js +++ b/devices.js @@ -1424,6 +1424,13 @@ const devices = [ description: 'Element Classic (BR30)', extend: generic.light_onoff_brightness, }, + { + zigbeeModel: ['E1A-AC2'], + model: 'E1ACA4ABE38A', + vendor: 'Sengled', + description: 'Element downlight smart LED bulb', + extend: generic.light_onoff_brightness, + }, // JIAWEN { From 9856e72c425ec8b7b06afac450b88bb064456430 Mon Sep 17 00:00:00 2001 From: Kryzek Date: Fri, 18 Jan 2019 20:00:33 +0200 Subject: [PATCH 473/676] Trust Contact Sensor (CSW_ADUROLIGHT) invert logic (#221) Fixed an issue where contact ON on the device resulted contact:false MQTT-payload and vice versa. --- converters/fromZigbee.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index a6b2ace63b2ca..f15513196d04c 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1220,7 +1220,7 @@ const converters = { convert: (model, msg, publish, options) => { const zoneStatus = msg.data.zoneStatus; return { - contact: (zoneStatus & 1) > 0, + contact: !((zoneStatus & 1) > 0), }; }, }, @@ -1230,7 +1230,7 @@ const converters = { convert: (model, msg, publish, options) => { const zoneStatus = msg.data.zoneStatus; return { - contact: (zoneStatus & 1) > 0, + contact: !((zoneStatus & 1) > 0), }; }, }, From c0570f7336b3024e5e604c1d177a1f22c0aee0dd Mon Sep 17 00:00:00 2001 From: Kryzek Date: Fri, 18 Jan 2019 20:02:21 +0200 Subject: [PATCH 474/676] Fix for: No converter available for 4713407 with cid genOnOff, type attReport and data {"cid":"genOnOff","data":{"onOff":0}} (#218) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 14d1b7927047b..3c43a5d57d2bd 100644 --- a/devices.js +++ b/devices.js @@ -2035,7 +2035,7 @@ const devices = [ vendor: 'Airam', description: 'LED OP A60 ZB 9W/827 E27', extend: generic.light_onoff_brightness, - fromZigbee: [fz.light_state, fz.light_brightness_report, fz.light_brightness, fz.light_state], + fromZigbee: [fz.light_state, fz.light_brightness_report, fz.light_brightness, fz.generic_state], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; From 81e297a3db194c93cbc963fc1dbe6b8bdd8d7ec0 Mon Sep 17 00:00:00 2001 From: James Tutton Date: Fri, 18 Jan 2019 19:04:49 +0000 Subject: [PATCH 475/676] Add support for OSRAM/Lightify Switch Mini (#219) * Added Support for OSRAM Smart Switch Mini AC0251100NJ * Lightify Switch Mini Support * CODE Tidy * Fixed comma dangle * Removed trailing space * Update fromZigbee.js * Update fromZigbee.js * Update devices.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 33 +++++++++++++++++++++++++++------ devices.js | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 58 insertions(+), 9 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index f15513196d04c..aeca1b2244125 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -125,6 +125,27 @@ const holdUpdateBrightness324131092621 = (deviceID) => { const converters = { + AC0251100NJ_on: { + cid: 'genOnOff', + type: 'cmdOn', + convert: (model, msg, publish, options) => { + return {click: 'on'}; + }, + }, + AC0251100NJ_off: { + cid: 'genOnOff', + type: 'cmdOff', + convert: (model, msg, publish, options) => { + return {click: 'off'}; + }, + }, + AC0251100NJ_long_middle: { + cid: 'lightingColorCtrl', + type: 'cmdMoveHue', + convert: (model, msg, publish, options) => { + return {click: 'long_middle'}; + }, + }, bitron_power: { cid: 'seMetering', type: 'attReport', @@ -1025,7 +1046,7 @@ const converters = { return {presence: true}; }, }, - STS_PRS_251_battery: { + generic_batteryvoltage_3000_2500: { cid: 'genPowerCfg', type: 'attReport', convert: (model, msg, publish, options) => { @@ -1125,27 +1146,27 @@ const converters = { return {voltage: msg.data.data['batteryVoltage'] / 100}; }, }, - ICTC_G_1_move: { + cmd_move: { cid: 'genLevelCtrl', type: 'cmdMove', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), }, - ICTC_G_1_moveWithOnOff: { + cmd_move_with_onoff: { cid: 'genLevelCtrl', type: 'cmdMoveWithOnOff', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'move'), }, - ICTC_G_1_stop: { + cmd_stop: { cid: 'genLevelCtrl', type: 'cmdStop', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'stop'), }, - ICTC_G_1_stopWithOnOff: { + cmd_stop_with_onoff: { cid: 'genLevelCtrl', type: 'cmdStopWithOnOff', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'stop'), }, - ICTC_G_1_moveToLevelWithOnOff: { + cmd_move_to_level_with_onoff: { cid: 'genLevelCtrl', type: 'cmdMoveToLevelWithOnOff', convert: (model, msg, publish, options) => ictcg1(model, msg, publish, options, 'level'), diff --git a/devices.js b/devices.js index 3c43a5d57d2bd..9b2c7304254ba 100644 --- a/devices.js +++ b/devices.js @@ -471,8 +471,8 @@ const devices = [ description: 'TRADFRI wireless dimmer', supports: 'brightness [0-255], quick rotate for instant 0/255', fromZigbee: [ - fz.ICTC_G_1_move, fz.ICTC_G_1_moveWithOnOff, fz.ICTC_G_1_stop, fz.ICTC_G_1_stopWithOnOff, - fz.ICTC_G_1_moveToLevelWithOnOff, fz.generic_battery, fz.ignore_power_change, + fz.cmd_move, fz.cmd_move_with_onoff, fz.cmd_stop, fz.cmd_stop_with_onoff, + fz.cmd_move_to_level_with_onoff, fz.generic_battery, fz.ignore_power_change, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { @@ -1059,6 +1059,31 @@ const devices = [ description: 'SMART+ spot GU5.3 tunable white', extend: generic.light_onoff_brightness_colortemp, }, + { + zigbeeModel: ['Lightify Switch Mini', 'Lightify Switch Mini\u0000'], + model: 'AC0251100NJ', + vendor: 'OSRAM', + description: 'Smart+ switch mini', + supports: 'on/off, brightness', + fromZigbee: [ + fz.AC0251100NJ_on, fz.AC0251100NJ_off, fz.AC0251100NJ_long_middle, + fz.cmd_stop, fz.cmd_move, fz.cmd_move_with_onoff, + fz.cmd_move_to_level_with_onoff, fz.generic_batteryvoltage_3000_2500, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.bind('lightingColorCtrl', coordinator, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 900, 3600, 0, cb), + ]; + execute(device, actions, callback); + }, + + }, // Hive { @@ -1607,7 +1632,10 @@ const devices = [ vendor: 'SmartThings', description: 'Arrival sensor', supports: 'presence', - fromZigbee: [fz.STS_PRS_251_presence, fz.STS_PRS_251_battery, fz.ignore_power_change, fz.STS_PRS_251_beeping], + fromZigbee: [ + fz.STS_PRS_251_presence, fz.generic_batteryvoltage_3000_2500, fz.ignore_power_change, + fz.STS_PRS_251_beeping, + ], toZigbee: [tz.STS_PRS_251_beep], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); From d1c202e4f9bcb3628d2f6f5faf5e3938b636c965 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 18 Jan 2019 20:36:07 +0100 Subject: [PATCH 476/676] 7.0.21 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8a541088c2baf..10dc73decc2ea 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.20", + "version": "7.0.21", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4a478be0db764..b95145ad2ac1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.20", + "version": "7.0.21", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From a099ecdbb3356bed186196c81702c705a2633b6b Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 18 Jan 2019 21:55:49 +0100 Subject: [PATCH 477/676] Fix crash when model null. https://github.com/Koenkk/zigbee2mqtt/issues/887 --- index.js | 4 ++++ test/index.test.js | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/index.js b/index.js index 098c5ea80bec6..c1d2df633ebb0 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,10 @@ for (const device of devices) { module.exports = { devices, findByZigbeeModel: (model) => { + if (!model) { + return null; + } + let device = byZigbeeModel.get(model); if (!device) { diff --git a/test/index.test.js b/test/index.test.js index f0d56d7e19530..270ebaa536120 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -16,4 +16,9 @@ describe('index.js', () => { const device = index.findByZigbeeModel('lumi.sensor_switch.aq2\u0000\u0000\u0000\u0000\u0000\u0000'); chai.assert.strictEqual(device.model, 'WXKG11LM'); }); + + it('Find device by model ID null', () => { + const device = index.findByZigbeeModel(null); + chai.assert.strictEqual(device, null); + }); }); From 34297d6bdc1922154bc4cf60d29bb90661aa9532 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 18 Jan 2019 21:56:06 +0100 Subject: [PATCH 478/676] 7.0.22 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 10dc73decc2ea..5476fe245f518 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.21", + "version": "7.0.22", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b95145ad2ac1d..b2586eae1b868 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.21", + "version": "7.0.22", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 1eaf355afb0825d96a60b11ac2fa18b0340e9d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ad=C3=A1n=20SDPC?= Date: Mon, 21 Jan 2019 18:03:52 +0100 Subject: [PATCH 479/676] Fix xiaomi lock (#223) * feat(xiaomi_lock_report): recover reporting of error case 0x1107ffffffffffff This error message is sent by the Xiaomi / Vima smart lock when an unknown object (e.g. a lock pick) is introduced into the cylinder. * chore(xiaomi_lock_report): uniformize code comments --- converters/fromZigbee.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index aeca1b2244125..09bfde097e5ab 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -769,9 +769,13 @@ const converters = { return {keyerror: true, inserted: 'unknown'}; } if (action == 3) { - // explicitly disabled key (e.g.: reported lost) + // explicitly disabled key (i.e. reported lost) return {keyerror: true, inserted: keynum}; } + if (action == 7) { + // strange object introduced into the cylinder (e.g. a lock pick) + return {keyerror: true, inserted: 'strange'}; + } } if (state == 12) { if (action == 1) { From 8de83650b234ab748da8bbe09e0364a45648616b Mon Sep 17 00:00:00 2001 From: Daniel Lashua Date: Mon, 21 Jan 2019 11:05:38 -0600 Subject: [PATCH 480/676] Support for Sylvania 71831, Adjustable White A19 Bulb (#224) --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index 9b2c7304254ba..7429c0c9d4262 100644 --- a/devices.js +++ b/devices.js @@ -1325,6 +1325,13 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['A19 TW 10 year'], + model: '71831', + vendor: 'Sylvania', + description: 'Smart Home adjustable white A19 LED bulb', + extend: generic.light_onoff_brightness_colortemp, + }, { zigbeeModel: ['MR16 TW'], model: '74282', From 7149d6e7e2bcecc72ddaffc0f1631393837b220d Mon Sep 17 00:00:00 2001 From: Niklas Date: Mon, 21 Jan 2019 18:07:10 +0100 Subject: [PATCH 481/676] Support for RGB Mueller Licht: tint (#225) * added tint from Mueller Licht * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 7429c0c9d4262..cff90eddaa125 100644 --- a/devices.js +++ b/devices.js @@ -2130,6 +2130,15 @@ const devices = [ description: 'Zigbee 3.0 Dimmer', extend: generic.light_onoff_brightness, }, + + // Müller Licht + { + zigbeeModel: ['ZBT-ExtendedColor'], + model: '404000/404005/404012', + vendor: 'Müller Licht', + description: 'Tint LED bulb GU10/E14/E27 350/470/806 lumen, dimmable, color, opal white', + extend: generic.light_onoff_brightness_colortemp_colorxy, + }, ]; module.exports = devices.map((device) => From 950ba75f9c58cdfe49ddc69bf05afb099de2abbb Mon Sep 17 00:00:00 2001 From: Merlin Schumacher Date: Tue, 22 Jan 2019 20:01:20 +0100 Subject: [PATCH 482/676] =?UTF-8?q?Added=20M=C3=BCller=20Licht=20white=20b?= =?UTF-8?q?ulbs=20(#229)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * New devices: Heiman Water Sensor, Heiman Door Sensor * Update devices.js * Update fromZigbee.js * Update fromZigbee.js * Improved support for HEIMAN devices * Fixed ; and style * Style fix * Updates * Fixed wrong bitshift * Added Müller Licht white bulbs * Added Müller Licht white bulbs --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index cff90eddaa125..9086f77ae9875 100644 --- a/devices.js +++ b/devices.js @@ -2139,6 +2139,13 @@ const devices = [ description: 'Tint LED bulb GU10/E14/E27 350/470/806 lumen, dimmable, color, opal white', extend: generic.light_onoff_brightness_colortemp_colorxy, }, + { + zigbeeModel: ['ZBT-ColorTemperature'], + model: '404006/404008/404004', + vendor: 'Müller Licht', + description: 'Tint LED bulb GU10/E14/E27 350/470/806 lumen, dimmable, opal white', + extend: generic.light_onoff_brightness_colortemp, + }, ]; module.exports = devices.map((device) => From acad399918a0a472f365dea364ef6cfa65584a25 Mon Sep 17 00:00:00 2001 From: Simon Rasmussen Date: Tue, 22 Jan 2019 20:03:39 +0100 Subject: [PATCH 483/676] Refactor transtime to readAfterWriteTime (#227) * refactor transition times * Increased thermostat_system_mode readAfterWriteTime --- converters/toZigbee.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 93d228764275f..f60bd6f56a273 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -182,6 +182,7 @@ const converters = { transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, cfg: cfg.default, + readAfterWriteTime: message.hasOwnProperty('transition') ? message.transition * 1000 : 0, }; } else if (type === 'get') { return { @@ -215,6 +216,7 @@ const converters = { transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, cfg: cfg.default, + readAfterWriteTime: message.hasOwnProperty('transition') ? message.transition * 1000 : 0, }; } else if (type === 'get') { return { @@ -259,6 +261,7 @@ const converters = { transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, cfg: cfg.default, + readAfterWriteTime: message.hasOwnProperty('transition') ? message.transition * 1000 : 0, }; } else if (type === 'get') { return { @@ -512,6 +515,7 @@ const converters = { attrData: value, }], cfg: cfg.default, + readAfterWriteTime: 250, }; } else if (type === 'get') { return { From 9a1e891156fbe48a3909023742659225ac5b74e3 Mon Sep 17 00:00:00 2001 From: Simon Rasmussen Date: Tue, 22 Jan 2019 20:06:22 +0100 Subject: [PATCH 484/676] Implemented thermostat enums (#226) * Implemented thermostat enums * Fixed linting issues * Hopefully no more linting problems * Fixed review comments * Fixed more uppercase * Update toZigbee.js --- converters/common.js | 32 ++++++++++++++++++++++++++++++++ converters/fromZigbee.js | 31 +++++++++++++++++++------------ converters/toZigbee.js | 5 +++-- converters/utils.js | 5 +++++ 4 files changed, 59 insertions(+), 14 deletions(-) create mode 100644 converters/common.js diff --git a/converters/common.js b/converters/common.js new file mode 100644 index 0000000000000..f20dcc37d98df --- /dev/null +++ b/converters/common.js @@ -0,0 +1,32 @@ +'use strict'; + +const thermostatControlSequenceOfOperations = { + 0: 'cooling only', + 1: 'cooling with reheat', + 2: 'heating only', + 3: 'heating with reheat', + 4: 'cooling and heating 4-pipes', + 5: 'cooling and heating 4-pipes with reheat', +}; +const thermostatSystemModes = { + 0: 'off', + 1: 'auto', + 3: 'cool', + 4: 'heat', + 5: 'emergency heating', + 6: 'precooling', + 7: 'fan only', + 8: 'dry', + 9: 'Sleep', +}; +const thermostatRunningModes = { + 0: 'off', + 3: 'cool', + 4: 'heat', +}; + +module.exports = { + thermostatControlSequenceOfOperations, + thermostatSystemModes, + thermostatRunningModes, +}; diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 09bfde097e5ab..4d49635be83d9 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1,6 +1,7 @@ 'use strict'; const debounce = require('debounce'); +const common = require('./common'); const clickLookup = { 1: 'single', @@ -1317,14 +1318,17 @@ const converters = { if (typeof msg.data.data['remoteSensing'] == 'number') { result.remote_sensing = msg.data.data['remoteSensing']; } - if (typeof msg.data.data['ctrlSeqeOfOper'] == 'number') { - result.control_sequence_of_operation = msg.data.data['ctrlSeqeOfOper']; + const ctrl = msg.data.data['ctrlSeqeOfOper']; + if (typeof ctrl == 'number' && common.thermostatControlSequenceOfOperations.hasOwnProperty(ctrl)) { + result.control_sequence_of_operation = common.thermostatControlSequenceOfOperations[ctrl]; } - if (typeof msg.data.data['systemMode'] == 'number') { - result.system_mode = msg.data.data['systemMode']; + const mode = msg.data.data['systemMode']; + if (typeof mode == 'number' && common.thermostatSystemModes.hasOwnProperty(mode)) { + result.system_mode = common.thermostatSystemModes[mode]; } - if (typeof msg.data.data['runningState'] == 'number') { - result.running_state = msg.data.data['runningState']; + const state = msg.data.data['runningState']; + if (typeof state == 'number' && common.thermostatRunningModes.hasOwnProperty(state)) { + result.running_state = common.thermostatRunningModes[state]; } return result; }, @@ -1367,14 +1371,17 @@ const converters = { if (typeof msg.data.data['remoteSensing'] == 'number') { result.remote_sensing = msg.data.data['remoteSensing']; } - if (typeof msg.data.data['ctrlSeqeOfOper'] == 'number') { - result.control_sequence_of_operation = msg.data.data['ctrlSeqeOfOper']; + const ctrl = msg.data.data['ctrlSeqeOfOper']; + if (typeof ctrl == 'number' && common.thermostatControlSequenceOfOperations.hasOwnProperty(ctrl)) { + result.control_sequence_of_operation = common.thermostatControlSequenceOfOperations[ctrl]; } - if (typeof msg.data.data['systemMode'] == 'number') { - result.system_mode = msg.data.data['systemMode']; + const mode = msg.data.data['systemMode']; + if (typeof mode == 'number' && common.thermostatSystemModes.hasOwnProperty(mode)) { + result.system_mode = common.thermostatSystemModes[mode]; } - if (typeof msg.data.data['runningState'] == 'number') { - result.running_state = msg.data.data['runningState']; + const state = msg.data.data['runningState']; + if (typeof state == 'number' && common.thermostatRunningModes.hasOwnProperty(state)) { + result.running_state = common.thermostatRunningModes[state]; } return result; }, diff --git a/converters/toZigbee.js b/converters/toZigbee.js index f60bd6f56a273..7612640ce9c1a 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,6 +1,7 @@ 'use strict'; const utils = require('./utils'); +const common = require('./common'); const zclId = require('zcl-id'); const cfg = { @@ -475,7 +476,7 @@ const converters = { // 0x05 Cooling and Heating 4-pipes with Reheat: All modes are possible attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, - attrData: value, + attrData: utils.getKeyByValue(common.thermostat_control_sequence_of_operations, value, value), }], cfg: cfg.default, }; @@ -512,7 +513,7 @@ const converters = { // 0x09 Sleep attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, - attrData: value, + attrData: utils.getKeyByValue(common.thermostat_system_modes, value, value), }], cfg: cfg.default, readAfterWriteTime: 250, diff --git a/converters/utils.js b/converters/utils.js index a8467fc88f857..90e43780dc62e 100644 --- a/converters/utils.js +++ b/converters/utils.js @@ -49,8 +49,13 @@ function hexToRgb(hex) { return {r: r, g: g, b: b}; } +function getKeyByValue(object, value, fallback = 0) { + return Number(Object.keys(object).find((k) => object[k] === value)) || fallback; +} + module.exports = { rgbToXY: rgbToXY, hexToXY: hexToXY, hexToRgb: hexToRgb, + getKeyByValue: getKeyByValue, }; From 13e99ba3fd8d004b15d93d09f414dec5a7e39129 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 22 Jan 2019 20:09:38 +0100 Subject: [PATCH 485/676] 7.0.23 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5476fe245f518..54e25c0aeecf4 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.22", + "version": "7.0.23", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b2586eae1b868..f473ee47f480f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.22", + "version": "7.0.23", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 66d95059713d343f64d28b094290e4d5ca40d778 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Wed, 23 Jan 2019 17:03:42 +0100 Subject: [PATCH 486/676] Fix for systemMode runningState enum implementation. (#234) * corrected runningStates * added runningMode added runningMode edited runningState * Update toZigbee.js removed comments that are described at documentation added runningMode (get) * Update common.js * Update fromZigbee.js * Update common.js * Update fromZigbee.js --- converters/common.js | 21 ++++++++++++++++----- converters/fromZigbee.js | 28 ++++++++++++++++++---------- converters/toZigbee.js | 33 ++++++++++++++++----------------- 3 files changed, 50 insertions(+), 32 deletions(-) diff --git a/converters/common.js b/converters/common.js index f20dcc37d98df..c2bc54002f11b 100644 --- a/converters/common.js +++ b/converters/common.js @@ -19,14 +19,25 @@ const thermostatSystemModes = { 8: 'dry', 9: 'Sleep', }; -const thermostatRunningModes = { - 0: 'off', - 3: 'cool', - 4: 'heat', +const thermostatRunningStates = { + 0: 'idle', + 1: 'heat', + 2: 'cool', + 4: 'fan only', + 5: 'heat', + 6: 'cool', + 8: 'heat', + 9: 'heat', + A: 'heat', + D: 'heat', + 10: 'cool', + 12: 'cool', + 14: 'cool', + 15: 'cool', }; module.exports = { thermostatControlSequenceOfOperations, thermostatSystemModes, - thermostatRunningModes, + thermostatRunningStates, }; diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 4d49635be83d9..3694f36fb8d23 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1322,13 +1322,17 @@ const converters = { if (typeof ctrl == 'number' && common.thermostatControlSequenceOfOperations.hasOwnProperty(ctrl)) { result.control_sequence_of_operation = common.thermostatControlSequenceOfOperations[ctrl]; } - const mode = msg.data.data['systemMode']; - if (typeof mode == 'number' && common.thermostatSystemModes.hasOwnProperty(mode)) { - result.system_mode = common.thermostatSystemModes[mode]; + const smode = msg.data.data['systemMode']; + if (typeof mode == 'number' && common.thermostatSystemModes.hasOwnProperty(smode)) { + result.system_mode = common.thermostatSystemModes[smode]; + } + const rmode = msg.data.data['runningMode']; + if (typeof rmode == 'number' && common.thermostatSystemModes.hasOwnProperty(rmode)) { + result.running_mode = common.thermostatSystemModes[rmode]; } const state = msg.data.data['runningState']; - if (typeof state == 'number' && common.thermostatRunningModes.hasOwnProperty(state)) { - result.running_state = common.thermostatRunningModes[state]; + if (typeof state == 'number' && common.thermostatRunningStates.hasOwnProperty(state)) { + result.running_state = common.thermostatRunningStates[state]; } return result; }, @@ -1375,13 +1379,17 @@ const converters = { if (typeof ctrl == 'number' && common.thermostatControlSequenceOfOperations.hasOwnProperty(ctrl)) { result.control_sequence_of_operation = common.thermostatControlSequenceOfOperations[ctrl]; } - const mode = msg.data.data['systemMode']; - if (typeof mode == 'number' && common.thermostatSystemModes.hasOwnProperty(mode)) { - result.system_mode = common.thermostatSystemModes[mode]; + const smode = msg.data.data['systemMode']; + if (typeof smode == 'number' && common.thermostatSystemModes.hasOwnProperty(smode)) { + result.system_mode = common.thermostatSystemModes[smode]; + } + const rmode = msg.data.data['runningMode']; + if (typeof rmode == 'number' && common.thermostatSystemModes.hasOwnProperty(rmode)) { + result.running_mode = common.thermostatSystemModes[rmode]; } const state = msg.data.data['runningState']; - if (typeof state == 'number' && common.thermostatRunningModes.hasOwnProperty(state)) { - result.running_state = common.thermostatRunningModes[state]; + if (typeof state == 'number' && common.thermostatRunningStates.hasOwnProperty(state)) { + result.running_state = common.thermostatRunningStates[state]; } return result; }, diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 7612640ce9c1a..1abf69a911a82 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -468,12 +468,6 @@ const converters = { cmd: 'write', cmdType: 'foundation', zclData: [{ - // 0x00 Cooling Only Heat and Emergency are not possible - // 0x01 Cooling With Reheat Heat and Emergency are not possible - // 0x02 Heating Only Cool and precooling are not possible - // 0x03 Heating With Reheat Cool and precooling are not possible - // 0x04 Cooling and Heating 4-pipes: All modes are possible - // 0x05 Cooling and Heating 4-pipes with Reheat: All modes are possible attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, attrData: utils.getKeyByValue(common.thermostat_control_sequence_of_operations, value, value), @@ -502,15 +496,6 @@ const converters = { cmd: 'write', cmdType: 'foundation', zclData: [{ - // 0x00 Off - // 0x01 Auto - // 0x03 Cool - // 0x04 Heat - // 0x05 Emergency heating - // 0x06 Precooling - // 0x07 Fan only - // 0x08 Dry - // 0x09 Sleep attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, attrData: utils.getKeyByValue(common.thermostat_system_modes, value, value), @@ -649,6 +634,22 @@ const converters = { }; }, }, + thermostat_running_mode: { + key: 'running_mode', + convert: (key, value, message, type) => { + const cid = 'hvacThermostat'; + const attrId = 'runningMode'; + if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, thermostat_running_state: { key: 'running_state', convert: (key, value, message, type) => { @@ -676,8 +677,6 @@ const converters = { cmd: 'write', cmdType: 'foundation', zclData: [{ - // 0x00 Temperature in °C - // 0x01 Temperature in °F attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, attrData: value, From bfd383a10de31d2dd7da3de1c48bde604cc5ff1d Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 23 Jan 2019 17:06:32 +0100 Subject: [PATCH 487/676] Switch zcl-id to tarball --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f473ee47f480f..b81f3d5804881 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", "dependencies": { - "zcl-id": "git+https://github.com/Koenkk/zcl-id.git#509f77ab620ece6ad8e83a008283457a5280c8db", + "zcl-id": "https://github.com/koenkk/zcl-id/tarball/master", "debounce": "*", "debug": "3.2.6", "chai": "*" From 5e6d76f3da1f3eb3172c9eedca8d1c9128739c89 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 23 Jan 2019 17:07:12 +0100 Subject: [PATCH 488/676] 7.0.24 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 54e25c0aeecf4..577d3994d5e1b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.23", + "version": "7.0.24", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b81f3d5804881..ef4927a431a6a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.23", + "version": "7.0.24", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 2fbc0450b205da21af2c49539118c79e32f7ccc3 Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Wed, 23 Jan 2019 17:35:35 +0100 Subject: [PATCH 489/676] fixed var name. (#235) --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3694f36fb8d23..282c71ca85e15 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1323,7 +1323,7 @@ const converters = { result.control_sequence_of_operation = common.thermostatControlSequenceOfOperations[ctrl]; } const smode = msg.data.data['systemMode']; - if (typeof mode == 'number' && common.thermostatSystemModes.hasOwnProperty(smode)) { + if (typeof smode == 'number' && common.thermostatSystemModes.hasOwnProperty(smode)) { result.system_mode = common.thermostatSystemModes[smode]; } const rmode = msg.data.data['runningMode']; From 63025945f89ec67a66d46be4c06a05fda86e955e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Thu, 24 Jan 2019 19:46:01 +0300 Subject: [PATCH 490/676] NodeJS 4.* compatibility fix (#236) --- converters/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/utils.js b/converters/utils.js index 90e43780dc62e..04d0aee6b4db7 100644 --- a/converters/utils.js +++ b/converters/utils.js @@ -49,8 +49,8 @@ function hexToRgb(hex) { return {r: r, g: g, b: b}; } -function getKeyByValue(object, value, fallback = 0) { - return Number(Object.keys(object).find((k) => object[k] === value)) || fallback; +function getKeyByValue(object, value, fallback) { + return Number(Object.keys(object).find((k) => object[k] === value)) || fallback || 0; } module.exports = { From 81598b4d14877be4a191aacc7af3978aef882748 Mon Sep 17 00:00:00 2001 From: Andrey Date: Fri, 25 Jan 2019 17:41:45 +0200 Subject: [PATCH 491/676] Fix max interval (#237) Changed the maximum interval time. --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 9086f77ae9875..764e61bb75ddb 100644 --- a/devices.js +++ b/devices.js @@ -5,7 +5,7 @@ const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); const repInterval = { - MAX: 65535, + MAX: 58000, }; const generic = { From bc98408577b8f67d4d36c6cff075769c80566092 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 26 Jan 2019 19:53:50 +0100 Subject: [PATCH 492/676] Support HS1DS-E. https://github.com/Koenkk/zigbee2mqtt/issues/911 --- devices.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/devices.js b/devices.js index 764e61bb75ddb..145d67c550663 100644 --- a/devices.js +++ b/devices.js @@ -2019,6 +2019,24 @@ const devices = [ fromZigbee: [fz.heiman_contact], toZigbee: [], }, + { + zigbeeModel: ['DoorSensor-EM'], + model: 'HS1DS-E', + vendor: 'HEIMAN', + description: 'Door sensor', + supports: 'contact', + fromZigbee: [fz.heiman_contact], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + ]; + + execute(device, actions, callback, 1000); + }, + }, { zigbeeModel: ['WaterSensor-N'], model: 'HS1WL', From 7b3e2c511967c7de6f76c9747679a1aee6f44352 Mon Sep 17 00:00:00 2001 From: KernSani Date: Sun, 27 Jan 2019 00:05:54 +0100 Subject: [PATCH 493/676] added Gledopto Smart RGBW GU10 (GL-S-003Z) (#240) * Update devices.js added Gledopto Smart RGBW GU10 (GL-S-003Z) * Update devices.js * Update devices.js --- devices.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/devices.js b/devices.js index 145d67c550663..94c490ba3b30c 100644 --- a/devices.js +++ b/devices.js @@ -1615,6 +1615,22 @@ const devices = [ } }, }, + { + zigbeeModel: ['GL-S-003Z'], + model: 'GL-S-003Z', + vendor: 'Gledopto', + description: 'Smart RGBW GU10 ', + extend: generic.light_onoff_brightness_colortemp_colorxy, + ep: (device) => { + if (device.epList.toString() === '11,12,13') { + return {'': 12}; + } else if (device.epList.toString() === '10,11,13') { + return {'': 11}; + } else { + return {}; + } + }, + }, { zigbeeModel: ['HOMA2023'], model: 'GD-CZ-006', From 3382c26621aa9dcbfd85d01b9c9eb2585d50c539 Mon Sep 17 00:00:00 2001 From: Simon Rasmussen Date: Sun, 27 Jan 2019 00:06:30 +0100 Subject: [PATCH 494/676] Enum fixes (#241) * Fixed reference to undefined enum objects. * Fixed issue with setting system_mode to "off". The key for "off" is 0 which would fool getKeyByValue into returning the "off" string as fallback value. --- converters/toZigbee.js | 4 ++-- converters/utils.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 1abf69a911a82..858b976437f76 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -470,7 +470,7 @@ const converters = { zclData: [{ attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, - attrData: utils.getKeyByValue(common.thermostat_control_sequence_of_operations, value, value), + attrData: utils.getKeyByValue(common.thermostatControlSequenceOfOperations, value, value), }], cfg: cfg.default, }; @@ -498,7 +498,7 @@ const converters = { zclData: [{ attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, - attrData: utils.getKeyByValue(common.thermostat_system_modes, value, value), + attrData: utils.getKeyByValue(common.thermostatSystemModes, value, value), }], cfg: cfg.default, readAfterWriteTime: 250, diff --git a/converters/utils.js b/converters/utils.js index 04d0aee6b4db7..1c58dbb981606 100644 --- a/converters/utils.js +++ b/converters/utils.js @@ -50,7 +50,8 @@ function hexToRgb(hex) { } function getKeyByValue(object, value, fallback) { - return Number(Object.keys(object).find((k) => object[k] === value)) || fallback || 0; + const key = Object.keys(object).find((k) => object[k] === value); + return key != null ? Number(key) : (fallback || 0); } module.exports = { From f8f38040b4669c328c4461af12b6d6fc3ea3f4f4 Mon Sep 17 00:00:00 2001 From: Sebastian Raff Date: Sun, 27 Jan 2019 00:22:22 +0100 Subject: [PATCH 495/676] add hue/saturation support to light_color (#239) * add hue/saturation support to light_color * add hue/saturation support to light_color_colortemp * fix hue/saturation support to light_color_colortemp * Keep nodejs 4 support. --- converters/fromZigbee.js | 15 ++++++++++++- converters/toZigbee.js | 46 ++++++++++++++++++++++++++++++++++------ 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 282c71ca85e15..46c278fa1daba 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -550,7 +550,12 @@ const converters = { result.color_mode = msg.data.data['colorMode']; } - if (msg.data.data['currentX'] || msg.data.data['currentY']) { + if ( + msg.data.data['currentX'] + || msg.data.data['currentY'] + || msg.data.data['currentSaturation'] + || msg.data.data['enhancedCurrentHue'] + ) { result.color = {}; if (msg.data.data['currentX']) { @@ -560,6 +565,14 @@ const converters = { if (msg.data.data['currentY']) { result.color.y = precisionRound(msg.data.data['currentY'] / 65535, 3); } + + if (msg.data.data['currentSaturation']) { + result.color.saturation = precisionRound(msg.data.data['currentSaturation'] / 2.54, 1); + } + + if (msg.data.data['enhancedCurrentHue']) { + result.color.hue = precisionRound(msg.data.data['enhancedCurrentHue'] / (65535 / 360), 1); + } } return result; diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 858b976437f76..fdc90f76aaded 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -236,7 +236,8 @@ const converters = { const cid = 'lightingColorCtrl'; if (type === 'set') { - // Check if we need to convert from RGB to XY. + // Check if we need to convert from RGB to XY and which cmd to use + let cmd; if (value.hasOwnProperty('r') && value.hasOwnProperty('g') && value.hasOwnProperty('b')) { const xy = utils.rgbToXY(value.r, value.g, value.b); value.x = xy.x; @@ -250,17 +251,48 @@ const converters = { const xy = utils.hexToXY(value.hex); value.x = xy.x; value.y = xy.y; + } else if (value.hasOwnProperty('hue') && value.hasOwnProperty('saturation')) { + value.hue = value.hue * (65535 / 360); + value.saturation = value.saturation * (2.54); + cmd = 'enhancedMoveToHueAndSaturation'; + } else if (value.hasOwnProperty('hue')) { + value.hue = value.hue * (65535 / 360); + cmd = 'enhancedMoveToHue'; + } else if (value.hasOwnProperty('saturation')) { + value.saturation = value.saturation * (2.54); + cmd = 'moveToSaturation'; + } + + const zclData = { + transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, + }; + + switch (cmd) { + case 'enhancedMoveToHueAndSaturation': + zclData.enhancehue = value.hue; + zclData.saturation = value.saturation; + zclData.direction = value.direction || 0; + break; + case 'enhancedMoveToHue': + zclData.enhancehue = value.hue; + zclData.direction = value.direction || 0; + break; + + case 'moveToSaturation': + zclData.saturation = value.saturation; + break; + + default: + cmd = 'moveToColor'; + zclData.colorx = Math.round(value.x * 65535); + zclData.colory = Math.round(value.y * 65535); } return { cid: cid, - cmd: 'moveToColor', + cmd: cmd, cmdType: 'functional', - zclData: { - colorx: Math.round(value.x * 65535), - colory: Math.round(value.y * 65535), - transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, - }, + zclData: zclData, cfg: cfg.default, readAfterWriteTime: message.hasOwnProperty('transition') ? message.transition * 1000 : 0, }; From cd7d02db90f2ef4a343feabbb9e84d289b295b96 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 27 Jan 2019 00:33:02 +0100 Subject: [PATCH 496/676] 7.0.25 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 577d3994d5e1b..621517c21f067 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.24", + "version": "7.0.25", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ef4927a431a6a..1ab7abec6b3d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.24", + "version": "7.0.25", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 7eed948fab3c24a8a7c9f363d0834cf451c2e382 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Sun, 27 Jan 2019 20:26:57 +0100 Subject: [PATCH 497/676] FLS-CT (#243) * ZBT-ExtendedColor * FLS-CT * Update devices.js * Update devices.js --- devices.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 94c490ba3b30c..6922e910bfb30 100644 --- a/devices.js +++ b/devices.js @@ -1947,12 +1947,19 @@ const devices = [ // Dresden Elektronik { - zigbeeModel: ['FLS-PP3\u0000'], + zigbeeModel: ['FLS-PP3'], model: 'Mega23M12', vendor: 'Dresden Elektronik', description: 'ZigBee Light Link wireless electronic ballast', extend: generic.light_onoff_brightness_colortemp_colorxy, }, + { + zigbeeModel: ['FLS-CT'], + model: 'XVV-Mega23M12', + vendor: 'Dresden Elektronik', + description: 'ZigBee Light Link wireless electronic ballast color temperature', + extend: generic.light_onoff_brightness_colortemp, + }, // Centralite Swiss Plug { From 1e7629320aa68332205b15c49dc0d4a8c45917ac Mon Sep 17 00:00:00 2001 From: simonses1 <45721550+simonses1@users.noreply.github.com> Date: Sun, 27 Jan 2019 19:33:40 +0000 Subject: [PATCH 498/676] added SLP2b Hive Active Plug (#245) * added SLP2b * tidy spacing * Update devices.js * Update devices.js --- devices.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/devices.js b/devices.js index 6922e910bfb30..94a5944b4a88b 100644 --- a/devices.js +++ b/devices.js @@ -1100,6 +1100,28 @@ const devices = [ description: 'Active smart bulb white LED (B22)', extend: generic.light_onoff_brightness, }, + { + zigbeeModel: ['SLP2b'], + model: '1613V', + vendor: 'Hive', + description: 'Active plug', + supports: 'on/off, power measurement', + fromZigbee: [ + fz.generic_state, fz.ignore_onoff_change, fz.EDP_power, fz.ignore_metering_change, + fz.generic_temperature, fz.ignore_temperature_change, + ], + toZigbee: [tz.on_off], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 9); + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + (cb) => device.report('seMetering', 'instantaneousDemand', 10, 60, 1, cb), + ]; + execute(device, actions, callback); + }, + }, // Innr { From 1eb9fddd68045c2ec8682afb481703676db08f7b Mon Sep 17 00:00:00 2001 From: Gustav Johansson Date: Sun, 27 Jan 2019 21:07:47 +0100 Subject: [PATCH 499/676] HS1SA fixes (#247) * Added fix for bad iasCieAddr registration * Added battery measurement converter * Added battery measurement registration --- converters/fromZigbee.js | 21 +++++++++++++++++++++ devices.js | 11 +++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 46c278fa1daba..a0dedc8ca2c5b 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -848,6 +848,27 @@ const converters = { }; }, }, + heiman_smoke_battery: { + cid: 'genPowerCfg', + type: 'attReport', + convert: (model, msg, publish, options) => { + const batt = msg.data.data.batteryPercentageRemaining; + const battLow = msg.data.data.batteryAlarmState; + const results = {}; + if (batt != null) { + const value = Math.round(batt/255.0*10000)/100; // Out of 255 + results['battery'] = value; + } + if (battLow != null) { + if (battLow) { + results['battery_low'] = true; + } else { + results['battery_low'] = false; + } + } + return results; + }, + }, heiman_water_leak: { cid: 'ssIasZone', type: 'statusChange', diff --git a/devices.js b/devices.js index 94a5944b4a88b..33fc563dfa4b8 100644 --- a/devices.js +++ b/devices.js @@ -2025,13 +2025,20 @@ const devices = [ vendor: 'HEIMAN', description: 'Smoke detector', supports: 'smoke', - fromZigbee: [fz.heiman_smoke], + fromZigbee: [ + fz.heiman_smoke, + fz.heiman_smoke_battery, + fz.ignore_power_change, + ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const actions = [ - (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.bind('ssIasZone', coordinator, cb), (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 65535, 0, cb), // once per day + (cb) => device.report('genPowerCfg', 'batteryAlarmState', 1, 65535, 1, cb), ]; execute(device, actions, callback, 1000); From d6eb42276ca5c4035c1bae0c5b7a24588594df35 Mon Sep 17 00:00:00 2001 From: MarkAdamson Date: Mon, 28 Jan 2019 15:15:57 +0000 Subject: [PATCH 500/676] Added support for Salus SP600 Smart Plug (#248) * Add support for Hive HALIGHTDIMWWB22 (Bayonet mount) * Update devices.js * Added support for Salus SP600 Smart Plug * Salus SP600: Fix indentation * Rename EDP_power to generic_power --- converters/fromZigbee.js | 2 +- devices.js | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index a0dedc8ca2c5b..75d159bd343c3 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -982,7 +982,7 @@ const converters = { return result; }, }, - EDP_power: { + generic_power: { cid: 'seMetering', type: 'attReport', convert: (model, msg, publish, options) => { diff --git a/devices.js b/devices.js index 33fc563dfa4b8..0c49f9f48b8e9 100644 --- a/devices.js +++ b/devices.js @@ -794,7 +794,7 @@ const devices = [ vendor: 'EDP', description: 're:dy plug', supports: 'on/off, power measurement', - fromZigbee: [fz.ignore_onoff_change, fz.EDP_power, fz.ignore_metering_change], + fromZigbee: [fz.ignore_onoff_change, fz.generic_power, fz.ignore_metering_change], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 85); @@ -1107,7 +1107,7 @@ const devices = [ description: 'Active plug', supports: 'on/off, power measurement', fromZigbee: [ - fz.generic_state, fz.ignore_onoff_change, fz.EDP_power, fz.ignore_metering_change, + fz.generic_state, fz.ignore_onoff_change, fz.generic_power, fz.ignore_metering_change, fz.generic_temperature, fz.ignore_temperature_change, ], toZigbee: [tz.on_off], @@ -2216,6 +2216,28 @@ const devices = [ description: 'Tint LED bulb GU10/E14/E27 350/470/806 lumen, dimmable, opal white', extend: generic.light_onoff_brightness_colortemp, }, + + // Salus + { + zigbeeModel: ['SP600'], + model: 'SP600', + vendor: 'Salus', + description: 'Smart plug', + supports: 'on/off, power measurement', + fromZigbee: [fz.generic_state, fz.ignore_onoff_change, fz.generic_power, fz.ignore_metering_change], + toZigbee: [tz.on_off], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 9); + const onOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 5, repChange: 0}; + const actions = [ + (cb) => device.foundation('genOnOff', 'configReport', [onOff], foundationCfg, cb), + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.report('seMetering', 'instantaneousDemand', 1, 5, 1, cb), + ]; + + execute(device, actions, callback); + }, + }, ]; module.exports = devices.map((device) => From af4d92d0178f9d1b0a251fec6c54fdd4b9e57501 Mon Sep 17 00:00:00 2001 From: zipbee <46903217+zipbee@users.noreply.github.com> Date: Mon, 28 Jan 2019 21:12:11 +0000 Subject: [PATCH 501/676] Add support for Gledopto devices with multiple lights in one controller (#249) * Add support for Gledopto devices with multiple lights in one controller * Add support for Gledopto devices with multiple lights in one controller - fix eslint error --- devices.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/devices.js b/devices.js index 0c49f9f48b8e9..25c20326bb5f5 100644 --- a/devices.js +++ b/devices.js @@ -1568,6 +1568,11 @@ const devices = [ return {'': 12}; } else if (device.epList.toString() === '10,11,13' || device.epList.toString() === '11,13') { return {'': 11}; + } else if (device.epList.toString() === '11,12,13,15') { + return { + 'rgb': 12, + 'white': 15, + }; } else { return {}; } From 8b9092b7ad5155e49d72ad50128d2a5729ab0dea Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 28 Jan 2019 22:12:36 +0100 Subject: [PATCH 502/676] 7.0.26 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 621517c21f067..5f41846b7c443 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.25", + "version": "7.0.26", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1ab7abec6b3d1..ee187124f378a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.25", + "version": "7.0.26", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 044b7197235070f61bff6b3e797087986d7c966f Mon Sep 17 00:00:00 2001 From: Maxim Milakov Date: Tue, 29 Jan 2019 21:59:43 +0300 Subject: [PATCH 503/676] Added support for Gledopto GL-B-007Z bulb (#251) --- devices.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/devices.js b/devices.js index 25c20326bb5f5..5534c118b4e95 100644 --- a/devices.js +++ b/devices.js @@ -1610,6 +1610,22 @@ const devices = [ } }, }, + { + zigbeeModel: ['GL-B-007Z'], + model: 'GL-B-007Z', + vendor: 'Gledopto', + description: 'Smart 6W E27 RGB / CW LED bulb', + extend: generic.light_onoff_brightness_colortemp_colorxy, + ep: (device) => { + if (device.epList.toString() === '11,12,13') { + return {'': 12}; + } else if (device.epList.toString() === '10,11,13' || device.epList.toString() === '11,13') { + return {'': 11}; + } else { + return {}; + } + }, + }, { zigbeeModel: ['GL-B-008Z'], model: 'GL-B-008Z', From 2a2427f73cbbafaff000ac8d35b218b16eae5be9 Mon Sep 17 00:00:00 2001 From: Giel Date: Tue, 29 Jan 2019 11:04:19 -0800 Subject: [PATCH 504/676] Add support for AduroSmart ERIA White and Color bulbs. (#250) * Add support for AduroSmart ERIA White and Color bulbs. * Update devices.js --- devices.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/devices.js b/devices.js index 5534c118b4e95..9de92ed723bb1 100644 --- a/devices.js +++ b/devices.js @@ -2259,6 +2259,20 @@ const devices = [ execute(device, actions, callback); }, }, + + // AduroSmart + { + zigbeeModel: ['ZLL-ExtendedColo'], + model: '81809', + vendor: 'AduroSmart', + description: 'ERIA colors and white shades smart light bulb A19', + extend: generic.light_onoff_brightness_colortemp_colorxy, + ep: (device) => { + return { + '': 2, + }; + }, + }, ]; module.exports = devices.map((device) => From 1a31f85e0eaa64a00b3c1316feb5e5abcd1acae4 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 29 Jan 2019 20:04:48 +0100 Subject: [PATCH 505/676] 7.0.27 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5f41846b7c443..7cb0b0dc73c38 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.26", + "version": "7.0.27", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ee187124f378a..67246718f5b1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.26", + "version": "7.0.27", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 333302e8cc44ca3a60a2d0af4c03421cd2db063f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=98=D0=BB=D1=8C=D1=8F=20=D0=9A=D0=B8=D1=80=D0=BE=D0=B2?= Date: Wed, 30 Jan 2019 19:40:44 +0300 Subject: [PATCH 506/676] Q-FLAG LED Panel, Smart-Home RGBW (#252) https://www.paul-neuhaus.de/shop/de/led-panel-smart-home-alexa-tauglich-100-110-39.html --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index 9de92ed723bb1..ca56c71ced311 100644 --- a/devices.js +++ b/devices.js @@ -2212,6 +2212,13 @@ const devices = [ description: 'Q-INIGO LED ceiling light', extend: generic.light_onoff_brightness_colortemp, }, + { + zigbeeModel: ['NLG-RGBW light '], + model: '100.110.39', + vendor: 'Paul Neuhaus', + description: 'Q-FLAG LED Panel, Smart-Home RGBW', + extend: generic.light_onoff_brightness_colortemp_colorxy, + }, // iCasa { From 145b2c7a2db639bed3e37b867b32fa802da05850 Mon Sep 17 00:00:00 2001 From: Gustav Johansson Date: Wed, 30 Jan 2019 17:41:09 +0100 Subject: [PATCH 507/676] Hs1 sa battery (#253) * Fixed battery calculation. Zigbee standard states that 200 = 100% * Added enrollment and ZoneID detection --- converters/fromZigbee.js | 18 +++++++++++++++++- devices.js | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 75d159bd343c3..3a9d8d546b215 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -856,7 +856,7 @@ const converters = { const battLow = msg.data.data.batteryAlarmState; const results = {}; if (batt != null) { - const value = Math.round(batt/255.0*10000)/100; // Out of 255 + const value = Math.round(batt/200.0*10000)/100; // Out of 200 results['battery'] = value; } if (battLow != null) { @@ -869,6 +869,22 @@ const converters = { return results; }, }, + heiman_smoke_enrolled: { + cid: 'ssIasZone', + type: 'devChange', + convert: (model, msg, publish, options) => { + const zoneId = msg.data.data.zoneId; + const zoneState = msg.data.data.zoneState; + const results = {}; + if (zoneState) { + results['enrolled'] = true; + } else { + results['enrolled'] = false; + } + results['zone_id'] = zoneId; + return results; + }, + }, heiman_water_leak: { cid: 'ssIasZone', type: 'statusChange', diff --git a/devices.js b/devices.js index ca56c71ced311..5d9e802549130 100644 --- a/devices.js +++ b/devices.js @@ -2049,6 +2049,7 @@ const devices = [ fromZigbee: [ fz.heiman_smoke, fz.heiman_smoke_battery, + fz.heiman_smoke_enrolled, fz.ignore_power_change, ], toZigbee: [], From 871097aad55c0ae178339e961a8fe0ceb04f9a7f Mon Sep 17 00:00:00 2001 From: jbmbn <47156243+jbmbn@users.noreply.github.com> Date: Thu, 31 Jan 2019 20:41:59 +0100 Subject: [PATCH 508/676] add report handling to generic light_onoff_brightness (#258) * add report handling to generic light_onoff_brightness * Update devices.js * Update devices.js * Update devices.js --- devices.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/devices.js b/devices.js index 5d9e802549130..b9eed92a048de 100644 --- a/devices.js +++ b/devices.js @@ -11,22 +11,31 @@ const repInterval = { const generic = { light_onoff_brightness: { supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.light_state], + fromZigbee: [fz.light_brightness, fz.light_state, fz.generic_state, fz.light_brightness_report], toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colortemp: { supports: 'on/off, brightness, color temperature', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], + fromZigbee: [ + fz.light_brightness, fz.light_color_colortemp, fz.light_state, fz.generic_state, + fz.light_brightness_report, + ], toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colorxy: { supports: 'on/off, brightness, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], + fromZigbee: [ + fz.light_brightness, fz.light_color_colortemp, fz.light_state, fz.generic_state, + fz.light_brightness_report, + ], toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colortemp_colorxy: { supports: 'on/off, brightness, color temperature, color xy', - fromZigbee: [fz.light_brightness, fz.light_color_colortemp, fz.light_state], + fromZigbee: [ + fz.light_brightness, fz.light_color_colortemp, fz.light_state, fz.generic_state, + fz.light_brightness_report, + ], toZigbee: [ tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition, tz.light_alert, From 4d19df57f0367480ff8568e4bad6487fdd7de05c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 1 Feb 2019 19:44:00 +0100 Subject: [PATCH 509/676] 7.0.28 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7cb0b0dc73c38..176ade2ce919f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.27", + "version": "7.0.28", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 67246718f5b1d..d659183f925ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.27", + "version": "7.0.28", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From efea7980cd445d55105bd215138fe854e6a2e652 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Feb 2019 00:11:29 +0100 Subject: [PATCH 510/676] Simplify/cleanup some converters. --- converters/fromZigbee.js | 17 ++++-------- devices.js | 58 ++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 41 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3a9d8d546b215..e89adfceab3ae 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -522,21 +522,14 @@ const converters = { return {contact: msg.data.data['65281']['100'] === 0}; }, }, - light_state: { - cid: 'genOnOff', - type: 'devChange', - convert: (model, msg, publish, options) => { - return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; - }, - }, - light_brightness: { + brightness: { cid: 'genLevelCtrl', type: 'devChange', convert: (model, msg, publish, options) => { return {brightness: msg.data.data['currentLevel']}; }, }, - light_color_colortemp: { + color_colortemp: { cid: 'lightingColorCtrl', type: 'devChange', convert: (model, msg, publish, options) => { @@ -654,14 +647,14 @@ const converters = { return {water_leak: msg.data.zoneStatus === 1}; }, }, - generic_state: { + state: { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; }, }, - generic_state_change: { + state_change: { cid: 'genOnOff', type: 'devChange', convert: (model, msg, publish, options) => { @@ -1310,7 +1303,7 @@ const converters = { }; }, }, - light_brightness_report: { + brightness_report: { cid: 'genLevelCtrl', type: 'attReport', convert: (model, msg, publish, options) => { diff --git a/devices.js b/devices.js index b9eed92a048de..eefc1a29e5c17 100644 --- a/devices.js +++ b/devices.js @@ -11,30 +11,30 @@ const repInterval = { const generic = { light_onoff_brightness: { supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.light_state, fz.generic_state, fz.light_brightness_report], + fromZigbee: [fz.brightness, fz.state_change, fz.state, fz.brightness_report], toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colortemp: { supports: 'on/off, brightness, color temperature', fromZigbee: [ - fz.light_brightness, fz.light_color_colortemp, fz.light_state, fz.generic_state, - fz.light_brightness_report, + fz.brightness, fz.color_colortemp, fz.state_change, fz.state, + fz.brightness_report, ], toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colorxy: { supports: 'on/off, brightness, color xy', fromZigbee: [ - fz.light_brightness, fz.light_color_colortemp, fz.light_state, fz.generic_state, - fz.light_brightness_report, + fz.brightness, fz.color_colortemp, fz.state_change, fz.state, + fz.brightness_report, ], toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colortemp_colorxy: { supports: 'on/off, brightness, color temperature, color xy', fromZigbee: [ - fz.light_brightness, fz.light_color_colortemp, fz.light_state, fz.generic_state, - fz.light_brightness_report, + fz.brightness, fz.color_colortemp, fz.state_change, fz.state, + fz.brightness_report, ], toZigbee: [ tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition, @@ -111,7 +111,7 @@ const devices = [ description: 'Aqara smart LED bulb', extend: generic.light_onoff_brightness_colortemp, fromZigbee: [ - fz.light_brightness, fz.light_color_colortemp, fz.generic_state, fz.xiaomi_bulb_interval, + fz.brightness, fz.color_colortemp, fz.state, fz.xiaomi_bulb_interval, fz.ignore_light_brightness_report, fz.ignore_light_color_colortemp_report, fz.ignore_onoff_change, fz.ignore_basic_change, ], @@ -329,7 +329,7 @@ const devices = [ supports: 'on/off, power measurement', vendor: 'Xiaomi', fromZigbee: [ - fz.generic_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, + fz.state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_analog_change, ], toZigbee: [tz.on_off], @@ -341,7 +341,7 @@ const devices = [ supports: 'on/off, power measurement', vendor: 'Xiaomi', fromZigbee: [ - fz.generic_state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, + fz.state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_analog_change, ], toZigbee: [tz.on_off], @@ -546,7 +546,7 @@ const devices = [ description: 'TRADFRI control outlet', supports: 'on/off', vendor: 'IKEA', - fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + fromZigbee: [fz.ignore_onoff_change, fz.state], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); @@ -827,7 +827,7 @@ const devices = [ vendor: 'Custom devices (DiY)', description: '[DNCKAT single key wired wall light switch](https://github.com/dzungpv/dnckatsw00x/)', supports: 'on/off', - fromZigbee: [fz.generic_state, fz.ignore_onoff_change], + fromZigbee: [fz.state, fz.ignore_onoff_change], toZigbee: [tz.on_off], }, { @@ -989,7 +989,7 @@ const devices = [ description: 'Smart+ plug', supports: 'on/off', vendor: 'OSRAM', - fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + fromZigbee: [fz.ignore_onoff_change, fz.state], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 3); @@ -1116,7 +1116,7 @@ const devices = [ description: 'Active plug', supports: 'on/off, power measurement', fromZigbee: [ - fz.generic_state, fz.ignore_onoff_change, fz.generic_power, fz.ignore_metering_change, + fz.state, fz.ignore_onoff_change, fz.generic_power, fz.ignore_metering_change, fz.generic_temperature, fz.ignore_temperature_change, ], toZigbee: [tz.on_off], @@ -1272,7 +1272,7 @@ const devices = [ vendor: 'Innr', description: 'Smart plug', supports: 'on/off, power measurement', - fromZigbee: [fz.ignore_electrical_change, fz.SP120_power, fz.generic_state, fz.ignore_onoff_change], + fromZigbee: [fz.ignore_electrical_change, fz.SP120_power, fz.state, fz.ignore_onoff_change], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); @@ -1343,7 +1343,7 @@ const devices = [ vendor: 'Sylvania', description: 'SMART+ Smart Plug', supports: 'on/off', - fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + fromZigbee: [fz.ignore_onoff_change, fz.state], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); @@ -1392,7 +1392,7 @@ const devices = [ vendor: 'GE', description: 'ZigBee plug-in smart dimmer', supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change, fz.generic_state], + fromZigbee: [fz.brightness, fz.ignore_onoff_change, fz.state], toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], configure: (ieeeAddr, shepherd, coordinator, callback) => { const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; @@ -1411,7 +1411,7 @@ const devices = [ vendor: 'GE', description: 'In-wall smart switch', supports: 'on/off', - fromZigbee: [fz.ignore_onoff_change, fz.generic_state], + fromZigbee: [fz.ignore_onoff_change, fz.state], toZigbee: [tz.on_off, tz.ignore_transition], configure: (ieeeAddr, shepherd, coordinator, callback) => { const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; @@ -1430,7 +1430,7 @@ const devices = [ vendor: 'GE', description: 'ZigBee in-wall smart dimmer', supports: 'on/off, brightness', - fromZigbee: [fz.light_brightness, fz.ignore_onoff_change, fz.generic_state], + fromZigbee: [fz.brightness, fz.ignore_onoff_change, fz.state], toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], configure: (ieeeAddr, shepherd, coordinator, callback) => { const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; @@ -1511,7 +1511,7 @@ const devices = [ vendor: 'Netvox', description: 'Power socket with power consumption monitoring', supports: 'on/off, power measurement', - fromZigbee: [fz.generic_state, fz.ignore_onoff_change, fz.ignore_electrical_change, fz.Z809A_power], + fromZigbee: [fz.state, fz.ignore_onoff_change, fz.ignore_electrical_change, fz.Z809A_power], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); @@ -1542,7 +1542,7 @@ const devices = [ vendor: 'Nue', description: 'ZigBee one gang smart switch', supports: 'on/off', - fromZigbee: [fz.generic_state], + fromZigbee: [fz.state], toZigbee: [tz.on_off], }, { @@ -1859,7 +1859,7 @@ const devices = [ vendor: 'Bitron', description: 'Video wireless socket', supports: 'on/off, power measurement', - fromZigbee: [fz.generic_state, fz.ignore_onoff_change, fz.ignore_metering_change, fz.bitron_power], + fromZigbee: [fz.state, fz.ignore_onoff_change, fz.ignore_metering_change, fz.bitron_power], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); @@ -1914,7 +1914,7 @@ const devices = [ vendor: 'Iris', description: 'Smart plug', supports: 'on/off', - fromZigbee: [fz.ignore_onoff_change, fz.ignore_electrical_change, fz.generic_state, fz.iris_3210L_power], + fromZigbee: [fz.ignore_onoff_change, fz.ignore_electrical_change, fz.state, fz.iris_3210L_power], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); @@ -1975,7 +1975,7 @@ const devices = [ description: '[Zigbee OnOff Controller](http://ksentry.manufacturer.globalsources.com/si/6008837134660'+ '/pdtl/ZigBee-module/1162731630/zigbee-on-off-controller-modules.htm)', supports: 'on/off', - fromZigbee: [fz.generic_state_change], + fromZigbee: [fz.state_change], toZigbee: [tz.on_off], }, @@ -2020,7 +2020,7 @@ const devices = [ vendor: 'Centralite', description: 'White Swiss power outlet switch with power meter', supports: 'switch and power meter', - fromZigbee: [fz.ignore_onoff_change, fz.generic_state, fz.ignore_electrical_change, fz.RZHAC_4256251_power], + fromZigbee: [fz.ignore_onoff_change, fz.state, fz.ignore_electrical_change, fz.RZHAC_4256251_power], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); @@ -2044,7 +2044,7 @@ const devices = [ vendor: 'Climax', description: 'Power plug', supports: 'on/off', - fromZigbee: [fz.generic_state_change], + fromZigbee: [fz.state_change], toZigbee: [tz.on_off], }, @@ -2171,7 +2171,7 @@ const devices = [ vendor: 'Airam', description: 'LED OP A60 ZB 9W/827 E27', extend: generic.light_onoff_brightness, - fromZigbee: [fz.light_state, fz.light_brightness_report, fz.light_brightness, fz.generic_state], + fromZigbee: [fz.state_change, fz.brightness_report, fz.brightness, fz.state], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; @@ -2210,7 +2210,7 @@ const devices = [ vendor: 'Smart Home Pty', description: 'Power plug', supports: 'on/off', - fromZigbee: [fz.generic_state_change], + fromZigbee: [fz.state_change], toZigbee: [tz.on_off], }, @@ -2262,7 +2262,7 @@ const devices = [ vendor: 'Salus', description: 'Smart plug', supports: 'on/off, power measurement', - fromZigbee: [fz.generic_state, fz.ignore_onoff_change, fz.generic_power, fz.ignore_metering_change], + fromZigbee: [fz.state, fz.ignore_onoff_change, fz.generic_power, fz.ignore_metering_change], toZigbee: [tz.on_off], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 9); From be56ba8e79fa7b342e26758af9f1094b8c16cbd6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Feb 2019 00:32:20 +0100 Subject: [PATCH 511/676] Add color color_temp report converter. --- converters/fromZigbee.js | 42 ++++++++++++++++++++++++++++++++++++++++ devices.js | 8 ++++---- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index e89adfceab3ae..ef938b33e11b7 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -571,6 +571,48 @@ const converters = { return result; }, }, + color_colortemp_report: { + cid: 'lightingColorCtrl', + type: 'attReport', + convert: (model, msg, publish, options) => { + const result = {}; + + if (msg.data.data['colorTemperature']) { + result.color_temp = msg.data.data['colorTemperature']; + } + + if (msg.data.data['colorMode']) { + result.color_mode = msg.data.data['colorMode']; + } + + if ( + msg.data.data['currentX'] + || msg.data.data['currentY'] + || msg.data.data['currentSaturation'] + || msg.data.data['enhancedCurrentHue'] + ) { + result.color = {}; + + if (msg.data.data['currentX']) { + result.color.x = precisionRound(msg.data.data['currentX'] / 65535, 3); + } + + if (msg.data.data['currentY']) { + result.color.y = precisionRound(msg.data.data['currentY'] / 65535, 3); + } + + if (msg.data.data['currentSaturation']) { + result.color.saturation = precisionRound(msg.data.data['currentSaturation'] / 2.54, 1); + } + + if (msg.data.data['enhancedCurrentHue']) { + result.color.hue = precisionRound(msg.data.data['enhancedCurrentHue'] / (65535 / 360), 1); + } + } + + return result; + }, + }, WXKG11LM_click: { cid: 'genOnOff', type: 'attReport', diff --git a/devices.js b/devices.js index eefc1a29e5c17..0d5c7996e1e6f 100644 --- a/devices.js +++ b/devices.js @@ -18,7 +18,7 @@ const generic = { supports: 'on/off, brightness, color temperature', fromZigbee: [ fz.brightness, fz.color_colortemp, fz.state_change, fz.state, - fz.brightness_report, + fz.brightness_report, fz.color_colortemp_report, ], toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], }, @@ -26,7 +26,7 @@ const generic = { supports: 'on/off, brightness, color xy', fromZigbee: [ fz.brightness, fz.color_colortemp, fz.state_change, fz.state, - fz.brightness_report, + fz.brightness_report, fz.color_colortemp_report, ], toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], }, @@ -34,11 +34,11 @@ const generic = { supports: 'on/off, brightness, color temperature, color xy', fromZigbee: [ fz.brightness, fz.color_colortemp, fz.state_change, fz.state, - fz.brightness_report, + fz.brightness_report, fz.color_colortemp_report, ], toZigbee: [ tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition, - tz.light_alert, + tz.light_alert, fz.color_colortemp_report, ], }, }; From 1064a541e1c54665d9b7463f009648795f5c320b Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Feb 2019 00:32:31 +0100 Subject: [PATCH 512/676] 7.0.29 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 176ade2ce919f..bde6f493c3925 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.28", + "version": "7.0.29", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d659183f925ed..11ea3e2267267 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.28", + "version": "7.0.29", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From cd0ef9f32c27bedbe5d7b0782c630ab46ee434a2 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Feb 2019 00:42:50 +0100 Subject: [PATCH 513/676] Fix typo --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 0d5c7996e1e6f..8713df4ae8a79 100644 --- a/devices.js +++ b/devices.js @@ -38,7 +38,7 @@ const generic = { ], toZigbee: [ tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition, - tz.light_alert, fz.color_colortemp_report, + tz.light_alert, ], }, }; From 2a0f8469b4ce18d5614a6cb696d66d06661c2b11 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Feb 2019 00:42:58 +0100 Subject: [PATCH 514/676] 7.0.30 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index bde6f493c3925..e07fa47cbfc20 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.29", + "version": "7.0.30", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 11ea3e2267267..8f0bc5852e572 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.29", + "version": "7.0.30", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 098a1bf75dc43a9f912459747c9946468bb7dc7c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Feb 2019 01:41:22 +0100 Subject: [PATCH 515/676] Fix state get converter. --- converters/toZigbee.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index fdc90f76aaded..760556232a4a4 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -37,11 +37,11 @@ const converters = { const cid = 'genOnOff'; const attrId = 'onOff'; - if (typeof value !== 'string') { - return; - } - if (type === 'set') { + if (typeof value !== 'string') { + return; + } + return { cid: cid, cmd: value.toLowerCase(), From ecb4ddcc55a4c86866f14fe73a9689a8d616ac6e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Feb 2019 01:41:43 +0100 Subject: [PATCH 516/676] 7.0.31 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e07fa47cbfc20..64c95bdb404ec 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.30", + "version": "7.0.31", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 8f0bc5852e572..57f36013234c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.30", + "version": "7.0.31", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From ba9eedcc5afe6baec3121580dc4636197cea1e0f Mon Sep 17 00:00:00 2001 From: ptvo <33662022+ptvoinfo@users.noreply.github.com> Date: Sat, 2 Feb 2019 22:21:23 +0300 Subject: [PATCH 517/676] Added handlers for Livolo (#256) * Added handlers for Livolo * Formatting corrections * Update fromZigbee.js * Update devices.js * Updates handlers for Livolo * Fixes * Update devices.js * Updates. --- converters/fromZigbee.js | 19 ++++++ converters/toZigbee.js | 122 ++++++++++++++++++++++++++++----------- devices.js | 13 +++++ test/verify.js | 2 +- 4 files changed, 121 insertions(+), 35 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index ef938b33e11b7..c9d6f4b2c538c 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1556,6 +1556,20 @@ const converters = { return {action: `brightness_down_release`}; }, }, + livolo_switch_dev_change: { + cid: 'genOnOff', + type: 'devChange', + convert: (model, msg, publish, options) => { + const status = msg.data.data.onOff; + const payload = {}; + payload['state_left'] = status & 1 ? 'ON' : 'OFF'; + payload['state_right'] = status & 2 ? 'ON' : 'OFF'; + if (msg.endpoints[0].hasOwnProperty('linkquality')) { + payload['linkquality'] = msg.endpoints[0].linkquality; + } + return payload; + }, + }, // Ignore converters (these message dont need parsing). ignore_doorlock_change: { @@ -1568,6 +1582,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_onoff_report: { + cid: 'genOnOff', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, ignore_basic_change: { cid: 'genBasic', type: 'devChange', diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 760556232a4a4..39863e6765bf8 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -19,7 +19,7 @@ const cfg = { const converters = { factory_reset: { key: ['reset'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { if (type === 'set') { return { cid: 'genBasic', @@ -33,7 +33,7 @@ const converters = { }, on_off: { key: ['state'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'genOnOff'; const attrId = 'onOff'; @@ -63,7 +63,7 @@ const converters = { generic_occupancy_timeout: { // set delay after motion detector changes from occupied to unoccupied key: ['occupancy_timeout'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'msOccupancySensing'; // 1030 const attrId = zclId.attr(cid, 'pirOToUDelay').value; // = 16 @@ -98,7 +98,7 @@ const converters = { }, hue_power_on_behavior: { key: ['hue_power_on_behavior'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const lookup = { 'default': 0x01, 'on': 0x01, @@ -123,7 +123,7 @@ const converters = { }, hue_power_on_brightness: { key: ['hue_power_on_brightness'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { if (type === 'set') { if (value === 'default') { value = 255; @@ -144,7 +144,7 @@ const converters = { }, hue_power_on_color_temperature: { key: ['hue_power_on_color_temperature'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { if (type === 'set') { if (value === 'default') { value = 366; @@ -165,7 +165,7 @@ const converters = { }, light_brightness: { key: ['brightness', 'brightness_percent'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'genLevelCtrl'; const attrId = 'currentLevel'; @@ -198,7 +198,7 @@ const converters = { }, light_colortemp: { key: ['color_temp', 'color_temp_percent'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'lightingColorCtrl'; const attrId = 'colorTemperature'; @@ -232,7 +232,7 @@ const converters = { }, light_color: { key: ['color'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'lightingColorCtrl'; if (type === 'set') { @@ -312,7 +312,7 @@ const converters = { }, light_alert: { key: ['alert', 'flash'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'genIdentify'; if (type === 'set') { const lookup = { @@ -342,7 +342,7 @@ const converters = { }, thermostat_local_temperature: { key: 'local_temperature', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'localTemp'; if (type === 'get') { @@ -358,7 +358,7 @@ const converters = { }, thermostat_local_temperature_calibration: { key: 'local_temperature_calibration', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'localTemperatureCalibration'; if (type === 'set') { @@ -385,7 +385,7 @@ const converters = { }, thermostat_occupancy: { key: 'occupancy', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'ocupancy'; if (type === 'get') { @@ -401,7 +401,7 @@ const converters = { }, thermostat_occupied_heating_setpoint: { key: 'occupied_heating_setpoint', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'occupiedHeatingSetpoint'; if (type === 'set') { @@ -429,7 +429,7 @@ const converters = { }, thermostat_unoccupied_heating_setpoint: { key: 'unoccupied_heating_setpoint', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'unoccupiedHeatingSetpoint'; if (type === 'set') { @@ -457,7 +457,7 @@ const converters = { }, thermostat_remote_sensing: { key: 'remote_sensing', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'remoteSensing'; if (type === 'set') { @@ -491,7 +491,7 @@ const converters = { }, thermostat_control_sequence_of_operation: { key: 'control_sequence_of_operation', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'ctrlSeqeOfOper'; if (type === 'set') { @@ -519,7 +519,7 @@ const converters = { }, thermostat_system_mode: { key: 'system_mode', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'systemMode'; if (type === 'set') { @@ -548,7 +548,7 @@ const converters = { }, thermostat_setpoint_raise_lower: { key: 'setpoint_raise_lower', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'setpointRaiseLower'; if (type === 'set') { @@ -577,7 +577,7 @@ const converters = { }, thermostat_weekly_schedule: { key: 'weekly_schedule', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'weeklySchedule'; if (type === 'set') { @@ -609,7 +609,7 @@ const converters = { thermostat_clear_weekly_schedule: { key: 'clear_weekly_schedule', attr: [], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { return { cid: 'hvacThermostat', cmd: 'clearWeeklySchedule', @@ -621,7 +621,7 @@ const converters = { thermostat_relay_status_log: { key: 'relay_status_log', attr: [], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { return { cid: 'hvacThermostat', cmd: 'getRelayStatusLog', @@ -633,7 +633,7 @@ const converters = { thermostat_weekly_schedule_rsp: { key: 'weekly_schedule_rsp', attr: [], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { return { cid: 'hvacThermostat', cmd: 'getWeeklyScheduleRsp', @@ -650,7 +650,7 @@ const converters = { thermostat_relay_status_log_rsp: { key: 'relay_status_log_rsp', attr: [], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { return { cid: 'hvacThermostat', cmd: 'getRelayStatusLogRsp', @@ -668,7 +668,7 @@ const converters = { }, thermostat_running_mode: { key: 'running_mode', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'runningMode'; if (type === 'get') { @@ -684,7 +684,7 @@ const converters = { }, thermostat_running_state: { key: 'running_state', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; const attrId = 'runningState'; if (type === 'get') { @@ -700,7 +700,7 @@ const converters = { }, thermostat_temperature_display_mode: { key: 'temperature_display_mode', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'hvacUserInterfaceCfg'; const attrId = 'tempDisplayMode'; if (type === 'set') { @@ -724,7 +724,7 @@ const converters = { */ DJT11LM_vibration_sensitivity: { key: ['sensitivity'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'genBasic'; const attrId = 0xFF0D; @@ -761,7 +761,7 @@ const converters = { }, JTQJBF01LMBW_sensitivity: { key: ['sensitivity'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'ssIasZone'; if (type === 'set') { @@ -800,7 +800,7 @@ const converters = { }, JTQJBF01LMBW_selfest: { key: ['selftest'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { if (type === 'set') { return { cid: 'ssIasZone', @@ -818,7 +818,7 @@ const converters = { }, STS_PRS_251_beep: { key: ['beep'], - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const cid = 'genIdentify'; const attrId = 'identifyTime'; @@ -845,7 +845,7 @@ const converters = { }, ZNCLDJ11LM_control: { key: 'state', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { const lookup = { 'open': 'upOpen', 'close': 'downClose', @@ -868,7 +868,7 @@ const converters = { }, ZNCLDJ11LM_control_position: { key: 'position', - convert: (key, value, message, type) => { + convert: (key, value, message, type, postfix) => { return { cid: 'genAnalogOutput', cmd: 'write', @@ -882,12 +882,66 @@ const converters = { }; }, }, + livolo_switch_on_off: { + key: ['state'], + convert: (key, value, message, type, postfix) => { + if (type === 'set') { + if (typeof value !== 'string') { + return; + } + + postfix = postfix || 'left'; + + const cid = 'genLevelCtrl'; + let state = value.toLowerCase(); + let channel = 1; + + if (state === 'on') { + state = 108; + } else if (state === 'off') { + state = 1; + } else { + return; + } + + if (postfix === 'left') { + channel = 1.0; + } else if (postfix === 'right') { + channel = 2.0; + } else { + return; + } + + return { + cid: cid, + cmd: 'moveToLevelWithOnOff', + cmdType: 'functional', + zclData: { + level: state, + transtime: channel, + }, + cfg: cfg.default, + readAfterWriteTime: 250, + }; + } else if (type === 'get') { + const cid = 'genOnOff'; + const attrId = 'onOff'; + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, // Ignore converters ignore_transition: { key: ['transition'], attr: [], - convert: (key, value, message, type) => null, + convert: (key, value, message, type, postfix) => null, }, }; diff --git a/devices.js b/devices.js index 8713df4ae8a79..dc49c5fed4916 100644 --- a/devices.js +++ b/devices.js @@ -2290,6 +2290,19 @@ const devices = [ }; }, }, + + // Livolo + { + zigbeeModel: ['TI0001 '], + model: 'TI0001', + description: + 'Zigbee switch (1 and 2 gang) ' + + '[work in progress](https://github.com/Koenkk/zigbee2mqtt/issues/592)', + vendor: 'Livolo', + supports: 'on/off', + fromZigbee: [fz.ignore_onoff_report, fz.livolo_switch_dev_change], + toZigbee: [tz.livolo_switch_on_off], + }, ]; module.exports = devices.map((device) => diff --git a/test/verify.js b/test/verify.js index e960d2d7c0e26..e632ae63761c9 100644 --- a/test/verify.js +++ b/test/verify.js @@ -46,7 +46,7 @@ devices.forEach((device) => { converterKey, ); - assert.strictEqual(4, converter.convert.length, `${converterKey}: convert() invalid arguments length`); + assert.strictEqual(5, converter.convert.length, `${converterKey}: convert() invalid arguments length`); }); // Check for duplicate zigbee model ids From 4f776d13fa8a83ded689b831d6fd376743279ed3 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Feb 2019 20:21:48 +0100 Subject: [PATCH 518/676] 7.1.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 64c95bdb404ec..e522a231f063c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.31", + "version": "7.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 57f36013234c9..1ed4b71a3d0c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.0.31", + "version": "7.1.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From bd33692200f23f8dfa59c64d27a7173662b1044f Mon Sep 17 00:00:00 2001 From: Giel Date: Sun, 3 Feb 2019 05:27:56 -0800 Subject: [PATCH 519/676] Add combined toZigbee color and colortemp converter. (#260) * Add support for AduroSmart ERIA White and Color bulbs. * Update devices.js * Add combined toZigbee color and colortemp convertor. This convertor is a combination of light_color and light_colortemp and can be used instead of the two individual convertors. When used to set, it actually calls out to light_color or light_colortemp to get the return value. When used to get, it gets both color and colorTemp in one call. The reason for the existence of this somewhat peculiar converter is that some lights don't report their state when changed. To fix this, we query the state after we set it. We want to query color and colorTemp both when setting either, because both change when setting one. This converter is used to do just that. We're using this convertor by default now in generic.light_onoff_brightness_colortemp_colorxy because it can't hurt. * Typos. --- converters/toZigbee.js | 35 +++++++++++++++++++++++++++++++++++ devices.js | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 39863e6765bf8..0cf8011e31284 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -310,6 +310,41 @@ const converters = { } }, }, + // This converter is a combination of light_color and light_colortemp and + // can be used instead of the two individual converters. When used to set, + // it actually calls out to light_color or light_colortemp to get the + // return value. When used to get, it gets both color and colorTemp in + // one call. + // The reason for the existence of this somewhat peculiar converter is + // that some lights don't report their state when changed. To fix this, + // we query the state after we set it. We want to query color and colorTemp + // both when setting either, because both change when setting one. This + // converter is used to do just that. + light_color_colortemp: { + key: ['color', 'color_temp', 'color_temp_percent'], + convert: (key, value, message, type, postfix) => { + const cid = 'lightingColorCtrl'; + if (type === 'set') { + if (key == 'color') { + return converters.light_color.convert(key, value, message, type, postfix); + } else if (key == 'color_temp' || key == 'color_temp_percent') { + return converters.light_colortemp.convert(key, value, message, type, postfix); + } + } else if (type == 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [ + {attrId: zclId.attr(cid, 'currentX').value}, + {attrId: zclId.attr(cid, 'currentY').value}, + {attrId: zclId.attr(cid, 'colorTemperature').value}, + ], + cfg: cfg.default, + }; + } + }, + }, light_alert: { key: ['alert', 'flash'], convert: (key, value, message, type, postfix) => { diff --git a/devices.js b/devices.js index dc49c5fed4916..91eacfcad8533 100644 --- a/devices.js +++ b/devices.js @@ -37,7 +37,7 @@ const generic = { fz.brightness_report, fz.color_colortemp_report, ], toZigbee: [ - tz.on_off, tz.light_brightness, tz.light_colortemp, tz.light_color, tz.ignore_transition, + tz.on_off, tz.light_brightness, tz.light_color_colortemp, tz.ignore_transition, tz.light_alert, ], }, From 63c3c73387cfae46cd35d881abde898a3f2c5703 Mon Sep 17 00:00:00 2001 From: Martin Helff Date: Sun, 3 Feb 2019 14:41:14 +0100 Subject: [PATCH 520/676] Added Eurotronic Spirit Zigbee thermostat (#254) * Added Eurotronic Spirit Zigbee thermostat * adjust Spirit Zigbee thermostat binding due to pr comments * fix linter errors * renamed specific attributes with eurotronic prefix, cleanup converters * update model and description to match convention for documentation * remove trailing space * remove trailing space * added postfix parameter to eurotronic converters --- converters/fromZigbee.js | 29 ++++++++++++++++++ converters/toZigbee.js | 63 ++++++++++++++++++++++++++++++++++++++++ devices.js | 32 ++++++++++++++++++++ 3 files changed, 124 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index c9d6f4b2c538c..bfe1f51a37ab3 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1419,6 +1419,9 @@ const converters = { if (typeof state == 'number' && common.thermostatRunningStates.hasOwnProperty(state)) { result.running_state = common.thermostatRunningStates[state]; } + if (typeof msg.data.data['pIHeatingDemand'] == 'number') { + result.pi_heating_demand = msg.data.data['pIHeatingDemand']; + } return result; }, }, @@ -1476,6 +1479,27 @@ const converters = { if (typeof state == 'number' && common.thermostatRunningStates.hasOwnProperty(state)) { result.running_state = common.thermostatRunningStates[state]; } + if (typeof msg.data.data['pIHeatingDemand'] == 'number') { + result.pi_heating_demand = msg.data.data['pIHeatingDemand']; + } + return result; + }, + }, + eurotronic_thermostat_att_report: { + cid: 'hvacThermostat', + type: 'attReport', + convert: (model, msg, publish, options) => { + const result = {}; + if (typeof msg.data.data[16387] == 'number') { + result.current_heating_setpoint = + precisionRound(msg.data.data[16387], 2) / 100; + } + if (typeof msg.data.data[16392] == 'number') { + result.eurotronic_system_mode = msg.data.data[16392]; + } + if (typeof msg.data.data[16386] == 'number') { + result.eurotronic_16386 = msg.data.data[16386]; + } return result; }, }, @@ -1677,6 +1701,11 @@ const converters = { type: 'attReport', convert: (model, msg, publish, options) => null, }, + ignore_thermostat_change: { + cid: 'hvacThermostat', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 0cf8011e31284..406f17af43454 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -14,6 +14,10 @@ const cfg = { disDefaultRsp: 1, manufCode: 0x115F, }, + eurotronic: { + manufSpec: 1, + manufCode: 4151, + }, }; const converters = { @@ -917,6 +921,65 @@ const converters = { }; }, }, + eurotronic_system_mode: { + key: 'eurotronic_system_mode', + convert: (key, value, message, type, postfix) => { + const cid = 'hvacThermostat'; + const attrId = 16392; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + // Bit 0 = ? (default 1) + // Bit 2 = Boost + // Bit 7 = Child protection + attrId: attrId, + dataType: 0x22, + attrData: value, + }], + cfg: cfg.eurotronic, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: attrId}], + cfg: cfg.eurotronic, + }; + } + }, + }, + eurotronic_16386: { + key: 'eurotronic_16386', + convert: (key, value, message, type, postfix) => { + const cid = 'hvacThermostat'; + const attrId = 16386; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: attrId, + dataType: 0x20, + attrData: value, + }], + cfg: cfg.eurotronic, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: attrId}], + cfg: cfg.eurotronic, + }; + } + }, + }, livolo_switch_on_off: { key: ['state'], convert: (key, value, message, type, postfix) => { diff --git a/devices.js b/devices.js index 91eacfcad8533..8e81adcdbbc53 100644 --- a/devices.js +++ b/devices.js @@ -2291,6 +2291,38 @@ const devices = [ }, }, + // Eurotronic + { + zigbeeModel: ['SPZB0001'], + model: 'SPZB0001', + vendor: 'Eurotronic', + description: 'Spirit Zigbee wireless heater thermostat', + supports: 'temperature, heating system control', + fromZigbee: [ + fz.thermostat_att_report, fz.eurotronic_thermostat_att_report, + fz.ignore_thermostat_change, fz.hue_battery, fz.ignore_power_change, + ], + toZigbee: [ + tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint, + tz.thermostat_local_temperature_calibration, tz.thermostat_system_mode, + tz.eurotronic_system_mode, tz.eurotronic_16386, tz.thermostat_setpoint_raise_lower, + tz.thermostat_control_sequence_of_operation, tz.thermostat_remote_sensing, + ], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('hvacThermostat', coordinator, cb), + (cb) => device.report('hvacThermostat', 'localTemp', 1, 1200, 25, cb), + (cb) => device.foundation('hvacThermostat', 'configReport', [{ + direction: 0, attrId: 16387, dataType: 41, minRepIntval: 0, + maxRepIntval: 600, repChange: 25}], {manufSpec: 1, manufCode: 4151}, cb), + ]; + + execute(device, actions, callback); + }, + }, + // Livolo { zigbeeModel: ['TI0001 '], From 2f84b104b13ace87f9a8f90fd29d230eb40e6cc8 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 3 Feb 2019 14:41:44 +0100 Subject: [PATCH 521/676] 7.1.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e522a231f063c..907f6f60a6a4f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.0", + "version": "7.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1ed4b71a3d0c7..62b27eb4f3b01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.0", + "version": "7.1.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 484f9430c1f4b5f6e476e350186e31c9b60314e3 Mon Sep 17 00:00:00 2001 From: Roman Zhukov Date: Sun, 3 Feb 2019 20:07:00 +0300 Subject: [PATCH 522/676] Fix Xiaomi Gas sensor density json attr (#263) --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index bfe1f51a37ab3..cf35fda83c686 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -959,7 +959,7 @@ const converters = { if (data && data['65281']) { const basicAttrs = data['65281']; if (basicAttrs.hasOwnProperty('100')) { - return {density: basicAttrs['100']}; + return {gas_density: basicAttrs['100']}; } } }, From 88d3fa4c22c0a47f870641edfc3e87f29997ab84 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 3 Feb 2019 18:11:02 +0100 Subject: [PATCH 523/676] 7.1.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 907f6f60a6a4f..366024d59a59c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.1", + "version": "7.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 62b27eb4f3b01..c7811d2474b65 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.1", + "version": "7.1.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 2c3a62fc0ee0be5ae339276368a79229d076e2dc Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Sun, 3 Feb 2019 19:06:13 +0100 Subject: [PATCH 524/676] Introduce Ninja Smart plug to devices.js (#262) * Update devices.js * Intro-Ninja-Plug Introduced device entry for Ninja Smart plug from Ninja Block inc, including power metering and on/off support * Update devices.js --- devices.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/devices.js b/devices.js index 8e81adcdbbc53..55ffc30811462 100644 --- a/devices.js +++ b/devices.js @@ -1979,6 +1979,27 @@ const devices = [ toZigbee: [tz.on_off], }, + // Ninja Blocks + { + zigbeeModel: ['Ninja Smart plug'], + model: 'Z809AF', + vendor: 'Ninja Blocks', + description: 'Zigbee smart plug with power meter', + supports: 'on/off, power measurement', + fromZigbee: [fz.ignore_onoff_change, fz.state, fz.generic_power, fz.ignore_metering_change], + toZigbee: [tz.on_off], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const actions = [ + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.report('seMetering', 'instantaneousDemand', 10, 60, 1, cb), + ]; + execute(device, actions, callback); + }, + }, + // Commercial Electric { zigbeeModel: ['Zigbee CCT Downlight'], From 38bded256ca35e500d2deaa9741302083174d515 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 3 Feb 2019 20:13:32 +0100 Subject: [PATCH 525/676] Ignore genGroups devChange. https://github.com/Koenkk/zigbee2mqtt/issues/764 --- converters/fromZigbee.js | 5 +++++ devices.js | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index cf35fda83c686..79d652b58be04 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1706,6 +1706,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_genGroups_devChange: { + cid: 'genGroups', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; diff --git a/devices.js b/devices.js index 55ffc30811462..95801841b53ef 100644 --- a/devices.js +++ b/devices.js @@ -11,14 +11,14 @@ const repInterval = { const generic = { light_onoff_brightness: { supports: 'on/off, brightness', - fromZigbee: [fz.brightness, fz.state_change, fz.state, fz.brightness_report], + fromZigbee: [fz.brightness, fz.state_change, fz.state, fz.brightness_report, fz.ignore_genGroups_devChange], toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colortemp: { supports: 'on/off, brightness, color temperature', fromZigbee: [ fz.brightness, fz.color_colortemp, fz.state_change, fz.state, - fz.brightness_report, fz.color_colortemp_report, + fz.brightness_report, fz.color_colortemp_report, fz.ignore_genGroups_devChange, ], toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], }, @@ -26,7 +26,7 @@ const generic = { supports: 'on/off, brightness, color xy', fromZigbee: [ fz.brightness, fz.color_colortemp, fz.state_change, fz.state, - fz.brightness_report, fz.color_colortemp_report, + fz.brightness_report, fz.color_colortemp_report, fz.ignore_genGroups_devChange, ], toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], }, @@ -34,7 +34,7 @@ const generic = { supports: 'on/off, brightness, color temperature, color xy', fromZigbee: [ fz.brightness, fz.color_colortemp, fz.state_change, fz.state, - fz.brightness_report, fz.color_colortemp_report, + fz.brightness_report, fz.color_colortemp_report, fz.ignore_genGroups_devChange, ], toZigbee: [ tz.on_off, tz.light_brightness, tz.light_color_colortemp, tz.ignore_transition, From b08fead80cfe33e1f1ab284db9b6b2e82d550fe7 Mon Sep 17 00:00:00 2001 From: Giel Date: Tue, 5 Feb 2019 08:56:07 -0800 Subject: [PATCH 526/676] Add support for AduroSmart ERIA Smart Wireless Dimming Switch (#264) * Add support for AduroSmart ERIA Smart Wireless Dimming Switch Switch returns event on button release. Hold not supported. Implemented as action sensor, returning actions on, off, up, down. Proprietary cluster PRs in zcl-id and zcl-packet need to be merged first. URL: https://adurosmart.com/products/adurosmart-eria-smart-dimming-switch-hub-required Image: https://static1.squarespace.com/static/5b73cad4aa49a1238f3c98ab/5b74eb9fb8a045d2f8b7d562/5b764e90562fa74310b76949/1534480018645/81825-Dimmng-switch-3.jpg?format=2500w * Update devices.js --- converters/fromZigbee.js | 22 ++++++++++++++++++++++ devices.js | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 79d652b58be04..0982c3571ede0 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1594,6 +1594,28 @@ const converters = { return payload; }, }, + eria_81825_on: { + cid: 'genOnOff', + type: 'cmdOn', + convert: (model, msg, publish, options) => { + return {action: 'on'}; + }, + }, + eria_81825_off: { + cid: 'genOnOff', + type: 'cmdOff', + convert: (model, msg, publish, options) => { + return {action: 'off'}; + }, + }, + eria_81825_updown: { + cid: 'genLevelCtrl', + type: 'cmdStep', + convert: (model, msg, publish, options) => { + const direction = msg.data.data.stepmode === 0 ? 'up' : 'down'; + return {action: `${direction}`}; + }, + }, // Ignore converters (these message dont need parsing). ignore_doorlock_change: { diff --git a/devices.js b/devices.js index 95801841b53ef..0ca145f7a1f36 100644 --- a/devices.js +++ b/devices.js @@ -2311,6 +2311,24 @@ const devices = [ }; }, }, + { + zigbeeModel: ['Adurolight_NCC'], + model: '81825', + vendor: 'AduroSmart', + description: 'ERIA smart wireless dimming switch', + supports: 'on, off, up, down', + fromZigbee: [fz.eria_81825_on, fz.eria_81825_off, fz.eria_81825_updown], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + ]; + + execute(device, actions, callback); + }, + }, // Eurotronic { From 133dd014110d9292a46c1b470e08ddf29ed746ef Mon Sep 17 00:00:00 2001 From: Mad-Andy <47221633+Mad-Andy@users.noreply.github.com> Date: Tue, 5 Feb 2019 18:06:35 +0100 Subject: [PATCH 527/676] HS3CG - Heiman gas sensor #257 (#265) * Update devices.js * Update fromZigbee.js * Update fromZigbee.js * Update devices.js * Update fromZigbee.js * Update fromZigbee.js --- converters/fromZigbee.js | 16 ++++++++++++++++ devices.js | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 0982c3571ede0..08ff4c0fb4033 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -920,6 +920,17 @@ const converters = { return results; }, }, + heiman_gas: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.zoneStatus; + return { + gas: (zoneStatus & 1) > 0, // Bit 1 = Alarm: Gas + battery_low: (zoneStatus & 1<<3) > 0, // Bit 4 = Battery LOW indicator + }; + }, + }, heiman_water_leak: { cid: 'ssIasZone', type: 'statusChange', @@ -1733,6 +1744,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_iaszone_change: { + cid: 'ssIasZone', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; diff --git a/devices.js b/devices.js index 0ca145f7a1f36..aaf80ef847eed 100644 --- a/devices.js +++ b/devices.js @@ -2114,6 +2114,24 @@ const devices = [ execute(device, actions, callback, 1000); }, }, + { + zigbeeModel: ['GASSensor-N'], + model: 'HS3CG', + vendor: 'HEIMAN', + description: 'Combustible gas sensor', + supports: 'gas', + fromZigbee: [fz.heiman_gas, fz.ignore_iaszone_change], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + ]; + + execute(device, actions, callback, 1000); + }, + }, { zigbeeModel: ['DoorSensor-N'], model: 'HS1DS', From 9b62a41f711c84f9999a3db417a154649c91472c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 5 Feb 2019 18:07:21 +0100 Subject: [PATCH 528/676] 7.1.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 366024d59a59c..571b83d8c6613 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.2", + "version": "7.1.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c7811d2474b65..f5a71b4d880e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.2", + "version": "7.1.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From c97416d751578af24d1463cc9e5416ca39a70eb6 Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Tue, 5 Feb 2019 18:19:32 +0100 Subject: [PATCH 529/676] Update toZigbee.js (#266) Bugfix: Eurotronic zigbee thermostat support: localTemperatureCalibration was not written correctly to the device. --- converters/toZigbee.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 406f17af43454..ee920fe151b18 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -406,10 +406,11 @@ const converters = { cmd: 'write', cmdType: 'foundation', zclData: [{ - attrId: attrId, + attrId: zclId.attr(cid, attrId).value, dataType: zclId.attrType(cid, attrId).value, attrData: Math.round(value * 10), }], + cfg: cfg.default, }; } else if (type === 'get') { return { From 80d564bfccb3c422089898143f5ecc1a76df1bfc Mon Sep 17 00:00:00 2001 From: Ilya Kirov Date: Thu, 7 Feb 2019 21:49:10 +0300 Subject: [PATCH 530/676] Immax LED E14/230V C35 5W TB 440LM ZIGBEE DIM (#268) --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index aaf80ef847eed..6e6aee7e7ac3d 100644 --- a/devices.js +++ b/devices.js @@ -2392,6 +2392,15 @@ const devices = [ fromZigbee: [fz.ignore_onoff_report, fz.livolo_switch_dev_change], toZigbee: [tz.livolo_switch_on_off], }, + + // Immax + { + zigbeeModel: ['IM-Z3.0-DIM'], + model: 'IM-Z3.0-DIM', + vendor: 'Immax', + description: 'LED E14/230V C35 5W TB 440LM ZIGBEE DIM', + extend: generic.light_onoff_brightness, + }, ]; module.exports = devices.map((device) => From 889b85173945debdbd36beb98e3eb89240a5c7ad Mon Sep 17 00:00:00 2001 From: pfischbach <3976786+pfischbach@users.noreply.github.com> Date: Thu, 7 Feb 2019 13:07:47 -0600 Subject: [PATCH 531/676] Add support for BOSCH RADON TriTech ZB Motion Sensor Model RFDL-ZB-MS (#267) * Update devices.js Add support for BOSCH RADON TriTech ZB Motion Sensor Model RFDL-ZB-MS * Update fromZigbee.js Add support for BOSCH motion sensor RADON TriTech ZB bit 0 is used to detect motion bit temper contact and bit 3 battery low * Update devices.js * Update fromZigbee.js * Update devices.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 12 ++++++++++++ devices.js | 27 +++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 08ff4c0fb4033..b95db29e9e33a 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1336,6 +1336,18 @@ const converters = { }; }, }, + bosch_ias_zone_motion_status_change: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.zoneStatus; + return { + occupancy: (zoneStatus & 1) > 0, // Bit 0 = Alarm 1: Presence Indication + tamper: (zoneStatus & 1<<2) > 0, // Bit 2 = Tamper status + battery_low: (zoneStatus & 1<<3) > 0, // Bit 3 = Battery LOW indicator (trips around 2.4V) + }; + }, + }, ias_contact_dev_change: { cid: 'ssIasZone', type: 'devChange', diff --git a/devices.js b/devices.js index 6e6aee7e7ac3d..f3e71b523619f 100644 --- a/devices.js +++ b/devices.js @@ -2393,6 +2393,33 @@ const devices = [ toZigbee: [tz.livolo_switch_on_off], }, + // Bosch + { + zigbeeModel: ['RFDL-ZB-MS'], + model: 'RADON TriTech ZB', + vendor: 'Bosch', + description: 'Wireless motion detector', + supports: 'occupancy and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.generic_batteryvoltage_3000_2500, + fz.ignore_power_change, fz.bosch_ias_zone_motion_status_change, fz.ignore_iaszone_change, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 60, 58000, 1, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 1800, 3600, cb), + ]; + + execute(device, actions, callback); + }, + }, + // Immax { zigbeeModel: ['IM-Z3.0-DIM'], From 96322ce7352f94ab359eb7eab59fb41c0175a392 Mon Sep 17 00:00:00 2001 From: way2many <40859898+way2many@users.noreply.github.com> Date: Fri, 8 Feb 2019 18:24:53 +0100 Subject: [PATCH 532/676] Add support for Hue white ambiance suspension Fair (#269) --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index f3e71b523619f..288d91c68b193 100644 --- a/devices.js +++ b/devices.js @@ -710,6 +710,13 @@ const devices = [ description: 'Hue white ambiance Aurelle round panel light', extend: hue.light_onoff_brightness_colortemp, }, + { + zigbeeModel: ['LTP003'], + model: '4033930P7', + vendor: 'Philips', + description: 'Hue white ambiance suspension Fair', + extend: hue.light_onoff_brightness_colortemp, + }, { zigbeeModel: ['LLC010'], model: '7199960PH', From cfc80f52762ef30ca461d52d6fd30ba72dc5d71b Mon Sep 17 00:00:00 2001 From: Martin Helff Date: Fri, 8 Feb 2019 18:25:42 +0100 Subject: [PATCH 533/676] More custom attributes for Eurotronic SPZB0001 (#270) * Added Eurotronic Spirit Zigbee thermostat * adjust Spirit Zigbee thermostat binding due to pr comments * fix linter errors * renamed specific attributes with eurotronic prefix, cleanup converters * update model and description to match convention for documentation * remove trailing space * remove trailing space * added postfix parameter to eurotronic converters * Eurotronic SPZB0001: more custom attribtes, listen to devChange instead of attReport, rename eurotronic_16386 --- converters/fromZigbee.js | 27 ++++++++++---- converters/toZigbee.js | 81 ++++++++++++++++++++++++++++++++++++++-- devices.js | 10 +++-- 3 files changed, 102 insertions(+), 16 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index b95db29e9e33a..5d034774f5a79 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1508,20 +1508,26 @@ const converters = { return result; }, }, - eurotronic_thermostat_att_report: { + eurotronic_thermostat_dev_change: { cid: 'hvacThermostat', - type: 'attReport', + type: 'devChange', convert: (model, msg, publish, options) => { const result = {}; - if (typeof msg.data.data[16387] == 'number') { + if (typeof msg.data.data[0x4003] == 'number') { result.current_heating_setpoint = - precisionRound(msg.data.data[16387], 2) / 100; + precisionRound(msg.data.data[0x4003], 2) / 100; + } + if (typeof msg.data.data[0x4008] == 'number') { + result.eurotronic_system_mode = msg.data.data[0x4008]; + } + if (typeof msg.data.data[0x4002] == 'number') { + result.eurotronic_error_status = msg.data.data[0x4002]; } - if (typeof msg.data.data[16392] == 'number') { - result.eurotronic_system_mode = msg.data.data[16392]; + if (typeof msg.data.data[0x4000] == 'number') { + result.eurotronic_trv_mode = msg.data.data[0x4000]; } - if (typeof msg.data.data[16386] == 'number') { - result.eurotronic_16386 = msg.data.data[16386]; + if (typeof msg.data.data[0x4001] == 'number') { + result.eurotronic_valve_position = msg.data.data[0x4001]; } return result; }, @@ -1751,6 +1757,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_thermostat_report: { + cid: 'hvacThermostat', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, ignore_genGroups_devChange: { cid: 'genGroups', type: 'devChange', diff --git a/converters/toZigbee.js b/converters/toZigbee.js index ee920fe151b18..19150069e50c0 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -926,7 +926,7 @@ const converters = { key: 'eurotronic_system_mode', convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; - const attrId = 16392; + const attrId = 0x4008; if (type === 'set') { return { cid: cid, @@ -935,6 +935,7 @@ const converters = { zclData: [{ // Bit 0 = ? (default 1) // Bit 2 = Boost + // Bit 4 = Window open // Bit 7 = Child protection attrId: attrId, dataType: 0x22, @@ -953,11 +954,55 @@ const converters = { } }, }, - eurotronic_16386: { - key: 'eurotronic_16386', + eurotronic_error_status: { + key: 'eurotronic_error_status', convert: (key, value, message, type, postfix) => { const cid = 'hvacThermostat'; - const attrId = 16386; + const attrId = 0x4002; + if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: attrId}], + cfg: cfg.eurotronic, + }; + } + }, + }, + eurotronic_current_heating_setpoint: { + key: 'current_heating_setpoint', + convert: (key, value, message, type, postfix) => { + const cid = 'hvacThermostat'; + const attrId = 0x4003; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: attrId, + dataType: 0x29, + attrData: (Math.round((value * 2).toFixed(1))/2).toFixed(1) * 100, + }], + cfg: cfg.eurotronic, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: attrId}], + cfg: cfg.eurotronic, + }; + } + }, + }, + eurotronic_valve_position: { + key: 'eurotronic_valve_position', + convert: (key, value, message, type, postfix) => { + const cid = 'hvacThermostat'; + const attrId = 0x4001; if (type === 'set') { return { cid: cid, @@ -981,6 +1026,34 @@ const converters = { } }, }, + eurotronic_trv_mode: { + key: 'eurotronic_trv_mode', + convert: (key, value, message, type, postfix) => { + const cid = 'hvacThermostat'; + const attrId = 0x4000; + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: attrId, + dataType: 0x30, + attrData: value, + }], + cfg: cfg.eurotronic, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: attrId}], + cfg: cfg.eurotronic, + }; + } + }, + }, livolo_switch_on_off: { key: ['state'], convert: (key, value, message, type, postfix) => { diff --git a/devices.js b/devices.js index 288d91c68b193..3469157196a66 100644 --- a/devices.js +++ b/devices.js @@ -2363,14 +2363,16 @@ const devices = [ description: 'Spirit Zigbee wireless heater thermostat', supports: 'temperature, heating system control', fromZigbee: [ - fz.thermostat_att_report, fz.eurotronic_thermostat_att_report, - fz.ignore_thermostat_change, fz.hue_battery, fz.ignore_power_change, + fz.thermostat_dev_change, + fz.eurotronic_thermostat_dev_change, + fz.ignore_thermostat_report, fz.hue_battery, fz.ignore_power_change, ], toZigbee: [ tz.thermostat_occupied_heating_setpoint, tz.thermostat_unoccupied_heating_setpoint, tz.thermostat_local_temperature_calibration, tz.thermostat_system_mode, - tz.eurotronic_system_mode, tz.eurotronic_16386, tz.thermostat_setpoint_raise_lower, + tz.eurotronic_system_mode, tz.eurotronic_error_status, tz.thermostat_setpoint_raise_lower, tz.thermostat_control_sequence_of_operation, tz.thermostat_remote_sensing, + tz.eurotronic_current_heating_setpoint, tz.eurotronic_trv_mode, tz.eurotronic_valve_position, ], configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); @@ -2379,7 +2381,7 @@ const devices = [ (cb) => device.bind('hvacThermostat', coordinator, cb), (cb) => device.report('hvacThermostat', 'localTemp', 1, 1200, 25, cb), (cb) => device.foundation('hvacThermostat', 'configReport', [{ - direction: 0, attrId: 16387, dataType: 41, minRepIntval: 0, + direction: 0, attrId: 0x4003, dataType: 41, minRepIntval: 0, maxRepIntval: 600, repChange: 25}], {manufSpec: 1, manufCode: 4151}, cb), ]; From b0bb4cefce38c2cd046ea72fe645003676ef688f Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 9 Feb 2019 00:05:39 +0100 Subject: [PATCH 534/676] Update ikea tradfri remote setup link. --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 3469157196a66..cb0f8b59253a2 100644 --- a/devices.js +++ b/devices.js @@ -566,7 +566,7 @@ const devices = [ supports: 'toggle, arrow left/right click/hold/release, brightness up/down click/hold/release ' + '(**[requires additional setup!]' + - '(https://github.com/Koenkk/zigbee2mqtt/blob/dev/docs/getting_started/pairing_devices.md)**)', + '(https://koenkk.github.io/zigbee2mqtt/getting_started/pairing_devices.html#ikea-tradfri)**)', vendor: 'IKEA', fromZigbee: [ fz.E1524_toggle, fz.E1524_arrow_click, fz.E1524_arrow_hold, fz.E1524_arrow_release, From a40de2cf74d69861208eae55025da067da2ce2c1 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 9 Feb 2019 00:40:18 +0100 Subject: [PATCH 535/676] Lock zcl-id. --- npm-shrinkwrap.json | 77 +++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 36 insertions(+), 43 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 571b83d8c6613..abb1ffc7f234f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -25,9 +25,9 @@ } }, "acorn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.5.tgz", - "integrity": "sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.0.tgz", + "integrity": "sha512-MW/FjM+IvU9CgBzjO3UIPCE2pyEwUsoFl+VGdczOPEdxfGFjuKny/gN54mOuX7Qxmb9Rg9MCn2oKiSUeW+pjrw==", "dev": true }, "acorn-jsx": { @@ -37,9 +37,9 @@ "dev": true }, "ajv": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", - "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.8.1.tgz", + "integrity": "sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -49,9 +49,9 @@ } }, "ansi-escapes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", - "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", "dev": true }, "ansi-regex": { @@ -275,9 +275,9 @@ "dev": true }, "eslint": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.12.0.tgz", - "integrity": "sha512-LntwyPxtOHrsJdcSwyQKVtHofPHdv+4+mFwEe91r2V13vqpM8yLr7b1sW+Oo/yheOPkWYsYlYJCkzlFAt8KV7g==", + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.13.0.tgz", + "integrity": "sha512-nqD5WQMisciZC5EHZowejLKQjWGuFS5c70fxqSKlnDME+oz9zmE8KTlX+lHSg+/5wsC/kf9Q9eMkC8qS3oM2fg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -309,7 +309,6 @@ "natural-compare": "^1.4.0", "optionator": "^0.8.2", "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", "progress": "^2.0.0", "regexpp": "^2.0.1", "semver": "^5.5.1", @@ -331,9 +330,9 @@ } }, "eslint-config-google": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.11.0.tgz", - "integrity": "sha512-z541Fs5TFaY7/35v/z100InQ2f3V2J7e3u/0yKrnImgsHjh6JWgSRngfC/mZepn/+XN16jUydt64k//kxXc1fw==", + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.12.0.tgz", + "integrity": "sha512-SHDM3nIRCJBACjf8c/H6FvCwRmKbphESNl3gJFBNbw4KYDLCONB3ABYLXDGF+iaVP9XSTND/Q5/PuGoFkp4xbg==", "dev": true }, "eslint-scope": { @@ -574,21 +573,21 @@ "dev": true }, "inquirer": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.1.tgz", - "integrity": "sha512-088kl3DRT2dLU5riVMKKr1DlImd6X7smDhpXUCkJDCKvTEJeRiXh0G132HG9u5a+6Ylw9plFRY7RuTnwohYSpg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", + "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", "dev": true, "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", "cli-cursor": "^2.1.0", "cli-width": "^2.0.0", - "external-editor": "^3.0.0", + "external-editor": "^3.0.3", "figures": "^2.0.0", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "mute-stream": "0.0.7", "run-async": "^2.2.0", - "rxjs": "^6.1.0", + "rxjs": "^6.4.0", "string-width": "^2.1.0", "strip-ansi": "^5.0.0", "through": "^2.3.6" @@ -866,12 +865,6 @@ "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=" }, - "pluralize": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", - "dev": true - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -931,9 +924,9 @@ } }, "rxjs": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.3.3.tgz", - "integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==", + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", + "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", "dev": true, "requires": { "tslib": "^1.9.0" @@ -973,9 +966,9 @@ "dev": true }, "slice-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.0.0.tgz", - "integrity": "sha512-4j2WTWjp3GsZ+AOagyzVbzp4vWGtZ0hEZ/gDY/uTvm6MTxUfTUIsnMIFb1bn8o0RuXiqUw15H1bue8f22Vw2oQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { "ansi-styles": "^3.2.0", @@ -1024,14 +1017,14 @@ } }, "table": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/table/-/table-5.2.1.tgz", - "integrity": "sha512-qmhNs2GEHNqY5fd2Mo+8N1r2sw/rvTAAvBZTaTx+Y7PHLypqyrxr1MdIu0pLw6Xvl/Gi4ONu/sdceP8vvUjkyA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/table/-/table-5.2.2.tgz", + "integrity": "sha512-f8mJmuu9beQEDkKHLzOv4VxVYlU68NpdzjbGPl69i4Hx0sTopJuNxuzJd17iV2h24dAfa93u794OnDA5jqXvfQ==", "dev": true, "requires": { "ajv": "^6.6.1", "lodash": "^4.17.11", - "slice-ansi": "2.0.0", + "slice-ansi": "^2.0.0", "string-width": "^2.1.1" } }, @@ -1116,8 +1109,8 @@ } }, "zcl-id": { - "version": "git+https://github.com/Koenkk/zcl-id.git#509f77ab620ece6ad8e83a008283457a5280c8db", - "from": "git+https://github.com/Koenkk/zcl-id.git#509f77ab620ece6ad8e83a008283457a5280c8db", + "version": "https://github.com/koenkk/zcl-id/tarball/2f25e0848562b570453abd663794d5b95e1f324f", + "integrity": "sha512-lfVS1kAuuiSs0laGpaOX9tpn3r/hZvNZLCSr1ZxZNaUz9a4xDRdGkvbdEox4x3Xkg8PTFF2Au1S5cFRUmbA/cA==", "requires": { "busyman": "^0.3.0", "enum": "^2.5.0" diff --git a/package.json b/package.json index f5a71b4d880e8..72a05cc3f6db1 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", "dependencies": { - "zcl-id": "https://github.com/koenkk/zcl-id/tarball/master", + "zcl-id": "https://github.com/koenkk/zcl-id/tarball/2f25e0848562b570453abd663794d5b95e1f324f", "debounce": "*", "debug": "3.2.6", "chai": "*" From 5b9fe56dedc42793fbc5c7fd9a74b19c97ed17ab Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 9 Feb 2019 00:40:24 +0100 Subject: [PATCH 536/676] 7.1.4 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index abb1ffc7f234f..0673e180c2661 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.3", + "version": "7.1.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 72a05cc3f6db1..a9d4709d36b90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.3", + "version": "7.1.4", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 7c2fb51e6f235581a37fefe0525e6085254ea07b Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 9 Feb 2019 20:06:53 +0100 Subject: [PATCH 537/676] Multiple Gledopto transition by 3.3. https://github.com/Koenkk/zigbee2mqtt/issues/1047 --- converters/toZigbee.js | 30 ++++++++++++++++++++++++++++++ devices.js | 40 ++++++++++++++++++++++++++++++++-------- 2 files changed, 62 insertions(+), 8 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 19150069e50c0..84e29248a98e6 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1108,6 +1108,36 @@ const converters = { } }, }, + gledopto_light_brightness: { + key: ['brightness', 'brightness_percent'], + convert: (key, value, message, type, postfix) => { + if (message.hasOwnProperty('transition')) { + message.transition = message.transition * 3.3; + } + + return converters.light_brightness.convert(key, value, message, type, postfix); + }, + }, + gledopto_light_color_colortemp: { + key: ['brightness', 'brightness_percent'], + convert: (key, value, message, type, postfix) => { + if (message.hasOwnProperty('transition')) { + message.transition = message.transition * 3.3; + } + + return converters.light_color_colortemp.convert(key, value, message, type, postfix); + }, + }, + gledopto_light_colortemp: { + key: ['brightness', 'brightness_percent'], + convert: (key, value, message, type, postfix) => { + if (message.hasOwnProperty('transition')) { + message.transition = message.transition * 3.3; + } + + return converters.light_colortemp.convert(key, value, message, type, postfix); + }, + }, // Ignore converters ignore_transition: { diff --git a/devices.js b/devices.js index cb0f8b59253a2..a2396ce4f4242 100644 --- a/devices.js +++ b/devices.js @@ -43,6 +43,30 @@ const generic = { }, }; +const gledopto = { + light_onoff_brightness: { + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: [tz.on_off, tz.gledopto_light_brightness, tz.ignore_transition, tz.light_alert], + }, + light_onoff_brightness_colortemp: { + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, + toZigbee: [ + tz.on_off, tz.gledopto_light_brightness, tz.gledopto_light_colortemp, tz.ignore_transition, + tz.light_alert, + ], + }, + light_onoff_brightness_colortemp_colorxy: { + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + toZigbee: [ + tz.on_off, tz.gledopto_light_brightness, tz.gledopto_light_color_colortemp, tz.ignore_transition, + tz.light_alert, + ], + }, +}; + const tzHuePowerOnBehavior = [tz.hue_power_on_behavior, tz.hue_power_on_brightness, tz.hue_power_on_color_temperature]; const hue = { light_onoff_brightness: { @@ -1578,7 +1602,7 @@ const devices = [ model: 'GL-C-008', vendor: 'Gledopto', description: 'Zigbee LED controller RGB + CCT / RGBW / WWCW / Dimmer', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: gledopto.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1599,7 +1623,7 @@ const devices = [ model: 'GL-C-006', vendor: 'Gledopto', description: 'Zigbee LED controller WW/CW Dimmer', - extend: generic.light_onoff_brightness_colortemp, + extend: gledopto.light_onoff_brightness_colortemp, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1615,7 +1639,7 @@ const devices = [ model: 'GL-S-007Z', vendor: 'Gledopto', description: 'Smart RGBW GU10', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: gledopto.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1631,7 +1655,7 @@ const devices = [ model: 'GL-B-007Z', vendor: 'Gledopto', description: 'Smart 6W E27 RGB / CW LED bulb', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: gledopto.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1647,7 +1671,7 @@ const devices = [ model: 'GL-B-008Z', vendor: 'Gledopto', description: 'Smart 12W E27 RGB / CW LED bulb', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: gledopto.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1663,7 +1687,7 @@ const devices = [ model: 'GL-D-003Z', vendor: 'Gledopto', description: 'LED RGB + CCT downlight ', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: gledopto.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1679,7 +1703,7 @@ const devices = [ model: 'GL-S-003Z', vendor: 'Gledopto', description: 'Smart RGBW GU10 ', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: gledopto.light_onoff_brightness_colortemp_colorxy, ep: (device) => { if (device.epList.toString() === '11,12,13') { return {'': 12}; @@ -1695,7 +1719,7 @@ const devices = [ model: 'GD-CZ-006', vendor: 'Gledopto', description: 'Zigbee LED Driver', - extend: generic.light_onoff_brightness, + extend: gledopto.light_onoff_brightness, }, // SmartThings From 2387f16ee07eec957a59d14ec0da3b8014f0539c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 9 Feb 2019 20:07:24 +0100 Subject: [PATCH 538/676] 7.1.5 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 0673e180c2661..399e0449d3224 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.4", + "version": "7.1.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a9d4709d36b90..080d081e0fefd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.4", + "version": "7.1.5", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From d837806565ca13b978667251456beee655dd01dc Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 9 Feb 2019 20:14:52 +0100 Subject: [PATCH 539/676] LED1624G9 doesn't support color temperature. https://github.com/Koenkk/zigbee2mqtt/issues/678 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index a2396ce4f4242..23ee57dbae16d 100644 --- a/devices.js +++ b/devices.js @@ -485,7 +485,7 @@ const devices = [ model: 'LED1624G9', vendor: 'IKEA', description: 'TRADFRI LED bulb E27/E26 600 lumen, dimmable, color, opal white', - extend: generic.light_onoff_brightness_colortemp_colorxy, + extend: generic.light_onoff_brightness_colorxy, }, { zigbeeModel: [ From 9a2cd4e6bc1b1900c14348b7bf707538e6a5e32f Mon Sep 17 00:00:00 2001 From: Russell Joyce Date: Sun, 10 Feb 2019 13:39:40 +0000 Subject: [PATCH 540/676] Added support for Innr RS 225 bulb (#271) --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index 23ee57dbae16d..a28e51101571f 100644 --- a/devices.js +++ b/devices.js @@ -1213,6 +1213,13 @@ const devices = [ description: 'GU10 Spot', extend: generic.light_onoff_brightness, }, + { + zigbeeModel: ['RS 225'], + model: 'RS 225', + vendor: 'Innr', + description: 'GU10 Spot', + extend: generic.light_onoff_brightness, + }, { zigbeeModel: ['RS 128 T'], model: 'RS 128 T', From d366561c70d69f806461f09eeab07c3bbe778559 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 10 Feb 2019 19:54:24 +0100 Subject: [PATCH 541/676] Add E1746. https://github.com/Koenkk/zigbee2mqtt/issues/832 --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index a28e51101571f..a784b534b2910 100644 --- a/devices.js +++ b/devices.js @@ -599,6 +599,15 @@ const devices = [ ], toZigbee: [], }, + { + zigbeeModel: ['TRADFRI signal repeater'], + model: 'E1746', + description: 'TRADFRI signal repeater', + supports: '', + vendor: 'IKEA', + fromZigbee: [], + toZigbee: [], + }, // Philips { From 98bf8dd91df56c3127c6f32106a9260c3fab3947 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 10 Feb 2019 20:17:17 +0100 Subject: [PATCH 542/676] 7.1.6 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 399e0449d3224..098813ffba691 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.5", + "version": "7.1.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 080d081e0fefd..3d11b4ec3dc1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.5", + "version": "7.1.6", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 09356012a900e154b8e406365597f02eecac67a2 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 10 Feb 2019 20:22:17 +0100 Subject: [PATCH 543/676] Fix gledopto color and color_temp converter. https://github.com/Koenkk/zigbee2mqtt/issues/1064#issuecomment-462162604 --- converters/toZigbee.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 84e29248a98e6..a3efe016d9ce8 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1119,7 +1119,7 @@ const converters = { }, }, gledopto_light_color_colortemp: { - key: ['brightness', 'brightness_percent'], + key: ['color', 'color_temp', 'color_temp_percent'], convert: (key, value, message, type, postfix) => { if (message.hasOwnProperty('transition')) { message.transition = message.transition * 3.3; @@ -1129,7 +1129,7 @@ const converters = { }, }, gledopto_light_colortemp: { - key: ['brightness', 'brightness_percent'], + key: ['color_temp', 'color_temp_percent'], convert: (key, value, message, type, postfix) => { if (message.hasOwnProperty('transition')) { message.transition = message.transition * 3.3; From c9941c35f2df2713c408e009fac000042d59e5a0 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 10 Feb 2019 20:22:24 +0100 Subject: [PATCH 544/676] 7.1.7 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 098813ffba691..2713bba052f7f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.6", + "version": "7.1.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 3d11b4ec3dc1a..6ebd9208b0b77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.6", + "version": "7.1.7", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From bc0332aad90887c75e6f3ddfe318094a271b7b85 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 11 Feb 2019 19:41:32 +0100 Subject: [PATCH 545/676] Add E1743 https://github.com/Koenkk/zigbee2mqtt/issues/997 (#273) * Experimental support E1743. https://github.com/Koenkk/zigbee2mqtt/issues/997 * Add battery support and fix model. https://github.com/Koenkk/zigbee2mqtt/issues/997 * Add missing battery converter. https://github.com/Koenkk/zigbee2mqtt/issues/997 * Add ignore_power_change. https://github.com/Koenkk/zigbee2mqtt/issues/997 --- converters/fromZigbee.js | 25 +++++++++++++++++++++++-- devices.js | 30 +++++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 5d034774f5a79..b0b5a8d2cb206 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -126,20 +126,41 @@ const holdUpdateBrightness324131092621 = (deviceID) => { const converters = { - AC0251100NJ_on: { + genOnOff_cmdOn: { cid: 'genOnOff', type: 'cmdOn', convert: (model, msg, publish, options) => { return {click: 'on'}; }, }, - AC0251100NJ_off: { + genOnOff_cmdOff: { cid: 'genOnOff', type: 'cmdOff', convert: (model, msg, publish, options) => { return {click: 'off'}; }, }, + E1743_brightness_up: { + cid: 'genLevelCtrl', + type: 'cmdMove', + convert: (model, msg, publish, options) => { + return {click: 'brightness_up'}; + }, + }, + E1743_brightness_down: { + cid: 'genLevelCtrl', + type: 'cmdMoveWithOnOff', + convert: (model, msg, publish, options) => { + return {click: 'brightness_down'}; + }, + }, + E1743_brightness_stop: { + cid: 'genLevelCtrl', + type: 'cmdStopWithOnOff', + convert: (model, msg, publish, options) => { + return {click: 'brightness_stop'}; + }, + }, AC0251100NJ_long_middle: { cid: 'lightingColorCtrl', type: 'cmdMoveHue', diff --git a/devices.js b/devices.js index a784b534b2910..061f7421ea97c 100644 --- a/devices.js +++ b/devices.js @@ -8,6 +8,8 @@ const repInterval = { MAX: 58000, }; +const coordinatorGroup = 99; + const generic = { light_onoff_brightness: { supports: 'on/off, brightness', @@ -599,6 +601,32 @@ const devices = [ ], toZigbee: [], }, + { + zigbeeModel: ['TRADFRI on/off switch'], + model: 'E1743', + vendor: 'IKEA', + description: 'TRADFRI ON/OFF switch', + supports: 'on, off', + fromZigbee: [ + fz.genOnOff_cmdOn, fz.genOnOff_cmdOff, fz.E1743_brightness_up, fz.E1743_brightness_down, + fz.E1743_brightness_stop, fz.generic_battery, fz.ignore_power_change, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = { + direction: 0, attrId: 33, dataType: 32, minRepIntval: 0, maxRepIntval: repInterval.MAX, repChange: 0, + }; + + const actions = [ + (cb) => device.bind('genOnOff', coordinatorGroup, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.foundation('genPowerCfg', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, { zigbeeModel: ['TRADFRI signal repeater'], model: 'E1746', @@ -1115,7 +1143,7 @@ const devices = [ description: 'Smart+ switch mini', supports: 'on/off, brightness', fromZigbee: [ - fz.AC0251100NJ_on, fz.AC0251100NJ_off, fz.AC0251100NJ_long_middle, + fz.genOnOff_cmdOn, fz.genOnOff_cmdOff, fz.AC0251100NJ_long_middle, fz.cmd_stop, fz.cmd_move, fz.cmd_move_with_onoff, fz.cmd_move_to_level_with_onoff, fz.generic_batteryvoltage_3000_2500, ], From d148817149093eeb677853b50939503089fba955 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 11 Feb 2019 19:51:07 +0100 Subject: [PATCH 546/676] Increase WXKG01LM long click delay. This makes detecting long clicks more reliable. Sometimes a `long` is detected when it's actually a `single`. --- converters/fromZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index b0b5a8d2cb206..8177290780aed 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -338,7 +338,7 @@ const converters = { publish({click: 'long'}); store[deviceID].timer = null; store[deviceID].long = Date.now(); - }, 300); // After 300 milliseconds of not releasing we assume long click. + }, 1000); // After 1000 milliseconds of not releasing we assume long click. } else if (state === 1) { if (store[deviceID].long) { const duration = Date.now() - store[deviceID].long; From 2355fda14cea9b39a0ec657ab5549f9ddd535f2a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 11 Feb 2019 19:51:56 +0100 Subject: [PATCH 547/676] Support YRD426NRSC. https://github.com/Koenkk/zigbee2mqtt/issues/1032 (#274) * Experimental support YRD426NRSC. https://github.com/Koenkk/zigbee2mqtt/issues/1032 * Update fromZigbee.js --- converters/fromZigbee.js | 9 ++++++++- converters/toZigbee.js | 32 ++++++++++++++++++++++++++++++++ devices.js | 24 +++++++++++++++++++++++- 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 8177290780aed..a5b65a3cd059d 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -126,6 +126,13 @@ const holdUpdateBrightness324131092621 = (deviceID) => { const converters = { + YRD426NRSC_lock: { + cid: 'closuresDoorLock', + type: 'attReport', + convert: (model, msg, publish, options) => { + return {state: msg.data.data.lockState === 2 ? 'UNLOCK' : 'LOCK'}; + }, + }, genOnOff_cmdOn: { cid: 'genOnOff', type: 'cmdOn', @@ -904,7 +911,7 @@ const converters = { }; }, }, - heiman_smoke_battery: { + battery_200: { cid: 'genPowerCfg', type: 'attReport', convert: (model, msg, publish, options) => { diff --git a/converters/toZigbee.js b/converters/toZigbee.js index a3efe016d9ce8..bffd192ee50b0 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1108,6 +1108,38 @@ const converters = { } }, }, + YRD426NRSC_lock: { + key: ['state'], + convert: (key, value, message, type, postfix) => { + const cid = 'closuresDoorLock'; + const attrId = 'lockState'; + + if (type === 'set') { + if (typeof value !== 'string') { + return; + } + + return { + cid: cid, + cmd: `${value.toLowerCase()}Door`, + cmdType: 'functional', + zclData: { + 'pincodevalue': '', + }, + cfg: cfg.default, + readAfterWriteTime: 200, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, gledopto_light_brightness: { key: ['brightness', 'brightness_percent'], convert: (key, value, message, type, postfix) => { diff --git a/devices.js b/devices.js index 061f7421ea97c..61897bcc7b5ad 100644 --- a/devices.js +++ b/devices.js @@ -6,6 +6,7 @@ const tz = require('./converters/toZigbee'); const repInterval = { MAX: 58000, + HOUR: 3600, }; const coordinatorGroup = 99; @@ -2153,7 +2154,7 @@ const devices = [ supports: 'smoke', fromZigbee: [ fz.heiman_smoke, - fz.heiman_smoke_battery, + fz.battery_200, fz.heiman_smoke_enrolled, fz.ignore_power_change, ], @@ -2505,6 +2506,27 @@ const devices = [ description: 'LED E14/230V C35 5W TB 440LM ZIGBEE DIM', extend: generic.light_onoff_brightness, }, + + // Yale + { + zigbeeModel: ['YRD446 BLE TSDB'], + model: 'YRD426NRSC', + vendor: 'Yale', + description: 'Assure lock', + supports: 'lock/unlock, battery', + fromZigbee: [fz.YRD426NRSC_lock, fz.battery_200], + toZigbee: [tz.YRD426NRSC_lock], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + + const actions = [ + (cb) => device.report('closuresDoorLock', 'lockState', 0, repInterval.HOUR, 0, cb), + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, repInterval.MAX, 0, cb), + ]; + + execute(device, actions, callback); + }, + }, ]; module.exports = devices.map((device) => From b42592ade961086da3f570c854014b26a6836458 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 11 Feb 2019 19:52:07 +0100 Subject: [PATCH 548/676] 7.1.8 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2713bba052f7f..630c072dffa4b 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.7", + "version": "7.1.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6ebd9208b0b77..e376b7f0abc2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.7", + "version": "7.1.8", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From ebeb5de2db43a5a5874501c611cca9a1d3bc503d Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 11 Feb 2019 18:12:26 -0600 Subject: [PATCH 549/676] Add Osram BR30 RGBW LED to HA --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index 61897bcc7b5ad..37ab1e2605362 100644 --- a/devices.js +++ b/devices.js @@ -1392,6 +1392,13 @@ const devices = [ description: 'LIGHTIFY LED adjustable white BR30', extend: generic.light_onoff_brightness_colortemp, }, + { + zigbeeModel: ['LIGHTIFY BR RGBW'], + model: '73739', + vendor: 'Sylvania', + description: 'LIGHTIFY LED RGBW BR30', + extend: generic.light_onoff_brightness_colortemp_colorxy, + }, { zigbeeModel: ['LIGHTIFY A19 RGBW'], model: '73693', From ff2630eae206b0c36982427844d908db4205317f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Kluivingh?= Date: Wed, 13 Feb 2019 20:09:25 +0100 Subject: [PATCH 550/676] Add support for TRADFRI bulb E27 WS opal 1000lm light LED1732G11 (#277) --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index 37ab1e2605362..63db871bcce35 100644 --- a/devices.js +++ b/devices.js @@ -500,6 +500,13 @@ const devices = [ description: 'TRADFRI LED bulb E12/E14/E17 400 lumen, dimmable warm white, chandelier opal', extend: generic.light_onoff_brightness, }, + { + zigbeeModel: ['TRADFRI bulb E27 WS opal 1000lm'], + model: 'LED1732G11', + vendor: 'IKEA', + description: 'TRADFRI LED bulb E27 1000 lumen, dimmable, white spectrum, opal white', + extend: generic.light_onoff_brightness_colortemp, + }, { zigbeeModel: ['TRADFRI wireless dimmer'], model: 'ICTC-G-1', From def6bd73890528ed5f6adad2292244c8f8c0836b Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Wed, 13 Feb 2019 20:18:40 +0100 Subject: [PATCH 551/676] SmokeSensor-EM (#272) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 63db871bcce35..71cd92458802a 100644 --- a/devices.js +++ b/devices.js @@ -2161,7 +2161,7 @@ const devices = [ // HEIMAN { - zigbeeModel: ['SMOK_V16', 'b5db59bfd81e4f1f95dc57fdbba17931', 'SMOK_YDLV10'], + zigbeeModel: ['SMOK_V16', 'b5db59bfd81e4f1f95dc57fdbba17931', 'SMOK_YDLV10', 'SmokeSensor-EM'], model: 'HS1SA', vendor: 'HEIMAN', description: 'Smoke detector', From 13db25f7542286173eda6fb12d0463099f9aefa8 Mon Sep 17 00:00:00 2001 From: MoskitoHorst Date: Thu, 14 Feb 2019 18:35:23 +0100 Subject: [PATCH 552/676] tint remote, 3 keys (#279) * tint remote, 3 keys activated On-Off and brightness up/down * Update devices.js * Update fromZigbee.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 24 +++++++++++++++++++++++- devices.js | 17 +++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index a5b65a3cd059d..114d1fe1cc032 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1560,7 +1560,29 @@ const converters = { return result; }, }, - E1524_toggle: { + tint404011_on: { + cid: 'genOnOff', + type: 'cmdOn', + convert: (model, msg, publish, options) => { + return {action: 'toggle'}; + }, + }, + tint404011_off: { + cid: 'genOnOff', + type: 'cmdOff', + convert: (model, msg, publish, options) => { + return {action: 'toggle'}; + }, + }, + tint404011_brightness_updown_click: { + cid: 'genLevelCtrl', + type: 'cmdStep', + convert: (model, msg, publish, options) => { + const direction = msg.data.data.stepmode === 1 ? 'down' : 'up'; + return {action: `brightness_${direction}_click`}; + }, + }, + cmdToggle: { cid: 'genOnOff', type: 'cmdToggle', convert: (model, msg, publish, options) => { diff --git a/devices.js b/devices.js index 71cd92458802a..0b176028372c3 100644 --- a/devices.js +++ b/devices.js @@ -600,10 +600,10 @@ const devices = [ supports: 'toggle, arrow left/right click/hold/release, brightness up/down click/hold/release ' + '(**[requires additional setup!]' + - '(https://koenkk.github.io/zigbee2mqtt/getting_started/pairing_devices.html#ikea-tradfri)**)', + '(http://www.zigbee2mqtt.io/getting_started/pairing_devices.html#ikea-tradfri)**)', vendor: 'IKEA', fromZigbee: [ - fz.E1524_toggle, fz.E1524_arrow_click, fz.E1524_arrow_hold, fz.E1524_arrow_release, + fz.cmdToggle, fz.E1524_arrow_click, fz.E1524_arrow_hold, fz.E1524_arrow_release, fz.E1524_brightness_up_click, fz.E1524_brightness_down_click, fz.E1524_brightness_up_hold, fz.E1524_brightness_up_release, fz.E1524_brightness_down_hold, fz.E1524_brightness_down_release, ], @@ -2383,6 +2383,19 @@ const devices = [ description: 'Tint LED bulb GU10/E14/E27 350/470/806 lumen, dimmable, opal white', extend: generic.light_onoff_brightness_colortemp, }, + { + zigbeeModel: ['ZBT-Remote-ALL-RGBW'], + model: 'MLI-404011', + description: 'Tint remote control', + supports: 'toggle, brightness, other buttons are not supported yet! ' + + '(**[requires additional setup!]' + + '(http://www.zigbee2mqtt.io/getting_started/pairing_devices.html)**)', + vendor: 'Müller Licht', + fromZigbee: [ + fz.tint404011_on, fz.tint404011_off, fz.cmdToggle, fz.tint404011_brightness_updown_click, + ], + toZigbee: [], + }, // Salus { From 0401b203fb29f7a05e5a126eff741f6065a57317 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 14 Feb 2019 19:32:44 +0100 Subject: [PATCH 553/676] Update links. --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 0b176028372c3..7fef3b833642f 100644 --- a/devices.js +++ b/devices.js @@ -600,7 +600,7 @@ const devices = [ supports: 'toggle, arrow left/right click/hold/release, brightness up/down click/hold/release ' + '(**[requires additional setup!]' + - '(http://www.zigbee2mqtt.io/getting_started/pairing_devices.html#ikea-tradfri)**)', + '(http://www.zigbee2mqtt.io/information/coordinator_group.md)**)', vendor: 'IKEA', fromZigbee: [ fz.cmdToggle, fz.E1524_arrow_click, fz.E1524_arrow_hold, fz.E1524_arrow_release, @@ -2389,7 +2389,7 @@ const devices = [ description: 'Tint remote control', supports: 'toggle, brightness, other buttons are not supported yet! ' + '(**[requires additional setup!]' + - '(http://www.zigbee2mqtt.io/getting_started/pairing_devices.html)**)', + '(http://www.zigbee2mqtt.io/information/coordinator_group.md)**)', vendor: 'Müller Licht', fromZigbee: [ fz.tint404011_on, fz.tint404011_off, fz.cmdToggle, fz.tint404011_brightness_updown_click, From 4ea41e0631c78b9da7739c6c88efee6e3b548226 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 14 Feb 2019 19:34:34 +0100 Subject: [PATCH 554/676] 7.1.9 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 630c072dffa4b..82558d1fc68a3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.8", + "version": "7.1.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e376b7f0abc2c..d8a71d4e3d6a9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.8", + "version": "7.1.9", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 923ba69870d97deae065b8a60eb10d442e4df45b Mon Sep 17 00:00:00 2001 From: Srdan Suka Date: Fri, 15 Feb 2019 20:48:54 +0100 Subject: [PATCH 555/676] Innr RB 265 E27 Bulb support (#280) --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index 7fef3b833642f..cd180af77b7c2 100644 --- a/devices.js +++ b/devices.js @@ -1223,6 +1223,13 @@ const devices = [ description: 'B22 Bulb RGBW', extend: generic.light_onoff_brightness_colortemp_colorxy, }, + { + zigbeeModel: ['RB 265'], + model: 'RB 265', + vendor: 'Innr', + description: 'E27 Bulb', + extend: generic.light_onoff_brightness, + }, { zigbeeModel: ['RB 285 C'], model: 'RB 285 C', From 2a0cc861f4250ff27c19859cd3a6bda8d982dbec Mon Sep 17 00:00:00 2001 From: Gustav Johansson Date: Sat, 16 Feb 2019 18:08:10 +0100 Subject: [PATCH 556/676] Fixed HS1SA battery report (#282) --- devices.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index cd180af77b7c2..7a0cbdaba4b81 100644 --- a/devices.js +++ b/devices.js @@ -2186,8 +2186,9 @@ const devices = [ (cb) => device.bind('ssIasZone', coordinator, cb), (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), (cb) => device.bind('genPowerCfg', coordinator, cb), - (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 65535, 0, cb), // once per day - (cb) => device.report('genPowerCfg', 'batteryAlarmState', 1, 65535, 1, cb), + // Time is in seconds. 65535 means no report. 65534 is max value: 18 hours, 12 minutes 14 seconds. + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 65534, 0, cb), + (cb) => device.report('genPowerCfg', 'batteryAlarmState', 1, 65534, 1, cb), ]; execute(device, actions, callback, 1000); From 893d483437f3015dcece7a2846bb76f64904c307 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 17 Feb 2019 15:09:05 +0100 Subject: [PATCH 557/676] 7.1.10 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 82558d1fc68a3..d17758c2fad6c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.9", + "version": "7.1.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d8a71d4e3d6a9..9e30421a6ae2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.9", + "version": "7.1.10", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From d0185a78a2f32ca7127fad47b9404e1717dd1920 Mon Sep 17 00:00:00 2001 From: fredrikgk <46903952+fredrikgk@users.noreply.github.com> Date: Sun, 17 Feb 2019 16:32:35 +0100 Subject: [PATCH 558/676] Updated devices.js with support for ELKO Dimmer 316 GLED RF. (#283) * Updated devices.js with support for ELKO Dimmer 316 GLED RF. * Update devices.js * Update devices.js * Update devices.js --- devices.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/devices.js b/devices.js index 7a0cbdaba4b81..71ba82295208c 100644 --- a/devices.js +++ b/devices.js @@ -2562,6 +2562,27 @@ const devices = [ execute(device, actions, callback); }, }, + + // ELKO + { + zigbeeModel: ['ElkoDimmerZHA'], + model: '316GLEDRF', + vendor: 'ELKO', + description: 'ZigBee in-wall smart dimmer', + supports: 'on/off, brightness', + fromZigbee: [fz.brightness, fz.ignore_onoff_change, fz.state], + toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, ]; module.exports = devices.map((device) => From 29df927c8fcccd6ea4b74b3b939bf595f29ae037 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 18 Feb 2019 17:40:47 +0100 Subject: [PATCH 559/676] Additional setup is not required anymore. --- devices.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/devices.js b/devices.js index 71ba82295208c..4043f15b2af4e 100644 --- a/devices.js +++ b/devices.js @@ -598,9 +598,7 @@ const devices = [ model: 'E1524', description: 'TRADFRI remote control', supports: - 'toggle, arrow left/right click/hold/release, brightness up/down click/hold/release ' + - '(**[requires additional setup!]' + - '(http://www.zigbee2mqtt.io/information/coordinator_group.md)**)', + 'toggle, arrow left/right click/hold/release, brightness up/down click/hold/release', vendor: 'IKEA', fromZigbee: [ fz.cmdToggle, fz.E1524_arrow_click, fz.E1524_arrow_hold, fz.E1524_arrow_release, @@ -2395,9 +2393,7 @@ const devices = [ zigbeeModel: ['ZBT-Remote-ALL-RGBW'], model: 'MLI-404011', description: 'Tint remote control', - supports: 'toggle, brightness, other buttons are not supported yet! ' + - '(**[requires additional setup!]' + - '(http://www.zigbee2mqtt.io/information/coordinator_group.md)**)', + supports: 'toggle, brightness, other buttons are not supported yet!', vendor: 'Müller Licht', fromZigbee: [ fz.tint404011_on, fz.tint404011_off, fz.cmdToggle, fz.tint404011_brightness_updown_click, From 282062f9823fb1a7e3c4a2c6d6f9ca81afc553d7 Mon Sep 17 00:00:00 2001 From: Ruslan Sayfutdinov Date: Mon, 18 Feb 2019 16:56:25 +0000 Subject: [PATCH 560/676] Decoupled mode for Xiaomi wired wall switches (#287) --- converters/fromZigbee.js | 6 ++++++ converters/toZigbee.js | 46 ++++++++++++++++++++++++++++++++++++++++ devices.js | 8 +++---- 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 114d1fe1cc032..19b0f4c70b1a1 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -802,6 +802,8 @@ const converters = { convert: (model, msg, publish, options) => { if (msg.data.data['61440']) { return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + } else { + return {click: 'single'}; } }, }, @@ -815,6 +817,10 @@ const converters = { const payload = {}; payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; return payload; + } else { + const mapping = {4: 'left', 5: 'right', 6: 'both'}; + const button = mapping[msg.endpoints[0].epId]; + return {click: button}; } }, }, diff --git a/converters/toZigbee.js b/converters/toZigbee.js index bffd192ee50b0..e8db0a9afce6c 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -856,6 +856,52 @@ const converters = { } }, }, + xiaomi_decoupled_mode: { + key: ['decoupled_mode'], + convert: (key, value, message, type, postfix) => { + const cid = 'genBasic'; + const lookupAttrId = { + 'single': 0xFF22, + 'left': 0xFF22, + 'right': 0xFF23, + }; + const lookupState = { + 'decoupled': 0xFE, + 'toggle_left': 0x12, + 'toggle_right': 0x22, + }; + let button; + if (value.hasOwnProperty('button')) { + button = value.button; + } else { + button = 'single'; + } + if (type === 'set') { + return { + cid: cid, + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: lookupAttrId[button], + dataType: 0x20, + attrData: lookupState[value.state], + }], + cfg: cfg.xiaomi, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{ + attrId: lookupAttrId[button], + dataType: 0x20, + }], + cfg: cfg.xiaomi, + }; + } + }, + }, STS_PRS_251_beep: { key: ['beep'], convert: (key, value, message, type, postfix) => { diff --git a/devices.js b/devices.js index 4043f15b2af4e..c6db30f166378 100644 --- a/devices.js +++ b/devices.js @@ -212,9 +212,9 @@ const devices = [ fromZigbee: [ fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_basic_report, ], - toZigbee: [tz.on_off], + toZigbee: [tz.on_off, tz.xiaomi_decoupled_mode], ep: (device) => { - return {'': 2}; + return {'system': 1, 'default': 2}; }, }, { @@ -238,9 +238,9 @@ const devices = [ fromZigbee: [ fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons, fz.ignore_basic_change, fz.ignore_basic_report, ], - toZigbee: [tz.on_off], + toZigbee: [tz.on_off, tz.xiaomi_decoupled_mode], ep: (device) => { - return {'left': 2, 'right': 3}; + return {'system': 1, 'left': 2, 'right': 3}; }, }, { From 15517b4a4277751fa715dea2fae7e912ba24f232 Mon Sep 17 00:00:00 2001 From: Aleksey <26031505+dev-abo@users.noreply.github.com> Date: Mon, 18 Feb 2019 13:28:57 -0600 Subject: [PATCH 561/676] Added LivingWise ZigBee Smart dimmer Switch. Model#: LVS-ZB500D (#288) * Added LivingWise ZigBee Smart dimmer Switch. Model#: LVS-ZB500D * Update devices.js * Update devices.js * Update fromZigbee.js --- converters/fromZigbee.js | 5 +++++ devices.js | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 19b0f4c70b1a1..9793afabf1c85 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1828,6 +1828,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_genIdentify: { + cid: 'genIdentify', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; diff --git a/devices.js b/devices.js index c6db30f166378..dfefdf7182477 100644 --- a/devices.js +++ b/devices.js @@ -2579,6 +2579,20 @@ const devices = [ execute(device, actions, callback); }, }, + + // LivingWise + { + zigbeeModel: ['abb71ca5fe1846f185cfbda554046cce'], + model: 'LVS-ZB500D', + vendor: 'LivingWise', + description: 'ZigBee smart dimmer switch', + supports: 'on/off, brightness', + toZigbee: [tz.on_off, tz.light_brightness], + fromZigbee: [ + fz.state, fz.brightness, fz.ignore_light_brightness_report, fz.ignore_onoff_change, + fz.ignore_genIdentify, + ], + }, ]; module.exports = devices.map((device) => From 0811d07a6acf7ce3e84e2bcdb6a7b4f215361c68 Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 19 Feb 2019 13:18:23 -0500 Subject: [PATCH 562/676] added samsung smartthings plug (#286) * added samsung smartthings plug * Update fromZigbee.js * Update devices.js * Update toZigbee.js * Update toZigbee.js * didn't need custom toZigbee converter * didn't need custom toZigbee converter --- devices.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/devices.js b/devices.js index dfefdf7182477..1b847ca00b8e0 100644 --- a/devices.js +++ b/devices.js @@ -1866,6 +1866,25 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['outlet'], + model: 'IM6001-OTP05', + vendor: 'SmartThings', + description: 'Outlet', + supports: 'on/off', + fromZigbee: [fz.state, fz.ignore_onoff_report], + toZigbee: [tz.on_off], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, // Trust { From 2867e5b5edd7196caaba0c72f3f0becd38bf2fac Mon Sep 17 00:00:00 2001 From: MoskitoHorst Date: Tue, 19 Feb 2019 19:34:30 +0100 Subject: [PATCH 563/676] tint remote (ZBT-Remote) Color keys (#284) * tint remote, 3 keys activated On-Off and brightness up/down * Update devices.js * Update fromZigbee.js * Update devices.js * Update devices.js * tint remote (ZBT-Remote) Color keys Implementation of color wheel and color temp, brightness with stesize and transition-time * syntax power-key * Update fromZigbee.js change on/off-button to action:'on' and 'off' * Update fromZigbee.js * Update devices.js * Update fromZigbee.js * Update devices.js --- converters/fromZigbee.js | 40 +++++++++++++++++++++++++++++++++++++--- devices.js | 1 + 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 9793afabf1c85..579ec6a5524cd 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1570,14 +1570,14 @@ const converters = { cid: 'genOnOff', type: 'cmdOn', convert: (model, msg, publish, options) => { - return {action: 'toggle'}; + return {action: 'on'}; }, }, tint404011_off: { cid: 'genOnOff', type: 'cmdOff', convert: (model, msg, publish, options) => { - return {action: 'toggle'}; + return {action: 'off'}; }, }, tint404011_brightness_updown_click: { @@ -1585,7 +1585,41 @@ const converters = { type: 'cmdStep', convert: (model, msg, publish, options) => { const direction = msg.data.data.stepmode === 1 ? 'down' : 'up'; - return {action: `brightness_${direction}_click`}; + return { + action: `brightness_${direction}_click`, + step_size: msg.data.data.stepsize, + transition_time: msg.data.data.transtime, + }; + }, + }, + tint404011_scene: { + cid: 'genBasic', + type: 'cmdWrite', + convert: (model, msg, publish, options) => { + return {action: `scene${msg.data.data[0].attrData}`}; + }, + }, + tint404011_move_to_color_temp: { + cid: 'lightingColorCtrl', + type: 'cmdMoveToColorTemp', + convert: (model, msg, publish, options) => { + return { + action: `color_temp`, + action_color_temperature: msg.data.data.colortemp, + transition_time: msg.data.data.transtime, + }; + }, + }, + tint404011_move_to_color: { + cid: 'lightingColorCtrl', + type: 'cmdMoveToColor', + convert: (model, msg, publish, options) => { + return { + action: `color_wheel`, + action_color_x: msg.data.data.colorx, + action_color_y: msg.data.data.colory, + transition_time: msg.data.data.transtime, + }; }, }, cmdToggle: { diff --git a/devices.js b/devices.js index 1b847ca00b8e0..f8261fafc15f0 100644 --- a/devices.js +++ b/devices.js @@ -2416,6 +2416,7 @@ const devices = [ vendor: 'Müller Licht', fromZigbee: [ fz.tint404011_on, fz.tint404011_off, fz.cmdToggle, fz.tint404011_brightness_updown_click, + fz.tint404011_move_to_color_temp, fz.tint404011_move_to_color, fz.tint404011_scene, ], toZigbee: [], }, From 22dd61f2400f4eb726de02e791baf4eb0c3b408a Mon Sep 17 00:00:00 2001 From: Ruslan Sayfutdinov Date: Wed, 20 Feb 2019 19:23:30 +0000 Subject: [PATCH 564/676] [Xiaomi wired switch] Parse operation mode response (#290) --- converters/fromZigbee.js | 38 ++++++++++++++++++++++++++++++++++++++ converters/toZigbee.js | 9 +++++---- devices.js | 8 ++++---- 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 579ec6a5524cd..bceeeb899356b 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -807,6 +807,21 @@ const converters = { } }, }, + QBKG04LM_operation_mode: { + cid: 'genBasic', + type: 'devChange', + convert: (model, msg, publish, options) => { + const mappingMode = { + 0x12: 'control_relay', + 0xFE: 'decoupled', + }; + const key = '65314'; + if (msg.data.data.hasOwnProperty(key)) { + const mode = mappingMode[msg.data.data[key]]; + return {operation_mode: mode}; + } + }, + }, QBKG03LM_QBKG12LM_state: { cid: 'genOnOff', type: 'attReport', @@ -837,6 +852,29 @@ const converters = { } }, }, + QBKG03LM_operation_mode: { + cid: 'genBasic', + type: 'devChange', + convert: (model, msg, publish, options) => { + const mappingButton = { + '65314': 'left', + '65315': 'right', + }; + const mappingMode = { + 0x12: 'control_left_relay', + 0x22: 'control_right_relay', + 0xFE: 'decoupled', + }; + for (const key in mappingButton) { + if (msg.data.data.hasOwnProperty(key)) { + const payload = {}; + const mode = mappingMode[msg.data.data[key]]; + payload[`operation_mode_${mappingButton[key]}`] = mode; + return payload; + } + } + }, + }, xiaomi_lock_report: { cid: 'genBasic', type: 'attReport', diff --git a/converters/toZigbee.js b/converters/toZigbee.js index e8db0a9afce6c..0f1a467b7e44b 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -856,8 +856,8 @@ const converters = { } }, }, - xiaomi_decoupled_mode: { - key: ['decoupled_mode'], + xiaomi_switch_operation_mode: { + key: ['operation_mode'], convert: (key, value, message, type, postfix) => { const cid = 'genBasic'; const lookupAttrId = { @@ -866,9 +866,10 @@ const converters = { 'right': 0xFF23, }; const lookupState = { + 'control_relay': 0x12, + 'control_left_relay': 0x12, + 'control_right_relay': 0x22, 'decoupled': 0xFE, - 'toggle_left': 0x12, - 'toggle_right': 0x22, }; let button; if (value.hasOwnProperty('button')) { diff --git a/devices.js b/devices.js index f8261fafc15f0..fbaa75352b3da 100644 --- a/devices.js +++ b/devices.js @@ -210,9 +210,9 @@ const devices = [ description: 'Aqara single key wired wall switch', supports: 'on/off', fromZigbee: [ - fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_basic_report, + fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change, fz.QBKG04LM_operation_mode, fz.ignore_basic_report, ], - toZigbee: [tz.on_off, tz.xiaomi_decoupled_mode], + toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode], ep: (device) => { return {'system': 1, 'default': 2}; }, @@ -236,9 +236,9 @@ const devices = [ description: 'Aqara double key wired wall switch', supports: 'release/hold, on/off', fromZigbee: [ - fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons, fz.ignore_basic_change, fz.ignore_basic_report, + fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons, fz.QBKG03LM_operation_mode, fz.ignore_basic_report, ], - toZigbee: [tz.on_off, tz.xiaomi_decoupled_mode], + toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode], ep: (device) => { return {'system': 1, 'left': 2, 'right': 3}; }, From 6ac77f1cde36e691b1b5907052a1029826fe72d3 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 20 Feb 2019 21:02:38 +0100 Subject: [PATCH 565/676] Add GL-FL-004TZ. https://github.com/Koenkk/zigbee-shepherd-converters/issues/293 --- devices.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/devices.js b/devices.js index fbaa75352b3da..810a4001e5476 100644 --- a/devices.js +++ b/devices.js @@ -1785,6 +1785,22 @@ const devices = [ description: 'Zigbee LED Driver', extend: gledopto.light_onoff_brightness, }, + { + zigbeeModel: ['GL-FL-004TZ'], + model: 'GL-FL-004TZ', + vendor: 'Gledopto', + description: 'Zigbee 10W floodlight RGB CCT', + extend: generic.light_onoff_brightness_colortemp_colorxy, + ep: (device) => { + if (device.epList.toString() === '11,12,13') { + return {'': 12}; + } else if (device.epList.toString() === '10,11,13' || device.epList.toString() === '11,13') { + return {'': 11}; + } else { + return {}; + } + }, + }, // SmartThings { From 93a0bb4cdbcb688935906b82d4211348e332368a Mon Sep 17 00:00:00 2001 From: jonnycastaway Date: Thu, 21 Feb 2019 18:50:33 +0100 Subject: [PATCH 566/676] Added support for new Philips Hue Outdoor Motion Sensor (#294) * Update devices.js Added support for the new Philips Hue Outdoor Motion Sensor * Update devices.js --- devices.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/devices.js b/devices.js index 810a4001e5476..391554f5fea60 100644 --- a/devices.js +++ b/devices.js @@ -860,6 +860,41 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['SML002'], + model: '9290019758', + vendor: 'Philips', + description: 'Hue motion outdoor sensor', + supports: 'occupancy, temperature, illuminance', + fromZigbee: [ + fz.hue_battery, fz.generic_occupancy, fz.generic_temperature, + fz.ignore_occupancy_change, fz.generic_illuminance, fz.ignore_illuminance_change, + fz.ignore_temperature_change, + ], + toZigbee: [tz.generic_occupancy_timeout], + ep: (device) => { + return { + '': 2, // default + 'ep1': 1, + 'ep2': 2, // e.g. for write to msOccupancySensing + }; + }, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 2); + + const actions = [ + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('msIlluminanceMeasurement', coordinator, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.bind('msOccupancySensing', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), + (cb) => device.report('msOccupancySensing', 'occupancy', 0, 600, null, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + ]; + + execute(device, actions, callback); + }, + }, // Belkin { From ab9e8ce509042bf4403bdb8c9f3e90922b36b0ca Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 23 Feb 2019 14:32:32 +0100 Subject: [PATCH 567/676] Add ST218. https://github.com/Koenkk/zigbee-shepherd-converters/issues/295 --- devices.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/devices.js b/devices.js index 391554f5fea60..5565513d626c8 100644 --- a/devices.js +++ b/devices.js @@ -2664,6 +2664,32 @@ const devices = [ fz.ignore_genIdentify, ], }, + + // Stelpro + { + zigbeeModel: ['ST218'], + model: 'ST218', + vendor: 'Stelpro', + description: 'Built-in electronic thermostat', + supports: 'temperature ', + fromZigbee: [fz.thermostat_att_report, fz.thermostat_dev_change], + toZigbee: [ + tz.thermostat_local_temperature, tz.thermostat_occupied_heating_setpoint, + ], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 25); + const actions = [ + (cb) => device.bind('genBasic', coordinator, cb), + (cb) => device.bind('genIdentify', coordinator, cb), + (cb) => device.bind('genGroups', coordinator, cb), + (cb) => device.bind('hvacThermostat', coordinator, cb), + (cb) => device.bind('hvacUserInterfaceCfg', coordinator, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('hvacThermostat', 'localTemp', 300, 3600, 0, cb), + ]; + execute(device, actions, callback); + }, + }, ]; module.exports = devices.map((device) => From ed6536a9a1750862c84e6aef1c1067fb47787e6f Mon Sep 17 00:00:00 2001 From: highground88 Date: Sat, 23 Feb 2019 23:34:33 +1000 Subject: [PATCH 568/676] Add ' generic_state_multi_ep' to support Nue branded switches (#298) --- converters/fromZigbee.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index bceeeb899356b..116c0408ce520 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1371,6 +1371,17 @@ const converters = { } }, }, + generic_state_multi_ep: { + cid: 'genOnOff', + type: 'attReport', + convert: (model, msg, publish, options) => { + const ep = msg.endpoints[0]; + const key = `state_${getKey(model.ep(ep.device), ep.epId)}`; + const payload = {}; + payload[key] = msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'; + return payload; + }, + }, RZHAC_4256251_power: { cid: 'haElectricalMeasurement', type: 'attReport', From bb97a3585e045fd1e6f3cf412233fac8aa1bfac9 Mon Sep 17 00:00:00 2001 From: highground88 Date: Sat, 23 Feb 2019 23:36:38 +1000 Subject: [PATCH 569/676] Update devices.js with support for Nue 'FB56+ZSW1HKJ1.7' (#297) --- devices.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 5565513d626c8..aa61865263d09 100644 --- a/devices.js +++ b/devices.js @@ -1665,7 +1665,26 @@ const devices = [ extend: generic.light_onoff_brightness, }, - // Nue + // Nue, 3A Smarthome, Smarthome Pty Ltd, 3A + { + zigbeeModel: ['FB56+ZSW1HKJ1.7'], + model: 'HGZB-042', + vendor: 'Nue', + description: 'Smart light switch - 2 gang', + supports: 'on/off', + fromZigbee: [fz.generic_state_multi_ep, fz.ignore_onoff_change], + toZigbee: [tz.on_off], + ep: (device) => { + return {'left': 16, 'right': 17}; + }, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const ep16 = shepherd.find(ieeeAddr, 16); + execute(ep16, [(cb) => ep16.bind('genOnOff', coordinator, cb)], () => { + const ep17 = shepherd.find(ieeeAddr, 17); + execute(ep17, [(cb) => ep17.bind('genOnOff', coordinator, cb)], callback); + }); + }, + }, { zigbeeModel: ['FB56+ZSW05HG1.2'], model: 'FB56+ZSW05HG1.2', From 812a5797da8cc88f50734c98d992ba16e4e2de4c Mon Sep 17 00:00:00 2001 From: highground88 Date: Sat, 23 Feb 2019 23:45:47 +1000 Subject: [PATCH 570/676] Fix problem with FB56+ZSW05HG1.2' (HGZB-01A) handler (#299) * Fix problem with FB56+ZSW05HG1.2' (HGZB-01A) handler FB56+ZSW05HG1.2' (HGZB-01A) This device was already supported and works, however error message below. I've added "fz.ignore_onoff_change" to the device handler and this fixes the problem (if it is a problem?), but wanted to check with you @Koenkk that it's okay to ignore the 'genOnOff' message? ```zigbee2mqtt:debug 2/23/2019, 1:31:59 AM Received zigbee message of type 'devChange' with data '{"cid":"genOnOff","data":{"onOff":0}}' of device 'FB56+ZSW05HG1.2' (0x00124b000ae5fa3e) zigbee2mqtt:warn 2/23/2019, 1:31:59 AM No converter available for 'FB56+ZSW05HG1.2' with cid 'genOnOff', type 'devChange' and data '{"cid":"genOnOff","data":{"onOff":0}}' zigbee2mqtt:warn 2/23/2019, 1:31:59 AM Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html. zigbee2mqtt:debug 2/23/2019, 1:32:23 AM Received MQTT message on 'zigbee2mqtt/0x00124b000ae5fa3e/set' with data 'ON' zigbee2mqtt:info 2/23/2019, 1:32:23 AM Zigbee publish to device '0x00124b000ae5fa3e', genOnOff - on - {} - {"manufSpec":0,"disDefaultRsp":0} - null``` I also moved the " // Smart Home Pty" devices below // Nue as I believe they are probably the same and before long you might get double ups. * Update devices.js * Update devices.js * Update devices.js * Update devices.js * Update devices.js * Update devices.js --- devices.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/devices.js b/devices.js index aa61865263d09..0439c32adc3ba 100644 --- a/devices.js +++ b/devices.js @@ -1689,9 +1689,9 @@ const devices = [ zigbeeModel: ['FB56+ZSW05HG1.2'], model: 'FB56+ZSW05HG1.2', vendor: 'Nue', - description: 'ZigBee one gang smart switch', + description: 'ZigBee one gang wall / in-wall smart switch', supports: 'on/off', - fromZigbee: [fz.state], + fromZigbee: [fz.state, fz.ignore_onoff_change], toZigbee: [tz.on_off], }, { @@ -1714,6 +1714,24 @@ const devices = [ extend: generic.light_onoff_brightness, }, + // Smart Home Pty + { + zigbeeModel: ['FB56-ZCW11HG1.2'], + model: 'HGZB-07A', + vendor: 'Smart Home Pty', + description: 'RGBW Downlight', + extend: generic.light_onoff_brightness_colortemp_colorxy, + }, + { + zigbeeModel: ['FNB56-SKT1EHG1.2'], + model: 'HGZB-20-DE', + vendor: 'Smart Home Pty', + description: 'Power plug', + supports: 'on/off', + fromZigbee: [fz.state_change], + toZigbee: [tz.on_off], + }, + // Gledopto { zigbeeModel: ['GLEDOPTO', 'GL-C-008', 'GL-C-007'], @@ -2420,24 +2438,6 @@ const devices = [ toZigbee: [], }, - // Smart Home Pty - { - zigbeeModel: ['FB56-ZCW11HG1.2'], - model: 'HGZB-07A', - vendor: 'Smart Home Pty', - description: 'RGBW Downlight', - extend: generic.light_onoff_brightness_colortemp_colorxy, - }, - { - zigbeeModel: ['FNB56-SKT1EHG1.2'], - model: 'HGZB-20-DE', - vendor: 'Smart Home Pty', - description: 'Power plug', - supports: 'on/off', - fromZigbee: [fz.state_change], - toZigbee: [tz.on_off], - }, - // Paul Neuhaus { zigbeeModel: ['NLG-CCT light '], From a6ba4c184a71fb91e3ef350693488c4157bcdb34 Mon Sep 17 00:00:00 2001 From: Joe Lu Date: Sat, 23 Feb 2019 06:42:56 -0800 Subject: [PATCH 571/676] Add support for Keen Home smart vent (#276) * - added support for Keen Home smart vent * - added more from-zigbee handler for keen vent - added more model# for keen vent * Update devices.js * - updated reporting interval and only handle attReport and ignore devChange on temperature and pressure * - added cover_position handler * - added cover_position to keen home toZigbee * - added transtime to cover_position.set - changed key to state for cover_position * Update toZigbee.js * Update devices.js * - added cover_state and cover_position fromZigbee handler - made changes to cover_open_close toZigbee handler so it'd work correctly * - added devChange fromZigbee handler for keen home pressure, temperature and battery - updated cover_position and cover_position_report fromZigbee handler to return both position and state (state is determined by position now) - updated cover_open_close to only change currentLevel - adjusted attReport interval for kee home vent * - removed reporting config * - fixed lint errors --- converters/fromZigbee.js | 57 +++++++++++++++++++++++++++++++++++++++- converters/toZigbee.js | 49 ++++++++++++++++++++++++++++++++++ devices.js | 38 ++++++++++++++++++++++++++- 3 files changed, 142 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 116c0408ce520..7a510406d8443 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -373,6 +373,14 @@ const converters = { return {temperature: precisionRoundOptions(temperature, options, 'temperature')}; }, }, + generic_temperature_change: { + cid: 'msTemperatureMeasurement', + type: 'devChange', + convert: (model, msg, publish, options) => { + const temperature = parseFloat(msg.data.data['measuredValue']) / 100.0; + return {temperature: precisionRoundOptions(temperature, options, 'temperature')}; + }, + }, xiaomi_temperature: { cid: 'msTemperatureMeasurement', type: 'attReport', @@ -666,7 +674,7 @@ const converters = { return {illuminance: msg.data.data['measuredValue']}; }, }, - xiaomi_pressure: { + generic_pressure: { cid: 'msPressureMeasurement', type: 'attReport', convert: (model, msg, publish, options) => { @@ -1305,6 +1313,15 @@ const converters = { } }, }, + generic_battery_change: { + cid: 'genPowerCfg', + type: 'devChange', + convert: (model, msg, publish, options) => { + if (msg.data.data.hasOwnProperty('batteryPercentageRemaining')) { + return {battery: msg.data.data['batteryPercentageRemaining']}; + } + }, + }, hue_battery: { cid: 'genPowerCfg', type: 'attReport', @@ -1784,6 +1801,44 @@ const converters = { return {action: `${direction}`}; }, }, + cover_position: { + cid: 'genLevelCtrl', + type: 'devChange', + convert: (model, msg, publish, options) => { + const currentLevel = msg.data.data['currentLevel']; + const position = Math.round(Number(currentLevel) / 2.55).toString(); + const state = position > 0 ? 'OPEN' : 'CLOSE'; + return {state: state, position: position}; + }, + }, + cover_position_report: { + cid: 'genLevelCtrl', + type: 'attReport', + convert: (model, msg, publish, options) => { + const currentLevel = msg.data.data['currentLevel']; + const position = Math.round(Number(currentLevel) / 2.55).toString(); + const state = position > 0 ? 'OPEN' : 'CLOSE'; + return {state: state, position: position}; + }, + }, + keen_home_smart_vent_pressure: { + cid: 'msPressureMeasurement', + type: 'devChange', + convert: (model, msg, publish, options) => { + // '{"cid":"msPressureMeasurement","data":{"32":990494}}' + const pressure = parseFloat(msg.data.data['32']) / 1000.0; + return {pressure: precisionRoundOptions(pressure, options, 'pressure')}; + }, + }, + keen_home_smart_vent_pressure_report: { + cid: 'msPressureMeasurement', + type: 'attReport', + convert: (model, msg, publish, options) => { + // '{"cid":"msPressureMeasurement","data":{"32":990494}}' + const pressure = parseFloat(msg.data.data['32']) / 1000.0; + return {pressure: precisionRoundOptions(pressure, options, 'pressure')}; + }, + }, // Ignore converters (these message dont need parsing). ignore_doorlock_change: { diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 0f1a467b7e44b..b8864ed9f4144 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1217,6 +1217,55 @@ const converters = { return converters.light_colortemp.convert(key, value, message, type, postfix); }, }, + cover_open_close: { + key: ['state'], + convert: (key, value, message, type, postfix) => { + if (type === 'set') { + if (typeof value !== 'string') { + return; + } + + const positionByState = { + 'open': 100, + 'close': 0, + }; + + value = positionByState[value.toLowerCase()]; + } + + return converters.cover_position.convert(key, value, message, type, postfix); + }, + }, + cover_position: { + key: ['position'], + convert: (key, value, message, type, postfix) => { + const cid = 'genLevelCtrl'; + const attrId = 'currentLevel'; + + if (type === 'set') { + value = Math.round(Number(value) * 2.55).toString(); + return { + cid: cid, + cmd: 'moveToLevelWithOnOff', + cmdType: 'functional', + zclData: { + level: value, + transtime: 0, + }, + cfg: cfg.default, + readAfterWriteTime: 0, + }; + } else if (type === 'get') { + return { + cid: cid, + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr(cid, attrId).value}], + cfg: cfg.default, + }; + } + }, + }, // Ignore converters ignore_transition: { diff --git a/devices.js b/devices.js index 0439c32adc3ba..f77ae086cd39a 100644 --- a/devices.js +++ b/devices.js @@ -277,7 +277,7 @@ const devices = [ description: 'Aqara temperature, humidity and pressure sensor', supports: 'temperature, humidity and pressure', fromZigbee: [ - fz.xiaomi_battery_3v, fz.xiaomi_temperature, fz.xiaomi_humidity, fz.xiaomi_pressure, + fz.xiaomi_battery_3v, fz.xiaomi_temperature, fz.xiaomi_humidity, fz.generic_pressure, fz.ignore_basic_change, fz.ignore_temperature_change, fz.ignore_humidity_change, fz.ignore_pressure_change, fz.WSDCGQ01LM_WSDCGQ11LM_interval, ], @@ -2649,6 +2649,42 @@ const devices = [ }, }, + // Keen Home + { + zigbeeModel: ['SV01-410-MP-1.0', 'SV01-410-MP-1.4', 'SV01-410-MP-1.5'], + model: 'SV01', + vendor: 'Keen Home', + description: 'Smart vent', + supports: 'open, close, position, temperature, pressure, battery', + fromZigbee: [ + fz.cover_position, + fz.cover_position_report, + fz.generic_temperature, + fz.generic_temperature_change, + fz.generic_battery, + fz.generic_battery_change, + fz.keen_home_smart_vent_pressure, + fz.keen_home_smart_vent_pressure_report, + fz.ignore_onoff_change, + fz.ignore_onoff_report, + ], + toZigbee: [ + tz.cover_open_close, + tz.cover_position, + ], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.bind('msPressureMeasurement', coordinator, cb), + ]; + + execute(device, actions, callback); + }, + }, + // ELKO { zigbeeModel: ['ElkoDimmerZHA'], From e4662efa6e707c3a00d61b9602625bf9bb8796d7 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 23 Feb 2019 15:43:23 +0100 Subject: [PATCH 572/676] 7.1.11 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index d17758c2fad6c..021426fe6cd55 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.10", + "version": "7.1.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9e30421a6ae2e..d5426ddfd4b30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.10", + "version": "7.1.11", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 3c03f14dbf59c90812a17968818efdbbd2f50341 Mon Sep 17 00:00:00 2001 From: hwijers <45356188+hwijers@users.noreply.github.com> Date: Sat, 23 Feb 2019 16:28:38 +0100 Subject: [PATCH 573/676] Add device to support Trust Remote control ZYCT-202 (#300) * Add device to support Trust Remote control ZYCT-202 https://github.com/Koenkk/zigbee2mqtt/issues/635 * Add the concerters for the Trust Remote control ZYCT-202 The groupid has been processed in the button press. So you have the action and the selector mode in 1 state value and can easily be used in a Home Assistant Automation state rule. * Add the concerters for the Trust Remote control ZYCT-202 The groupid has been processed in the button press. So you have the action and the selector mode in 1 state value and can easily be used in a Home Assistant Automation state rule. (https://github.com/Koenkk/zigbee2mqtt/issues/635) * Update devices.js Fixed spaces line 1941 * Update devices.js Fixed the maximum line length of 120 max-len * Separated the action and groupid in the return rules Have separated the action and groupid in the return rules... * Update fromZigbee.js --- converters/fromZigbee.js | 32 ++++++++++++++++++++++++++++++++ devices.js | 21 +++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 7a510406d8443..424a07b9bd5bb 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1801,6 +1801,38 @@ const converters = { return {action: `${direction}`}; }, }, + ZYCT202_on: { + cid: 'genOnOff', + type: 'cmdOn', + convert: (model, msg, publish, options) => { + return {action: 'on', action_group: msg.groupid}; + }, + }, + ZYCT202_off: { + cid: 'genOnOff', + type: 'cmdOffWithEffect', + convert: (model, msg, publish, options) => { + return {action: 'off', action_group: msg.groupid}; + }, + }, + ZYCT202_stop: { + cid: 'genLevelCtrl', + type: 'cmdStop', + convert: (model, msg, publish, options) => { + return {action: 'stop', action_group: msg.groupid}; + }, + }, + ZYCT202_up_down: { + cid: 'genLevelCtrl', + type: 'cmdMove', + convert: (model, msg, publish, options) => { + const value = msg.data.data['movemode']; + let action = null; + if (value === 0) action = {'action': 'up-press', 'action_group': msg.groupid}; + else if (value === 1) action = {'action': 'down-press', 'action_group': msg.groupid}; + return action ? action : null; + }, + }, cover_position: { cid: 'genLevelCtrl', type: 'devChange', diff --git a/devices.js b/devices.js index f77ae086cd39a..3a3c1a30ef939 100644 --- a/devices.js +++ b/devices.js @@ -1975,6 +1975,27 @@ const devices = [ }, // Trust + { + zigbeeModel: ['\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000'+ + '\u0000\u0000\u0000\u0000\u0000'], + model: 'ZYCT-202', + vendor: 'Trust', + description: 'Remote control', + supports: 'on, off, stop, up-press, down-press', + fromZigbee: [ + fz.ZYCT202_on, fz.ZYCT202_off, fz.ZYCT202_stop, fz.ZYCT202_up_down, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const actions = [ + (cb) => device.foundation('genOnOff', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, { zigbeeModel: ['ZLL-DimmableLigh'], model: 'ZLED-2709', From d9ea0b9c9a4073abe3bc78b523f902c6157109e3 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 23 Feb 2019 19:26:01 +0100 Subject: [PATCH 574/676] Support TRADFRI wirelessm motion sensor E1525. https://github.com/Koenkk/zigbee2mqtt/issues/247 --- converters/fromZigbee.js | 23 +++++++++++++++++++++++ devices.js | 22 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 424a07b9bd5bb..3f65f2c3d0d13 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -509,6 +509,29 @@ const converters = { } }, }, + E1525_occupancy: { + cid: 'genOnOff', + type: 'cmdOnWithTimedOff', + convert: (model, msg, publish, options) => { + const timeout = msg.data.data.ontime / 10; + const deviceID = msg.endpoints[0].device.ieeeAddr; + + // Stop existing timer because motion is detected and set a new one. + if (store[deviceID]) { + clearTimeout(store[deviceID]); + store[deviceID] = null; + } + + if (timeout !== 0) { + store[deviceID] = setTimeout(() => { + publish({occupancy: false}); + store[deviceID] = null; + }, timeout * 1000); + } + + return {occupancy: true}; + }, + }, generic_occupancy_no_off_msg: { // This is for occupancy sensor that only send a message when motion detected, // but do not send a motion stop. diff --git a/devices.js b/devices.js index 3a3c1a30ef939..20662a8828fb2 100644 --- a/devices.js +++ b/devices.js @@ -633,6 +633,28 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['TRADFRI motion sensor'], + model: 'E1525', + vendor: 'IKEA', + description: 'TRADFRI motion sensor', + supports: 'occupancy', + fromZigbee: [fz.generic_battery, fz.ignore_power_change, fz.E1525_occupancy], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = { + direction: 0, attrId: 33, dataType: 32, minRepIntval: 0, maxRepIntval: repInterval.MAX, repChange: 0, + }; + + const actions = [ + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.foundation('genPowerCfg', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, + }, { zigbeeModel: ['TRADFRI signal repeater'], model: 'E1746', From 24b2020d844eb4482b66686f0fe0af7f54c4a54a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 23 Feb 2019 19:26:19 +0100 Subject: [PATCH 575/676] 7.1.12 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 021426fe6cd55..c7968d7e24841 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.11", + "version": "7.1.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d5426ddfd4b30..6c54106aacff1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.11", + "version": "7.1.12", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From a7ba1d2cd4c8f67a3d254d35d4878fb54b65a3d8 Mon Sep 17 00:00:00 2001 From: Joe Lu Date: Sat, 23 Feb 2019 11:42:55 -0800 Subject: [PATCH 576/676] Add support for AXIS Gear window shade motor (#301) * - added support for AXIS Gear window shade motor * - updated AXIS Gear model * Update devices.js --- devices.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/devices.js b/devices.js index 20662a8828fb2..0a942ec33972a 100644 --- a/devices.js +++ b/devices.js @@ -2728,6 +2728,17 @@ const devices = [ }, }, + // AXIS + { + zigbeeModel: ['Gear'], + model: 'GR-ZB01-W', + vendor: 'AXIS', + description: 'Gear window shade motor', + supports: 'open, close, position', + fromZigbee: [fz.cover_position, fz.cover_position_report], + toZigbee: [tz.cover_open_close, tz.cover_position], + }, + // ELKO { zigbeeModel: ['ElkoDimmerZHA'], From 499cd80597134adc91489664ee662d5091c45807 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 24 Feb 2019 13:47:33 +0100 Subject: [PATCH 577/676] Support HGZB-42-UK. https://github.com/Koenkk/zigbee-shepherd-converters/issues/278 --- devices.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/devices.js b/devices.js index 0a942ec33972a..541d91c536a8d 100644 --- a/devices.js +++ b/devices.js @@ -1687,11 +1687,11 @@ const devices = [ extend: generic.light_onoff_brightness, }, - // Nue, 3A Smarthome, Smarthome Pty Ltd, 3A + // Nue, 3A { zigbeeModel: ['FB56+ZSW1HKJ1.7'], model: 'HGZB-042', - vendor: 'Nue', + vendor: 'Nue / 3A', description: 'Smart light switch - 2 gang', supports: 'on/off', fromZigbee: [fz.generic_state_multi_ep, fz.ignore_onoff_change], @@ -1710,7 +1710,7 @@ const devices = [ { zigbeeModel: ['FB56+ZSW05HG1.2'], model: 'FB56+ZSW05HG1.2', - vendor: 'Nue', + vendor: 'Nue / 3A', description: 'ZigBee one gang wall / in-wall smart switch', supports: 'on/off', fromZigbee: [fz.state, fz.ignore_onoff_change], @@ -1719,7 +1719,7 @@ const devices = [ { zigbeeModel: ['FNB56-SKT1DHG1.4'], model: 'MG-AUWS01', - vendor: 'Nue', + vendor: 'Nue / 3A', description: 'ZigBee Double GPO', supports: 'on/off', fromZigbee: [fz.nue_power_state, fz.ignore_onoff_change], @@ -1731,10 +1731,19 @@ const devices = [ { zigbeeModel: ['FNB56-ZSW23HG1.1'], model: 'HGZB-01A', - vendor: 'Nue', + vendor: 'Nue / 3A', description: 'ZigBee smart light controller', extend: generic.light_onoff_brightness, }, + { + zigbeeModel: ['FNB56-ZSW01LX2.0'], + model: 'HGZB-42-UK', + description: 'Zigbee smart switch 2 gang', + vendor: 'Nue / 3A', + supports: 'on/off', + fromZigbee: [fz.ignore_onoff_change, fz.state], + toZigbee: [tz.on_off], + }, // Smart Home Pty { From ace05e9ea9a7425eab401520cf35c965134ed3c6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 24 Feb 2019 13:47:38 +0100 Subject: [PATCH 578/676] 7.1.13 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index c7968d7e24841..05b2cb8da6ebe 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.12", + "version": "7.1.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6c54106aacff1..9d4aec55a1860 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.12", + "version": "7.1.13", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 889682b5e9bd8239beebb1ca34ef9b177817fa73 Mon Sep 17 00:00:00 2001 From: Andrey Date: Sun, 24 Feb 2019 17:03:59 +0200 Subject: [PATCH 579/676] Change up and down in Ikea Outlet Switch (#302) --- converters/fromZigbee.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3f65f2c3d0d13..284588443ba4c 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -151,14 +151,14 @@ const converters = { cid: 'genLevelCtrl', type: 'cmdMove', convert: (model, msg, publish, options) => { - return {click: 'brightness_up'}; + return {click: 'brightness_down'}; }, }, E1743_brightness_down: { cid: 'genLevelCtrl', type: 'cmdMoveWithOnOff', convert: (model, msg, publish, options) => { - return {click: 'brightness_down'}; + return {click: 'brightness_up'}; }, }, E1743_brightness_stop: { From 4b2c800ac9b7afaebaeddb8f14dcb0fd0c2fa429 Mon Sep 17 00:00:00 2001 From: Andrey Date: Tue, 26 Feb 2019 20:23:00 +0200 Subject: [PATCH 580/676] TRADFRI dimmer change maximum response time. (#305) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 541d91c536a8d..6dc8e6d637966 100644 --- a/devices.js +++ b/devices.js @@ -5,7 +5,7 @@ const fz = require('./converters/fromZigbee'); const tz = require('./converters/toZigbee'); const repInterval = { - MAX: 58000, + MAX: 62000, HOUR: 3600, }; From e59092cb07c70f657cddcba0ecd6b0a0c545e21f Mon Sep 17 00:00:00 2001 From: MoskitoHorst Date: Tue, 26 Feb 2019 19:29:28 +0100 Subject: [PATCH 581/676] Update action color wheel structure. * tint remote, 3 keys activated On-Off and brightness up/down * Update devices.js * Update fromZigbee.js * Update devices.js * Update devices.js * tint remote (ZBT-Remote) Color keys Implementation of color wheel and color temp, brightness with stesize and transition-time * syntax power-key * Update fromZigbee.js change on/off-button to action:'on' and 'off' * Update fromZigbee.js * Update devices.js * Update fromZigbee.js * Update devices.js * tint remote, changed to standard return values, changed calculations of color to franctions. * adopt to master * adopt master changes * Update fromZigbee.js * Update fromZigbee.js --- converters/fromZigbee.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 284588443ba4c..d28e3384790a3 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1704,9 +1704,11 @@ const converters = { type: 'cmdMoveToColor', convert: (model, msg, publish, options) => { return { - action: `color_wheel`, - action_color_x: msg.data.data.colorx, - action_color_y: msg.data.data.colory, + action_color: { + x: precisionRound(msg.data.data.colorx / 65535, 3), + y: precisionRound(msg.data.data.colory / 65535, 3), + }, + action: 'color_wheel', transition_time: msg.data.data.transtime, }; }, From 609266e0b7a752c52b511a5b439f3887428389cb Mon Sep 17 00:00:00 2001 From: Chrischi- Date: Wed, 27 Feb 2019 17:36:26 +0100 Subject: [PATCH 582/676] fixed thermostat_setpoint_raise_lower (#308) setpoint_raise_lower is client-to-server only. There is no need for a "get". To get the setpoint use: occupied_heating_setpoint or unoccupied_heating_setpoint --- converters/toZigbee.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index b8864ed9f4144..60afb12f49ad3 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -604,14 +604,6 @@ const converters = { }, cfg: cfg.default, }; - } else if (type === 'get') { - return { - cid: cid, - cmd: 'read', - cmdType: 'foundation', - zclData: [{attrId: zclId.attr(cid, attrId).value}], - cfg: cfg.default, - }; } }, }, From 3f4ec5362b73c8ce6e00ff506bafd6a476e45979 Mon Sep 17 00:00:00 2001 From: papanirual <46861405+papanirual@users.noreply.github.com> Date: Wed, 27 Feb 2019 18:17:03 +0100 Subject: [PATCH 583/676] Added illuminance measurement for SML002 (#307) * Added illuminance measurement Added illuminance measurement for Philips outdoor sensor SML002. * Update devices.js --- devices.js | 1 + 1 file changed, 1 insertion(+) diff --git a/devices.js b/devices.js index 6dc8e6d637966..48a9c9851d91b 100644 --- a/devices.js +++ b/devices.js @@ -912,6 +912,7 @@ const devices = [ (cb) => device.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), (cb) => device.report('msOccupancySensing', 'occupancy', 0, 600, null, cb), (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + (cb) => device.report('msIlluminanceMeasurement', 'measuredValue', 0, 600, null, cb), ]; execute(device, actions, callback); From 8faebd47d475bda3f9b07a075214173e1ba03b92 Mon Sep 17 00:00:00 2001 From: Torsten Date: Thu, 28 Feb 2019 19:41:40 +0100 Subject: [PATCH 584/676] new: Hue Flourish ceiling light (#309) * new: Hue Flourish ceiling light * Update devices.js --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index 48a9c9851d91b..706889a27d5bc 100644 --- a/devices.js +++ b/devices.js @@ -680,6 +680,13 @@ const devices = [ description: 'Hue Go', extend: hue.light_onoff_brightness_colortemp_colorxy, }, + { + zigbeeModel: ['LCC001'], + model: '4090531P7', + vendor: 'Philips', + description: 'Hue Flourish white and color ambiance ceiling light', + extend: hue.light_onoff_brightness_colortemp_colorxy, + }, { zigbeeModel: ['LWB004'], model: '433714', From a2f74d57a2e59dbea234d9459ceab7a2a2cbdccc Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 28 Feb 2019 21:07:39 +0100 Subject: [PATCH 585/676] Cosmetic updates. --- converters/toZigbee.js | 223 +++++++++++++++++++++-------------------- devices.js | 4 +- 2 files changed, 114 insertions(+), 113 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 60afb12f49ad3..b178da07a7016 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -21,6 +21,7 @@ const cfg = { }; const converters = { + // Generic factory_reset: { key: ['reset'], convert: (key, value, message, type, postfix) => { @@ -64,103 +65,85 @@ const converters = { } }, }, - generic_occupancy_timeout: { - // set delay after motion detector changes from occupied to unoccupied - key: ['occupancy_timeout'], + cover_open_close: { + key: ['state'], convert: (key, value, message, type, postfix) => { - const cid = 'msOccupancySensing'; // 1030 - const attrId = zclId.attr(cid, 'pirOToUDelay').value; // = 16 + if (type === 'set') { + if (typeof value !== 'string') { + return; + } + + const positionByState = { + 'open': 100, + 'close': 0, + }; + + value = positionByState[value.toLowerCase()]; + } + + return converters.cover_position.convert(key, value, message, type, postfix); + }, + }, + cover_position: { + key: ['position'], + convert: (key, value, message, type, postfix) => { + const cid = 'genLevelCtrl'; + const attrId = 'currentLevel'; if (type === 'set') { + value = Math.round(Number(value) * 2.55).toString(); return { cid: cid, - cmd: 'write', - cmdType: 'foundation', - zclData: [{ - attrId: attrId, - dataType: 33, // uint16 - // hue_sml001: - // in seconds, minimum 10 seconds, <10 values result - // in 10 seconds delay - // make sure you write to second endpoint! - attrData: value, - }], + cmd: 'moveToLevelWithOnOff', + cmdType: 'functional', + zclData: { + level: value, + transtime: 0, + }, cfg: cfg.default, + readAfterWriteTime: 0, }; } else if (type === 'get') { return { cid: cid, cmd: 'read', cmdType: 'foundation', - zclData: [{ - attrId: attrId, - }], + zclData: [{attrId: zclId.attr(cid, attrId).value}], cfg: cfg.default, }; } }, }, - hue_power_on_behavior: { - key: ['hue_power_on_behavior'], + occupancy_timeout: { + // set delay after motion detector changes from occupied to unoccupied + key: ['occupancy_timeout'], convert: (key, value, message, type, postfix) => { - const lookup = { - 'default': 0x01, - 'on': 0x01, - 'off': 0x00, - 'recover': 0xff, - }; + const cid = 'msOccupancySensing'; // 1030 + const attrId = zclId.attr(cid, 'pirOToUDelay').value; // = 16 if (type === 'set') { return { - cid: 'genOnOff', - cmd: 'write', - cmdType: 'foundation', - zclData: [{ - attrId: 0x4003, - dataType: 0x30, - attrData: lookup[value], - }], - cfg: cfg.default, - }; - } - }, - }, - hue_power_on_brightness: { - key: ['hue_power_on_brightness'], - convert: (key, value, message, type, postfix) => { - if (type === 'set') { - if (value === 'default') { - value = 255; - } - return { - cid: 'genLevelCtrl', + cid: cid, cmd: 'write', cmdType: 'foundation', zclData: [{ - attrId: 0x4000, - dataType: 0x20, + attrId: attrId, + dataType: 33, // uint16 + // hue_sml001: + // in seconds, minimum 10 seconds, <10 values result + // in 10 seconds delay + // make sure you write to second endpoint! attrData: value, }], cfg: cfg.default, }; - } - }, - }, - hue_power_on_color_temperature: { - key: ['hue_power_on_color_temperature'], - convert: (key, value, message, type, postfix) => { - if (type === 'set') { - if (value === 'default') { - value = 366; - } + } else if (type === 'get') { return { - cid: 'lightingColorCtrl', - cmd: 'write', + cid: cid, + cmd: 'read', cmdType: 'foundation', zclData: [{ - attrId: 0x4010, - dataType: 0x21, - attrData: value, + attrId: attrId, }], cfg: cfg.default, }; @@ -314,17 +297,19 @@ const converters = { } }, }, - // This converter is a combination of light_color and light_colortemp and - // can be used instead of the two individual converters. When used to set, - // it actually calls out to light_color or light_colortemp to get the - // return value. When used to get, it gets both color and colorTemp in - // one call. - // The reason for the existence of this somewhat peculiar converter is - // that some lights don't report their state when changed. To fix this, - // we query the state after we set it. We want to query color and colorTemp - // both when setting either, because both change when setting one. This - // converter is used to do just that. light_color_colortemp: { + /** + * This converter is a combination of light_color and light_colortemp and + * can be used instead of the two individual converters. When used to set, + * it actually calls out to light_color or light_colortemp to get the + * return value. When used to get, it gets both color and colorTemp in + * one call. + * The reason for the existence of this somewhat peculiar converter is + * that some lights don't report their state when changed. To fix this, + * we query the state after we set it. We want to query color and colorTemp + * both when setting either, because both change when setting one. This + * converter is used to do just that. + */ key: ['color', 'color_temp', 'color_temp_percent'], convert: (key, value, message, type, postfix) => { const cid = 'lightingColorCtrl'; @@ -750,10 +735,8 @@ const converters = { } }, }, - /* - * Note when send the command to set sensitivity, press button on the device - * to make it wakeup - */ + + // Device specific DJT11LM_vibration_sensitivity: { key: ['sensitivity'], convert: (key, value, message, type, postfix) => { @@ -1209,50 +1192,68 @@ const converters = { return converters.light_colortemp.convert(key, value, message, type, postfix); }, }, - cover_open_close: { - key: ['state'], + hue_power_on_behavior: { + key: ['hue_power_on_behavior'], convert: (key, value, message, type, postfix) => { - if (type === 'set') { - if (typeof value !== 'string') { - return; - } + const lookup = { + 'default': 0x01, + 'on': 0x01, + 'off': 0x00, + 'recover': 0xff, + }; - const positionByState = { - 'open': 100, - 'close': 0, + if (type === 'set') { + return { + cid: 'genOnOff', + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: 0x4003, + dataType: 0x30, + attrData: lookup[value], + }], + cfg: cfg.default, }; - - value = positionByState[value.toLowerCase()]; } - - return converters.cover_position.convert(key, value, message, type, postfix); }, }, - cover_position: { - key: ['position'], + hue_power_on_brightness: { + key: ['hue_power_on_brightness'], convert: (key, value, message, type, postfix) => { - const cid = 'genLevelCtrl'; - const attrId = 'currentLevel'; - if (type === 'set') { - value = Math.round(Number(value) * 2.55).toString(); + if (value === 'default') { + value = 255; + } return { - cid: cid, - cmd: 'moveToLevelWithOnOff', - cmdType: 'functional', - zclData: { - level: value, - transtime: 0, - }, + cid: 'genLevelCtrl', + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: 0x4000, + dataType: 0x20, + attrData: value, + }], cfg: cfg.default, - readAfterWriteTime: 0, }; - } else if (type === 'get') { + } + }, + }, + hue_power_on_color_temperature: { + key: ['hue_power_on_color_temperature'], + convert: (key, value, message, type, postfix) => { + if (type === 'set') { + if (value === 'default') { + value = 366; + } return { - cid: cid, - cmd: 'read', + cid: 'lightingColorCtrl', + cmd: 'write', cmdType: 'foundation', - zclData: [{attrId: zclId.attr(cid, attrId).value}], + zclData: [{ + attrId: 0x4010, + dataType: 0x21, + attrData: value, + }], cfg: cfg.default, }; } diff --git a/devices.js b/devices.js index 706889a27d5bc..2ee2b5f5b9d60 100644 --- a/devices.js +++ b/devices.js @@ -864,7 +864,7 @@ const devices = [ fz.ignore_occupancy_change, fz.generic_illuminance, fz.ignore_illuminance_change, fz.ignore_temperature_change, ], - toZigbee: [tz.generic_occupancy_timeout], + toZigbee: [tz.occupancy_timeout], ep: (device) => { return { '': 2, // default @@ -900,7 +900,7 @@ const devices = [ fz.ignore_occupancy_change, fz.generic_illuminance, fz.ignore_illuminance_change, fz.ignore_temperature_change, ], - toZigbee: [tz.generic_occupancy_timeout], + toZigbee: [tz.occupancy_timeout], ep: (device) => { return { '': 2, // default From 2a1c7298848a784556c393a0615cd6bd3399f229 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Mar 2019 16:30:13 +0100 Subject: [PATCH 586/676] Separate moveToLevelWithOnOff and moveToLevel converters. https://github.com/Koenkk/zigbee2mqtt/issues/176 --- converters/toZigbee.js | 53 ++++++++++++++++++++++++++++++++++++++---- devices.js | 22 +++++++++--------- 2 files changed, 59 insertions(+), 16 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index b178da07a7016..765940b084c5e 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -163,10 +163,10 @@ const converters = { return { cid: cid, - cmd: 'moveToLevelWithOnOff', + cmd: 'moveToLevel', cmdType: 'functional', zclData: { - level: value, + level: Number(value), transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, }, cfg: cfg.default, @@ -183,6 +183,49 @@ const converters = { } }, }, + light_onoff_brightness: { + key: ['state', 'brightness', 'brightness_percent'], + convert: (key, value, message, type, postfix) => { + if (type === 'set') { + const hasBrightness = message.hasOwnProperty('brightness') || + message.hasOwnProperty('brightness_percent'); + const hasState = message.hasOwnProperty('state'); + const state = hasState ? message.state.toLowerCase() : null; + + if (hasState && (state === 'off' || !hasBrightness)) { + return converters.on_off.convert('state', state, message, 'set', postfix); + } else { + let brightness = 0; + + if (message.hasOwnProperty('brightness')) { + brightness = message.brightness; + } else if (message.hasOwnProperty('brightness_percent')) { + brightness = Math.round(Number(message.brightness_percent) * 2.55).toString(); + } + + return { + cid: 'genLevelCtrl', + cmd: 'moveToLevelWithOnOff', + cmdType: 'functional', + zclData: { + level: Number(brightness), + transtime: message.hasOwnProperty('transition') ? message.transition * 10 : 0, + }, + cfg: cfg.default, + readAfterWriteTime: message.hasOwnProperty('transition') ? message.transition * 1000 : 0, + }; + } + } else if (type === 'get') { + return { + cid: 'genLevelCtrl', + cmd: 'read', + cmdType: 'foundation', + zclData: [{attrId: zclId.attr('genLevelCtrl', 'currentLevel').value}], + cfg: cfg.default, + }; + } + }, + }, light_colortemp: { key: ['color_temp', 'color_temp_percent'], convert: (key, value, message, type, postfix) => { @@ -1162,14 +1205,14 @@ const converters = { } }, }, - gledopto_light_brightness: { - key: ['brightness', 'brightness_percent'], + gledopto_light_onoff_brightness: { + key: ['state', 'brightness', 'brightness_percent'], convert: (key, value, message, type, postfix) => { if (message.hasOwnProperty('transition')) { message.transition = message.transition * 3.3; } - return converters.light_brightness.convert(key, value, message, type, postfix); + return converters.light_onoff_brightness.convert(key, value, message, type, postfix); }, }, gledopto_light_color_colortemp: { diff --git a/devices.js b/devices.js index 2ee2b5f5b9d60..8a308a3220c63 100644 --- a/devices.js +++ b/devices.js @@ -15,7 +15,7 @@ const generic = { light_onoff_brightness: { supports: 'on/off, brightness', fromZigbee: [fz.brightness, fz.state_change, fz.state, fz.brightness_report, fz.ignore_genGroups_devChange], - toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition, tz.light_alert], + toZigbee: [tz.light_onoff_brightness, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colortemp: { supports: 'on/off, brightness, color temperature', @@ -23,7 +23,7 @@ const generic = { fz.brightness, fz.color_colortemp, fz.state_change, fz.state, fz.brightness_report, fz.color_colortemp_report, fz.ignore_genGroups_devChange, ], - toZigbee: [tz.on_off, tz.light_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], + toZigbee: [tz.light_onoff_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colorxy: { supports: 'on/off, brightness, color xy', @@ -31,7 +31,7 @@ const generic = { fz.brightness, fz.color_colortemp, fz.state_change, fz.state, fz.brightness_report, fz.color_colortemp_report, fz.ignore_genGroups_devChange, ], - toZigbee: [tz.on_off, tz.light_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], + toZigbee: [tz.light_onoff_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colortemp_colorxy: { supports: 'on/off, brightness, color temperature, color xy', @@ -40,7 +40,7 @@ const generic = { fz.brightness_report, fz.color_colortemp_report, fz.ignore_genGroups_devChange, ], toZigbee: [ - tz.on_off, tz.light_brightness, tz.light_color_colortemp, tz.ignore_transition, + tz.light_onoff_brightness, tz.light_color_colortemp, tz.ignore_transition, tz.light_alert, ], }, @@ -50,13 +50,13 @@ const gledopto = { light_onoff_brightness: { supports: generic.light_onoff_brightness.supports, fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: [tz.on_off, tz.gledopto_light_brightness, tz.ignore_transition, tz.light_alert], + toZigbee: [tz.gledopto_light_onoff_brightness, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colortemp: { supports: generic.light_onoff_brightness_colortemp.supports, fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee, toZigbee: [ - tz.on_off, tz.gledopto_light_brightness, tz.gledopto_light_colortemp, tz.ignore_transition, + tz.gledopto_light_onoff_brightness, tz.gledopto_light_colortemp, tz.ignore_transition, tz.light_alert, ], }, @@ -64,7 +64,7 @@ const gledopto = { supports: generic.light_onoff_brightness_colortemp_colorxy.supports, fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, toZigbee: [ - tz.on_off, tz.gledopto_light_brightness, tz.gledopto_light_color_colortemp, tz.ignore_transition, + tz.gledopto_light_onoff_brightness, tz.gledopto_light_color_colortemp, tz.ignore_transition, tz.light_alert, ], }, @@ -1553,7 +1553,7 @@ const devices = [ description: 'ZigBee plug-in smart dimmer', supports: 'on/off, brightness', fromZigbee: [fz.brightness, fz.ignore_onoff_change, fz.state], - toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], + toZigbee: [tz.light_onoff_brightness, tz.ignore_transition], configure: (ieeeAddr, shepherd, coordinator, callback) => { const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; const device = shepherd.find(ieeeAddr, 1); @@ -1591,7 +1591,7 @@ const devices = [ description: 'ZigBee in-wall smart dimmer', supports: 'on/off, brightness', fromZigbee: [fz.brightness, fz.ignore_onoff_change, fz.state], - toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], + toZigbee: [tz.light_onoff_brightness, tz.ignore_transition], configure: (ieeeAddr, shepherd, coordinator, callback) => { const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; const device = shepherd.find(ieeeAddr, 1); @@ -2764,7 +2764,7 @@ const devices = [ description: 'ZigBee in-wall smart dimmer', supports: 'on/off, brightness', fromZigbee: [fz.brightness, fz.ignore_onoff_change, fz.state], - toZigbee: [tz.on_off, tz.light_brightness, tz.ignore_transition], + toZigbee: [tz.light_onoff_brightness, tz.ignore_transition], configure: (ieeeAddr, shepherd, coordinator, callback) => { const cfg = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; const device = shepherd.find(ieeeAddr, 1); @@ -2784,7 +2784,7 @@ const devices = [ vendor: 'LivingWise', description: 'ZigBee smart dimmer switch', supports: 'on/off, brightness', - toZigbee: [tz.on_off, tz.light_brightness], + toZigbee: [tz.light_onoff_brightness], fromZigbee: [ fz.state, fz.brightness, fz.ignore_light_brightness_report, fz.ignore_onoff_change, fz.ignore_genIdentify, From ab5728117d9cb09e3a8d707e508612de5b1bd0e4 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Mar 2019 16:30:35 +0100 Subject: [PATCH 587/676] 7.2.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 05b2cb8da6ebe..4326922fab492 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.13", + "version": "7.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9d4aec55a1860..48e3ab6ed7f16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.1.13", + "version": "7.2.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 48351bd216b40fdc68faa2735294f001f8d3d324 Mon Sep 17 00:00:00 2001 From: Joe Lu Date: Sat, 2 Mar 2019 07:39:16 -0800 Subject: [PATCH 588/676] updated reporting confg for Keen Vent and AXIS Gear (#310) * - updated reporting configuration for Keen Vent - updated AXIS Gear to start report its position and battery level * Update devices.js --- devices.js | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 8a308a3220c63..2f6684d0272d5 100644 --- a/devices.js +++ b/devices.js @@ -7,6 +7,7 @@ const tz = require('./converters/toZigbee'); const repInterval = { MAX: 62000, HOUR: 3600, + MINUTE: 60, }; const coordinatorGroup = 99; @@ -2739,6 +2740,25 @@ const devices = [ (cb) => device.bind('genPowerCfg', coordinator, cb), (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), (cb) => device.bind('msPressureMeasurement', coordinator, cb), + + // eslint-disable-next-line + // https://github.com/yracine/keenhome.device-type/blob/master/devicetypes/keensmartvent.src/keensmartvent.groovy + (cb) => device.report( + 'msTemperatureMeasurement', 'measuredValue', repInterval.MINUTE * 2, repInterval.HOUR, 50, cb + ), + (cb) => device.foundation( + 'msPressureMeasurement', + 'configReport', + [{ + direction: 0, attrId: 32, dataType: 34, minRepIntval: repInterval.MINUTE * 5, + maxRepIntval: repInterval.HOUR, repChange: 500, + }], + {manufSpec: 1, manufCode: 4443}, + cb + ), + (cb) => device.report( + 'genPowerCfg', 'batteryPercentageRemaining', repInterval.HOUR, repInterval.HOUR * 12, 0, cb + ), ]; execute(device, actions, callback); @@ -2751,9 +2771,22 @@ const devices = [ model: 'GR-ZB01-W', vendor: 'AXIS', description: 'Gear window shade motor', - supports: 'open, close, position', - fromZigbee: [fz.cover_position, fz.cover_position_report], + supports: 'open, close, position, battery', + fromZigbee: [fz.cover_position, fz.cover_position_report, fz.generic_battery, fz.generic_battery_change], toZigbee: [tz.cover_open_close, tz.cover_position], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genLevelCtrl', 'currentLevel', repInterval.MINUTE, repInterval.HOUR * 12, 0, cb), + (cb) => device.report( + 'genPowerCfg', 'batteryPercentageRemaining', repInterval.HOUR, repInterval.HOUR * 12, 0, cb + ), + ]; + + execute(device, actions, callback); + }, }, // ELKO From 1c80bb386717cb48454dccc67662e8cea453cecd Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Mar 2019 16:58:19 +0100 Subject: [PATCH 589/676] Update zcl-id. --- npm-shrinkwrap.json | 1907 ++++++++++++++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 1790 insertions(+), 119 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4326922fab492..5fd79e4495eba 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -25,9 +25,9 @@ } }, "acorn": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.0.tgz", - "integrity": "sha512-MW/FjM+IvU9CgBzjO3UIPCE2pyEwUsoFl+VGdczOPEdxfGFjuKny/gN54mOuX7Qxmb9Rg9MCn2oKiSUeW+pjrw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", "dev": true }, "acorn-jsx": { @@ -37,9 +37,9 @@ "dev": true }, "ajv": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.8.1.tgz", - "integrity": "sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ==", + "version": "6.9.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz", + "integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -48,6 +48,12 @@ "uri-js": "^4.2.2" } }, + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true + }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -78,23 +84,114 @@ "sprintf-js": "~1.0.2" } }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==" }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -105,6 +202,35 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -116,12 +242,35 @@ "resolved": "https://registry.npmjs.org/busyman/-/busyman-0.3.0.tgz", "integrity": "sha1-FN6kn2JgfOSy0wsgPGMG72zKiKc=" }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, "callsites": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", "dev": true }, + "camelcase": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "dev": true + }, "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", @@ -157,11 +306,28 @@ "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=" }, - "circular-json": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", - "dev": true + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } }, "cli-cursor": { "version": "2.1.0", @@ -178,6 +344,33 @@ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -193,10 +386,10 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", "dev": true }, "concat-map": { @@ -205,6 +398,12 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -231,6 +430,18 @@ "ms": "^2.1.1" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -245,6 +456,62 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -252,14 +519,29 @@ "dev": true }, "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, "enum": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/enum/-/enum-2.5.0.tgz", @@ -268,6 +550,31 @@ "is-buffer": "^1.1.0" } }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -275,35 +582,35 @@ "dev": true }, "eslint": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.13.0.tgz", - "integrity": "sha512-nqD5WQMisciZC5EHZowejLKQjWGuFS5c70fxqSKlnDME+oz9zmE8KTlX+lHSg+/5wsC/kf9Q9eMkC8qS3oM2fg==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.15.0.tgz", + "integrity": "sha512-xwG7SS5JLeqkiR3iOmVgtF8Y6xPdtr6AAsN6ph7Q6R/fv+3UlKYoika8SmNzmb35qdRF+RfTY35kMEdtbi+9wg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "ajv": "^6.5.3", + "ajv": "^6.9.1", "chalk": "^2.1.0", "cross-spawn": "^6.0.5", "debug": "^4.0.1", - "doctrine": "^2.1.0", - "eslint-scope": "^4.0.0", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.2", "eslint-utils": "^1.3.1", "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.0", + "espree": "^5.0.1", "esquery": "^1.0.1", "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", + "file-entry-cache": "^5.0.1", "functional-red-black-tree": "^1.0.1", "glob": "^7.1.2", "globals": "^11.7.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", - "inquirer": "^6.1.0", + "inquirer": "^6.2.2", "js-yaml": "^3.12.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.3.0", - "lodash": "^4.17.5", + "lodash": "^4.17.11", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", @@ -314,7 +621,7 @@ "semver": "^5.5.1", "strip-ansi": "^4.0.0", "strip-json-comments": "^2.0.1", - "table": "^5.0.2", + "table": "^5.2.3", "text-table": "^0.2.0" }, "dependencies": { @@ -336,9 +643,9 @@ "dev": true }, "eslint-scope": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz", - "integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.2.tgz", + "integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -358,12 +665,12 @@ "dev": true }, "espree": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.0.tgz", - "integrity": "sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", "dev": true, "requires": { - "acorn": "^6.0.2", + "acorn": "^6.0.7", "acorn-jsx": "^5.0.0", "eslint-visitor-keys": "^1.0.0" } @@ -404,6 +711,101 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "external-editor": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", @@ -415,6 +817,71 @@ "tmp": "^0.0.33" } }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", @@ -443,25 +910,105 @@ } }, "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "findup-sync": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", - "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-2.0.0.tgz", + "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", "dev": true, "requires": { - "flat-cache": "^1.2.1", - "object-assign": "^4.0.1" + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + }, + "dependencies": { + "is-buffer": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "dev": true + } } }, "flat-cache": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", - "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", + "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { - "circular-json": "^0.3.1", - "graceful-fs": "^4.1.2", - "rimraf": "~2.6.2", - "write": "^0.2.1" + "map-cache": "^0.2.2" } }, "fs.realpath": { @@ -470,17 +1017,44 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, - "get-func-name": { + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", @@ -495,16 +1069,34 @@ "path-is-absolute": "^1.0.0" } }, - "globals": { - "version": "11.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", - "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", - "dev": true + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "globals": { + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", "dev": true }, "growl": { @@ -513,18 +1105,74 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -572,6 +1220,12 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, "inquirer": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", @@ -610,29 +1264,198 @@ } } }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", "dev": true }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -640,9 +1463,9 @@ "dev": true }, "js-yaml": { - "version": "3.12.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.1.tgz", - "integrity": "sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA==", + "version": "3.12.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", + "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -661,6 +1484,21 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -671,12 +1509,87 @@ "type-check": "~0.3.2" } }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "mem": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", + "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^1.0.0", + "p-is-promise": "^2.0.0" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -698,6 +1611,27 @@ "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -708,57 +1642,50 @@ } }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.0.2.tgz", + "integrity": "sha512-RtTJsmmToGyeTznSOMoM6TPEk1A84FQaHIciKrRqARZx+B5ccJ5tXlmJzEKGBxZdqk9UjpRsesZTUkZmR5YnuQ==", "dev": true, "requires": { + "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", + "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "findup-sync": "2.0.0", + "glob": "7.1.3", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "3.12.0", + "log-symbols": "2.2.0", "minimatch": "3.0.4", "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "ms": "2.1.1", + "node-environment-flags": "1.0.4", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "12.0.5", + "yargs-parser": "11.1.1", + "yargs-unparser": "1.5.0" }, "dependencies": { - "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -777,6 +1704,25 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -789,12 +1735,107 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "node-environment-flags": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.4.tgz", + "integrity": "sha512-M9rwCnWVLW7PX+NUWe3ejEdiLYinRpsEre9hMkU/6NS4h+EEulYaDH1gCEZ2gyXsmw+RXYDaV2JkkTNcsPDJ0Q==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", + "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", "dev": true }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -827,21 +1868,92 @@ "wordwrap": "~1.0.0" } }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, - "parent-module": { + "p-defer": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", - "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", - "dev": true, + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", + "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", + "dev": true + }, + "p-limit": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", + "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", + "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", + "dev": true, "requires": { "callsites": "^3.0.0" } }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -865,6 +1977,12 @@ "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=" }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -877,24 +1995,84 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + } + }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", @@ -905,6 +2083,12 @@ "signal-exit": "^3.0.2" } }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -932,6 +2116,15 @@ "tslib": "^1.9.0" } }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -944,6 +2137,35 @@ "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -976,12 +2198,189 @@ "is-fullwidth-code-point": "^2.0.0" } }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -1001,6 +2400,12 @@ "ansi-regex": "^3.0.0" } }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -1017,15 +2422,43 @@ } }, "table": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/table/-/table-5.2.2.tgz", - "integrity": "sha512-f8mJmuu9beQEDkKHLzOv4VxVYlU68NpdzjbGPl69i4Hx0sTopJuNxuzJd17iV2h24dAfa93u794OnDA5jqXvfQ==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", + "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", "dev": true, "requires": { - "ajv": "^6.6.1", + "ajv": "^6.9.1", "lodash": "^4.17.11", - "slice-ansi": "^2.0.0", - "string-width": "^2.1.1" + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "dev": true + }, + "string-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.0.0.tgz", + "integrity": "sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.0.0" + } + }, + "strip-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "dev": true, + "requires": { + "ansi-regex": "^4.0.0" + } + } } }, "text-table": { @@ -1049,6 +2482,48 @@ "os-tmpdir": "~1.0.2" } }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, "tslib": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", @@ -1069,6 +2544,81 @@ "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==" }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -1078,6 +2628,18 @@ "punycode": "^2.1.0" } }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", @@ -1087,12 +2649,74 @@ "isexe": "^2.0.0" } }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, "wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", "dev": true }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -1100,17 +2724,64 @@ "dev": true }, "write": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", - "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" } }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", + "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.11", + "yargs": "^12.0.5" + } + }, "zcl-id": { - "version": "https://github.com/koenkk/zcl-id/tarball/2f25e0848562b570453abd663794d5b95e1f324f", - "integrity": "sha512-lfVS1kAuuiSs0laGpaOX9tpn3r/hZvNZLCSr1ZxZNaUz9a4xDRdGkvbdEox4x3Xkg8PTFF2Au1S5cFRUmbA/cA==", + "version": "https://github.com/koenkk/zcl-id/tarball/77ba3058c6c4b09a9958761ae5e3046765c12872", + "integrity": "sha512-kyQZ6+5vv1NR2nMlJ5zahSCsjSvmLsZl3a7LTahIcZtLHpiOUxfAdueCyjJFkpsJgwxDea9OJj0ftIcQZQEwwQ==", "requires": { "busyman": "^0.3.0", "enum": "^2.5.0" diff --git a/package.json b/package.json index 48e3ab6ed7f16..6d44bec345699 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "homepage": "https://github.com/Koenkk/zigbee-shepherd-converters", "dependencies": { - "zcl-id": "https://github.com/koenkk/zcl-id/tarball/2f25e0848562b570453abd663794d5b95e1f324f", + "zcl-id": "https://github.com/koenkk/zcl-id/tarball/77ba3058c6c4b09a9958761ae5e3046765c12872", "debounce": "*", "debug": "3.2.6", "chai": "*" From a766293601f5e2d984675c217717e697b0d62190 Mon Sep 17 00:00:00 2001 From: Gergely Markics <5822419+ugrug@users.noreply.github.com> Date: Sat, 2 Mar 2019 16:59:23 +0100 Subject: [PATCH 590/676] Add philips cluster for hue dimmer (#311) * Add philips cluster for hue dimmer * Modify philips hue dimmer * Modify philips hue dimmer * Modify philips hue dimmer * Update fromZigbee.js * Update devices.js * Update fromZigbee.js * Update fromZigbee.js --- converters/fromZigbee.js | 135 ++++++++++++++++++++++++--------------- devices.js | 23 ++----- 2 files changed, 89 insertions(+), 69 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index d28e3384790a3..70d644c1296a8 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -116,11 +116,11 @@ const ictcg1 = (model, msg, publish, options, action) => { }; const holdUpdateBrightness324131092621 = (deviceID) => { - if (store[deviceID] && store[deviceID].since && store[deviceID].direction) { - const duration = Date.now() - store[deviceID].since; - const delta = (duration / 10) * (store[deviceID].direction === 'up' ? 1 : -1); - const newValue = store[deviceID].value + delta; - store[deviceID].value = numberWithinRange(newValue, 0, 255); + if (store[deviceID] && store[deviceID].brightnessSince && store[deviceID].brightnessDirection) { + const duration = Date.now() - store[deviceID].brightnessSince; + const delta = (duration / 10) * (store[deviceID].brightnessDirection === 'up' ? 1 : -1); + const newValue = store[deviceID].brightnessValue + delta; + store[deviceID].brightnessValue = numberWithinRange(newValue, 0, 255); } }; @@ -1269,62 +1269,93 @@ const converters = { return {action: 'beeping'}; }, }, - _324131092621_on: { - cid: 'genOnOff', - type: 'cmdOn', - convert: (model, msg, publish, options) => { - return {action: 'on'}; - }, - }, - _324131092621_off: { - cid: 'genOnOff', - type: 'cmdOffWithEffect', - convert: (model, msg, publish, options) => { - return {action: 'off'}; - }, - }, - _324131092621_step: { - cid: 'genLevelCtrl', - type: 'cmdStep', + _324131092621_notification: { + cid: 'manuSpecificPhilips', + type: 'cmdHueNotification', convert: (model, msg, publish, options) => { + const payload = {}; + const deviceID = msg.endpoints[0].device.ieeeAddr; - const direction = msg.data.data.stepmode === 0 ? 'up' : 'down'; - const mode = msg.data.data.stepsize === 30 ? 'press' : 'hold'; + let button = null; + switch (msg.data.data['button']) { + case 1: + button = 'on'; + break; + case 2: + button = 'up'; + break; + case 3: + button = 'down'; + break; + case 4: + button = 'off'; + break; + } + let type = null; + switch (msg.data.data['type']) { + case 0: + type = 'press'; + break; + case 1: + type = 'hold'; + break; + case 2: + case 3: + type = 'release'; + break; + } + + const brightnessEnabled = options && options.hasOwnProperty('send_brightess') ? + options.send_brightess : true; + const brightnessSend = brightnessEnabled && button && (button == 'up' || button == 'down'); // Initialize store if (!store[deviceID]) { - store[deviceID] = {value: 255, since: null, direction: null}; + store[deviceID] = {pressStart: null, pressType: null}; + if (brightnessEnabled) { + store[deviceID].brightnessValue = 255; + store[deviceID].brightnessSince = null; + store[deviceID].brightnessDirection = null; + } } - if (mode === 'press') { - const newValue = store[deviceID].value + (direction === 'up' ? 50 : -50); - store[deviceID].value = numberWithinRange(newValue, 0, 255); - } else if (mode === 'hold') { - holdUpdateBrightness324131092621(deviceID); - store[deviceID].since = Date.now(); - store[deviceID].direction = direction; + if (button && type) { + if (type == 'press') { + store[deviceID].pressStart = Date.now(); + store[deviceID].pressType = 'press'; + if (brightnessSend) { + const newValue = store[deviceID].brightnessValue + (button === 'up' ? 50 : -50); + store[deviceID].brightnessValue = numberWithinRange(newValue, 0, 255); + } + } else if (type == 'hold') { + store[deviceID].pressType = 'hold'; + if (brightnessSend) { + holdUpdateBrightness324131092621(deviceID); + store[deviceID].brightnessSince = Date.now(); + store[deviceID].brightnessDirection = button; + } + } else if (type == 'release') { + if (brightnessSend) { + store[deviceID].brightnessSince = null; + store[deviceID].brightnessDirection = null; + } + if (store[deviceID].pressType == 'hold') { + store[deviceID].pressType += '-release'; + } + } + if (type != 'press') { + const pressDuration = + (store[deviceID].pressType == 'hold' || store[deviceID].pressType == 'hold-release') ? + Date.now() - store[deviceID].pressStart : 0; + payload['action'] = `${button}-${store[deviceID].pressType}`; + payload['duration'] = pressDuration / 1000; + if (brightnessSend) { + payload['brightness'] = store[deviceID].brightnessValue; + } + } } - return {action: `${direction}-${mode}`, brightness: store[deviceID].value}; - }, - }, - _324131092621_stop: { - cid: 'genLevelCtrl', - type: 'cmdStop', - convert: (model, msg, publish, options) => { - const deviceID = msg.endpoints[0].device.ieeeAddr; - - if (store[deviceID]) { - holdUpdateBrightness324131092621(deviceID); - const payload = { - brightness: store[deviceID].value, - action: `${store[deviceID].direction}-hold-release`, - }; - - store[deviceID].since = null; - store[deviceID].direction = null; - return payload; - } + return payload; }, }, generic_battery: { diff --git a/devices.js b/devices.js index 2f6684d0272d5..ab6f28a7e10ab 100644 --- a/devices.js +++ b/devices.js @@ -828,30 +828,19 @@ const devices = [ description: 'Hue dimmer switch', supports: 'on/off', fromZigbee: [ - fz._324131092621_on, fz._324131092621_off, fz._324131092621_step, fz._324131092621_stop, + fz._324131092621_notification, fz.ignore_power_change, fz.hue_battery, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { - const ep1 = shepherd.find(ieeeAddr, 1); + const ep2 = shepherd.find(ieeeAddr, 1); const actions = [ - (cb) => ep1.bind('genOnOff', coordinator, cb), - (cb) => ep1.bind('genLevelCtrl', coordinator, cb), + (cb) => ep2.bind('manuSpecificPhilips', coordinator, cb), + (cb) => ep2.bind('genPowerCfg', coordinator, cb), + (cb) => ep2.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), ]; - execute(ep1, actions, (result) => { - if (result) { - const ep2 = shepherd.find(ieeeAddr, 2); - const actions = [ - (cb) => ep2.bind('genPowerCfg', coordinator, cb), - (cb) => ep2.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), - ]; - - execute(ep2, actions, callback); - } else { - callback(result); - } - }); + execute(ep2, actions, callback); }, }, { From 3107d6bcdd8eee813e54dfb98c7a8a4eb38d218e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Mar 2019 17:00:19 +0100 Subject: [PATCH 591/676] 7.2.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 5fd79e4495eba..83d61a2fd9fdf 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.0", + "version": "7.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6d44bec345699..b4a1a2afc2047 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.0", + "version": "7.2.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 525bd6f807f0d05e643e359a9405b7e6ed611c0d Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Mar 2019 17:24:13 +0100 Subject: [PATCH 592/676] Check if message has onOff for state converters. https://github.com/Koenkk/zigbee2mqtt/issues/1176 --- converters/fromZigbee.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 70d644c1296a8..f6cdb7d9dc492 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -752,14 +752,18 @@ const converters = { cid: 'genOnOff', type: 'attReport', convert: (model, msg, publish, options) => { - return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + if (msg.data.data.hasOwnProperty('onOff')) { + return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + } }, }, state_change: { cid: 'genOnOff', type: 'devChange', convert: (model, msg, publish, options) => { - return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + if (msg.data.data.hasOwnProperty('onOff')) { + return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + } }, }, xiaomi_power: { From 88cf56087115194c22cbee7d9dc412796ccde331 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 2 Mar 2019 17:24:37 +0100 Subject: [PATCH 593/676] 7.2.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 83d61a2fd9fdf..ab9b5309eef96 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.1", + "version": "7.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b4a1a2afc2047..74bd086a69276 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.1", + "version": "7.2.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From de673dfe8eef8cc513f8c0943c87538f90b4f9ff Mon Sep 17 00:00:00 2001 From: Cameron Bulock Date: Sat, 2 Mar 2019 14:17:28 -0500 Subject: [PATCH 594/676] Additional model name for Osram LIGHTIFY Flex RGBW (#314) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index ab6f28a7e10ab..fcc5f898baef9 100644 --- a/devices.js +++ b/devices.js @@ -1132,7 +1132,7 @@ const devices = [ }, }, { - zigbeeModel: ['Flex RGBW', 'LIGHTIFY Indoor Flex RGBW'], + zigbeeModel: ['Flex RGBW', 'LIGHTIFY Indoor Flex RGBW', 'LIGHTIFY Flex RGBW'], model: '4052899926110', vendor: 'OSRAM', description: 'Flex RGBW', From 62aecafe3528f64b79c507fb835f8b218707de67 Mon Sep 17 00:00:00 2001 From: Andreas Seiderer Date: Sun, 3 Mar 2019 15:45:27 +0100 Subject: [PATCH 595/676] Update devices.js (#315) --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index fcc5f898baef9..f4db2506cbb04 100644 --- a/devices.js +++ b/devices.js @@ -709,6 +709,13 @@ const devices = [ description: 'Hue White Single bulb B22', extend: hue.light_onoff_brightness, }, + { + zigbeeModel: ['LWG001'], + model: '9290018195', + vendor: 'Philips', + description: 'Hue white GU10', + extend: hue.light_onoff_brightness, + }, { zigbeeModel: ['LST001'], model: '7299355PH', From d89a3ff628f6247e4b7021bab516317b28b85cad Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 3 Mar 2019 18:29:33 +0100 Subject: [PATCH 596/676] Support ISW-ZPR1-WP13. https://github.com/Koenkk/zigbee2mqtt/issues/768 --- converters/fromZigbee.js | 5 +++++ devices.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index f6cdb7d9dc492..352132dd89162 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2058,6 +2058,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_iaszone_report: { + cid: 'ssIasZone', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, ignore_genIdentify: { cid: 'genIdentify', type: 'attReport', diff --git a/devices.js b/devices.js index f4db2506cbb04..264d6afc5b34c 100644 --- a/devices.js +++ b/devices.js @@ -2675,6 +2675,34 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['ISW-ZPR1-WP13'], + model: 'ISW-ZPR1-WP13', + vendor: 'Bosch', + description: 'Motion sensor', + supports: 'occupancy and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.ignore_power_change, + fz.generic_batteryvoltage_3000_2500, fz.bosch_ias_zone_motion_status_change, + fz.ignore_iaszone_report, fz.ignore_iaszone_change, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 5); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report( + 'msTemperatureMeasurement', 'measuredValue', repInterval.MINUTE, repInterval.MAX, 0, cb + ), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', repInterval.HOUR, repInterval.MAX, cb), + ]; + + execute(device, actions, callback); + }, + }, // Immax { From ee43638b1114f9a1096328f3fb7d3a18afd6373f Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 3 Mar 2019 18:32:55 +0100 Subject: [PATCH 597/676] 7.2.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index ab9b5309eef96..511bf22a20f68 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.2", + "version": "7.2.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 74bd086a69276..b27cf9c2d34a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.2", + "version": "7.2.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From dcc98aa83f08058710293a3c3a594ed44ef32025 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 4 Mar 2019 17:35:58 +0100 Subject: [PATCH 598/676] Also check for realistic values in WSDCGQ01LM_WSDCGQ11LM_interval. https://github.com/Koenkk/zigbee2mqtt/issues/798 --- converters/fromZigbee.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 352132dd89162..dacb38863b1b8 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -313,10 +313,19 @@ const converters = { if (msg.data.data['65281']) { const temperature = parseFloat(msg.data.data['65281']['100']) / 100.0; const humidity = parseFloat(msg.data.data['65281']['101']) / 100.0; - const result = { - temperature: precisionRoundOptions(temperature, options, 'temperature'), - humidity: precisionRoundOptions(humidity, options, 'humidity'), - }; + const result = {}; + + // https://github.com/Koenkk/zigbee2mqtt/issues/798 + // Sometimes the sensor publishes non-realistic vales, as the sensor only works from + // -20 till +60, don't produce messages beyond these values. + if (temperature > -25 && temperature < 65) { + result.temperature = precisionRoundOptions(temperature, options, 'temperature'); + } + + // in the 0 - 100 range, don't produce messages beyond these values. + if (humidity >= 0 && humidity <= 100) { + result.humidity = precisionRoundOptions(humidity, options, 'humidity'); + } // Check if contains pressure (WSDCGQ11LM only) if (msg.data.data['65281'].hasOwnProperty('102')) { From 71b4800a515723c33af70ee5d220c8be981f2712 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 4 Mar 2019 17:36:15 +0100 Subject: [PATCH 599/676] 7.2.4 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 511bf22a20f68..188c9eca97377 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.3", + "version": "7.2.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b27cf9c2d34a8..ac129c5bdb318 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.3", + "version": "7.2.4", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From bc691fa074c77cc3c088b9e3859c1a24c53eddda Mon Sep 17 00:00:00 2001 From: Markus Goy Date: Mon, 4 Mar 2019 19:46:17 +0100 Subject: [PATCH 600/676] Add support for Philips Hue Sana (#316) Signed-off-by: markus1540 --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index 264d6afc5b34c..5d01cd47ac4c4 100644 --- a/devices.js +++ b/devices.js @@ -786,6 +786,13 @@ const devices = [ description: 'Hue white ambiance E26/E27', extend: hue.light_onoff_brightness_colortemp, }, + { + zigbeeModel: ['LCW001'], + model: '4090130P7', + vendor: 'Philips', + description: 'Hue Sana', + extend: hue.light_onoff_brightness_colortemp_colorxy, + }, { zigbeeModel: ['LTC001'], model: '3261030P7', From e346f62250527b282d2943636e1def619460d4b4 Mon Sep 17 00:00:00 2001 From: highground88 Date: Wed, 6 Mar 2019 02:42:43 +1000 Subject: [PATCH 601/676] Update fromZigbee.js with ignore_light_brightness_change (#318) Updated to support Nue Dimmer Switch (FB56+ZSC05HG1.0) --- converters/fromZigbee.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index dacb38863b1b8..5ffdb1307e4c3 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1942,6 +1942,11 @@ const converters = { }, // Ignore converters (these message dont need parsing). + ignore_light_brightness_change: { + cid: 'genLevelCtrl', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, ignore_doorlock_change: { cid: 'closuresDoorLock', type: 'devChange', From 4b55494882fa838fe287ae827537cca4ea583de6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 5 Mar 2019 18:50:53 +0100 Subject: [PATCH 602/676] Support HGZB-02A. https://github.com/Koenkk/zigbee2mqtt/issues/1179 --- devices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/devices.js b/devices.js index 5d01cd47ac4c4..83da1ef2b4cf4 100644 --- a/devices.js +++ b/devices.js @@ -1747,6 +1747,13 @@ const devices = [ description: 'ZigBee smart light controller', extend: generic.light_onoff_brightness, }, + { + zigbeeModel: ['FNB56-ZSC01LX1.2'], + model: 'HGZB-02A', + vendor: 'Nue / 3A', + description: 'ZigBee smart light controller', + extend: generic.light_onoff_brightness, + }, { zigbeeModel: ['FNB56-ZSW01LX2.0'], model: 'HGZB-42-UK', From fc10b40ef86561a295ca85bf8bb0744482aa1b57 Mon Sep 17 00:00:00 2001 From: highground88 Date: Thu, 7 Mar 2019 06:04:25 +1000 Subject: [PATCH 603/676] Update devices.js with FB56+ZSC05HG1.0 (Nue Smart Dimmer Switch) (#317) * Update devices.js with FB56+ZSC05HG1.0 (Nue Smart Dimmer Switch) * Renamed FB56+ZSC05HG1.0 model ID to correct ID. * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 83da1ef2b4cf4..942fd289c8afe 100644 --- a/devices.js +++ b/devices.js @@ -1700,6 +1700,15 @@ const devices = [ }, // Nue, 3A + { + zigbeeModel: ['FB56+ZSC05HG1.0'], + model: 'HGZB-04D', + vendor: 'Nue / 3A', + description: 'ZigBee smart dimmer wall switch', + supports: 'on/off, brightness', + toZigbee: [tz.on_off, tz.light_brightness], + fromZigbee: [fz.state, fz.ignore_onoff_change, fz.brightness_report, fz.ignore_light_brightness_change], + }, { zigbeeModel: ['FB56+ZSW1HKJ1.7'], model: 'HGZB-042', From a474d6d9ad36980c56f25170a180527db01e1831 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 6 Mar 2019 22:04:14 +0100 Subject: [PATCH 604/676] Add action for ICTC-G-1. https://github.com/Koenkk/zigbee2mqtt/issues/1191 --- converters/fromZigbee.js | 12 ++++++++++-- devices.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 5ffdb1307e4c3..0e28f10cce97e 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -83,6 +83,7 @@ const store = {}; const ictcg1 = (model, msg, publish, options, action) => { const deviceID = msg.endpoints[0].device.ieeeAddr; + const payload = {}; if (!store[deviceID]) { const _publish = debounce((msg) => publish(msg), 250); @@ -102,17 +103,24 @@ const ictcg1 = (model, msg, publish, options, action) => { if (action === 'move') { s.since = Date.now(); - s.direction = msg.data.data.movemode === 1 ? 'left' : 'right'; + const direction = msg.data.data.movemode === 1 ? 'left' : 'right'; + s.direction = direction; + payload.action = `rotate_${direction}`; } else if (action === 'stop' || action === 'level') { if (action === 'level') { s.value = msg.data.data.level; + const direction = s.value === 0 ? 'left' : 'right'; + payload.action = `rotate_${direction}_quick`; + } else { + payload.action = 'rotate_stop'; } s.since = false; s.direction = false; } - s.publish({brightness: s.value}); + payload.brightness = s.value; + s.publish(payload); }; const holdUpdateBrightness324131092621 = (deviceID) => { diff --git a/devices.js b/devices.js index 942fd289c8afe..a10f40b2b8828 100644 --- a/devices.js +++ b/devices.js @@ -513,7 +513,7 @@ const devices = [ model: 'ICTC-G-1', vendor: 'IKEA', description: 'TRADFRI wireless dimmer', - supports: 'brightness [0-255], quick rotate for instant 0/255', + supports: 'brightness [0-255] (quick rotate for instant 0/255), action', fromZigbee: [ fz.cmd_move, fz.cmd_move_with_onoff, fz.cmd_stop, fz.cmd_stop_with_onoff, fz.cmd_move_to_level_with_onoff, fz.generic_battery, fz.ignore_power_change, From 6122de1a760769154bf3adf91024a50c7799285a Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 6 Mar 2019 22:04:22 +0100 Subject: [PATCH 605/676] 7.2.5 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 188c9eca97377..47e4cfe3c63e1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.4", + "version": "7.2.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ac129c5bdb318..ee619b9928e30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.4", + "version": "7.2.5", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From c574deca20ca604852a1d7a976772a30554e9a8d Mon Sep 17 00:00:00 2001 From: Marc Seeger Date: Thu, 7 Mar 2019 07:42:53 -0800 Subject: [PATCH 606/676] Clarify that the GE Link bulb could be BR30 or A19 (#320) I noticed that my A19 GE Link bulbs are sharing the BR30 description. From what I can tell, they both share same model number: https://github.com/Koenkk/zigbee2mqtt/issues/1161 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index a10f40b2b8828..0083033ceda47 100644 --- a/devices.js +++ b/devices.js @@ -1547,7 +1547,7 @@ const devices = [ zigbeeModel: ['ZLL Light'], model: '22670', vendor: 'GE', - description: 'Link smart LED light bulb, BR30 soft white (2700K)', + description: 'Link smart LED light bulb, A19/BR30 soft white (2700K)', extend: generic.light_onoff_brightness, }, { From ed3bb44624672a42ec15dc07c6f3e0c46744dd36 Mon Sep 17 00:00:00 2001 From: highground88 Date: Fri, 8 Mar 2019 02:19:04 +1000 Subject: [PATCH 607/676] Update devices.js for 'FB56+ZSW1HKJ1.7' with new button decriptions (top/bottom) (#321) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 0083033ceda47..0c623632b37da 100644 --- a/devices.js +++ b/devices.js @@ -1718,7 +1718,7 @@ const devices = [ fromZigbee: [fz.generic_state_multi_ep, fz.ignore_onoff_change], toZigbee: [tz.on_off], ep: (device) => { - return {'left': 16, 'right': 17}; + return {'top': 16, 'bottom': 17}; }, configure: (ieeeAddr, shepherd, coordinator, callback) => { const ep16 = shepherd.find(ieeeAddr, 16); From 80d73ab5ea4d3bb03c1bd3eb0732262094f7f007 Mon Sep 17 00:00:00 2001 From: highground88 Date: Fri, 8 Mar 2019 02:24:17 +1000 Subject: [PATCH 608/676] Support for 'FB56+ZSW1IKJ1.7' 3-gang Nue Smart Switch (#319) * Support for 'FB56+ZSW1IKJ1.7' 3-gang Nue Smart Switch Confirmed working, but please check my parentheses etc @Koenkk .... I get double MQTT feedback. It would also be great if you could support 'top' and 'bottom' in https://github.com/Koenkk/zigbee2mqtt/blob/master/lib/extension/devicePublish.js#L8 - is this a possibility? This would make more sense for countries like Australia where switches are mounted vertically, and give the option for the handler to match the local orientation of the device. * Changed FB56+ZSW1IKJ1.7 to include new button descriptors (top/bottom) --- devices.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/devices.js b/devices.js index 0c623632b37da..a19d35a73b021 100644 --- a/devices.js +++ b/devices.js @@ -1700,6 +1700,28 @@ const devices = [ }, // Nue, 3A + { + zigbeeModel: ['FB56+ZSW1IKJ1.7'], + model: 'HGZB-043', + vendor: 'Nue / 3A', + description: 'Smart light switch - 3 gang', + supports: 'on/off', + fromZigbee: [fz.generic_state_multi_ep, fz.ignore_onoff_change], + toZigbee: [tz.on_off], + ep: (device) => { + return {'top': 16, 'center': 17, 'bottom': 18}; + }, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const ep16 = shepherd.find(ieeeAddr, 16); + execute(ep16, [(cb) => ep16.bind('genOnOff', coordinator, cb)], () => { + const ep17 = shepherd.find(ieeeAddr, 17); + execute(ep17, [(cb) => ep17.bind('genOnOff', coordinator, cb)], () => { + const ep18 = shepherd.find(ieeeAddr, 18); + execute(ep18, [(cb) => ep18.bind('genOnOff', coordinator, cb)], callback); + }); + }); + }, + }, { zigbeeModel: ['FB56+ZSC05HG1.0'], model: 'HGZB-04D', From 10db825157592a3af09ad501ddb361e839b29642 Mon Sep 17 00:00:00 2001 From: Gergely Markics <5822419+ugrug@users.noreply.github.com> Date: Thu, 7 Mar 2019 17:43:35 +0100 Subject: [PATCH 609/676] Fix missing converters for philips hue dimmer (#322) * Update devices.js * Update fromZigbee.js * Update devices.js * Update devices.js --- converters/fromZigbee.js | 20 ++++++++++++++++++++ devices.js | 25 +++++++++++++++++++------ 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 0e28f10cce97e..b4d259f35edb1 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2090,6 +2090,26 @@ const converters = { type: 'attReport', convert: (model, msg, publish, options) => null, }, + _324131092621_ignore_on: { + cid: 'genOnOff', + type: 'cmdOn', + convert: (model, msg, publish, options) => null, + }, + _324131092621_ignore_off: { + cid: 'genOnOff', + type: 'cmdOffWithEffect', + convert: (model, msg, publish, options) => null, + }, + _324131092621_ignore_step: { + cid: 'genLevelCtrl', + type: 'cmdStep', + convert: (model, msg, publish, options) => null, + }, + _324131092621_ignore_stop: { + cid: 'genLevelCtrl', + type: 'cmdStop', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; diff --git a/devices.js b/devices.js index a19d35a73b021..0d2306bf5542c 100644 --- a/devices.js +++ b/devices.js @@ -842,19 +842,32 @@ const devices = [ description: 'Hue dimmer switch', supports: 'on/off', fromZigbee: [ - fz._324131092621_notification, + fz._324131092621_ignore_on, fz._324131092621_ignore_off, fz._324131092621_ignore_step, + fz._324131092621_ignore_stop, fz._324131092621_notification, fz.ignore_power_change, fz.hue_battery, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { - const ep2 = shepherd.find(ieeeAddr, 1); + const ep1 = shepherd.find(ieeeAddr, 1); const actions = [ - (cb) => ep2.bind('manuSpecificPhilips', coordinator, cb), - (cb) => ep2.bind('genPowerCfg', coordinator, cb), - (cb) => ep2.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), + (cb) => ep1.bind('genOnOff', coordinator, cb), // cluster 6 + (cb) => ep1.bind('genLevelCtrl', coordinator, cb), // cluster 8 ]; - execute(ep2, actions, callback); + execute(ep1, actions, (result) => { + if (result) { + const ep2 = shepherd.find(ieeeAddr, 2); // ugrug + const actions = [ + (cb) => ep2.bind('manuSpecificPhilips', coordinator, cb), + (cb) => ep2.bind('genPowerCfg', coordinator, cb), + (cb) => ep2.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), + ]; + + execute(ep2, actions, callback); + } else { + callback(result); + } + }); }, }, { From 0170c135dd9c313fef23ca6a5a499ebf39a9eb11 Mon Sep 17 00:00:00 2001 From: Gergely Markics <5822419+ugrug@users.noreply.github.com> Date: Fri, 8 Mar 2019 17:30:22 +0100 Subject: [PATCH 610/676] re-pair fix and add multiple clicks for hue dimmer (#323) * added multiple (single/double etc) click for hue dimmer * fix re-pair issue for hue dimmer * Update devices.js * Update fromZigbee.js * Update fromZigbee.js --- converters/fromZigbee.js | 69 +++++++++++++++++++++++++++++++++------- devices.js | 9 ++++-- 2 files changed, 64 insertions(+), 14 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index b4d259f35edb1..dd75116731855 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1294,7 +1294,22 @@ const converters = { cid: 'manuSpecificPhilips', type: 'cmdHueNotification', convert: (model, msg, publish, options) => { - const payload = {}; + const multiplePressTimeout = options && options.hasOwnProperty('multiple_press_timeout') ? + options.multiple_press_timeout : 0.25; + + const getPayload = function(button, pressType, pressDuration, pressCounter, + brightnessSend, brightnessValue) { + const payLoad = {}; + payLoad['action'] = `${button}-${pressType}`; + payLoad['duration'] = pressDuration / 1000; + if (pressCounter) { + payLoad['counter'] = pressCounter; + } + if (brightnessSend) { + payLoad['brightness'] = store[deviceID].brightnessValue; + } + return payLoad; + }; const deviceID = msg.endpoints[0].device.ieeeAddr; let button = null; @@ -1332,7 +1347,9 @@ const converters = { // Initialize store if (!store[deviceID]) { - store[deviceID] = {pressStart: null, pressType: null}; + store[deviceID] = {pressStart: null, pressType: null, + delayedButton: null, delayedBrightnessSend: null, delayedType: null, + delayedCounter: 0, delayedTimerStart: null, delayedTimer: null}; if (brightnessEnabled) { store[deviceID].brightnessValue = 255; store[deviceID].brightnessSince = null; @@ -1364,19 +1381,49 @@ const converters = { store[deviceID].pressType += '-release'; } } - if (type != 'press') { - const pressDuration = - (store[deviceID].pressType == 'hold' || store[deviceID].pressType == 'hold-release') ? - Date.now() - store[deviceID].pressStart : 0; - payload['action'] = `${button}-${store[deviceID].pressType}`; - payload['duration'] = pressDuration / 1000; - if (brightnessSend) { - payload['brightness'] = store[deviceID].brightnessValue; + if (type == 'press') { + // pressed different button + if (store[deviceID].delayedTimer && (store[deviceID].delayedButton != button)) { + clearTimeout(store[deviceID].delayedTimer); + store[deviceID].delayedTimer = null; + publish(getPayload(store[deviceID].delayedButton, + store[deviceID].delayedType, 0, store[deviceID].delayedCounter, + store[deviceID].delayedBrightnessSend, + store[deviceID].brightnessValue)); + } + } else { + // released after press: start timer + if (store[deviceID].pressType == 'press') { + if (store[deviceID].delayedTimer) { + clearTimeout(store[deviceID].delayedTimer); + store[deviceID].delayedTimer = null; + } else { + store[deviceID].delayedCounter = 0; + } + store[deviceID].delayedButton = button; + store[deviceID].delayedBrightnessSend = brightnessSend; + store[deviceID].delayedType = store[deviceID].pressType; + store[deviceID].delayedCounter++; + store[deviceID].delayedTimerStart = Date.now(); + store[deviceID].delayedTimer = setTimeout(() => { + publish(getPayload(store[deviceID].delayedButton, + store[deviceID].delayedType, 0, store[deviceID].delayedCounter, + store[deviceID].delayedBrightnessSend, + store[deviceID].brightnessValue)); + store[deviceID].delayedTimer = null; + }, multiplePressTimeout * 1000); + } else { + const pressDuration = + (store[deviceID].pressType == 'hold' || store[deviceID].pressType == 'hold-release') ? + Date.now() - store[deviceID].pressStart : 0; + return getPayload(button, + store[deviceID].pressType, pressDuration, null, brightnessSend, + store[deviceID].brightnessValue); } } } - return payload; + return {}; }, }, generic_battery: { diff --git a/devices.js b/devices.js index 0d2306bf5542c..3e4c9a80d5de2 100644 --- a/devices.js +++ b/devices.js @@ -850,14 +850,17 @@ const devices = [ configure: (ieeeAddr, shepherd, coordinator, callback) => { const ep1 = shepherd.find(ieeeAddr, 1); const actions = [ - (cb) => ep1.bind('genOnOff', coordinator, cb), // cluster 6 - (cb) => ep1.bind('genLevelCtrl', coordinator, cb), // cluster 8 + (cb) => ep1.bind('genOnOff', coordinator, cb), + (cb) => ep1.bind('genLevelCtrl', coordinator, cb), ]; execute(ep1, actions, (result) => { if (result) { - const ep2 = shepherd.find(ieeeAddr, 2); // ugrug + const ep2 = shepherd.find(ieeeAddr, 2); const actions = [ + (cb) => ep2.foundation('genBasic', 'write', + [{attrId: 0x0031, dataType: 0x19, attrData: 0x000B}], + {manufSpec: 1, disDefaultRsp: 1, manufCode: 0x100B}, cb), (cb) => ep2.bind('manuSpecificPhilips', coordinator, cb), (cb) => ep2.bind('genPowerCfg', coordinator, cb), (cb) => ep2.report('genPowerCfg', 'batteryPercentageRemaining', 0, 1000, 0, cb), From d923fb1ea5045a07bb9e52f3dee341be09168ac9 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 8 Mar 2019 17:31:50 +0100 Subject: [PATCH 611/676] Fix gledopto converter crash. https://github.com/Koenkk/zigbee2mqtt/issues/1209 --- converters/toZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 765940b084c5e..42cb4d65022fe 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1208,7 +1208,7 @@ const converters = { gledopto_light_onoff_brightness: { key: ['state', 'brightness', 'brightness_percent'], convert: (key, value, message, type, postfix) => { - if (message.hasOwnProperty('transition')) { + if (message && message.hasOwnProperty('transition')) { message.transition = message.transition * 3.3; } From 295109a5be8a80e5465b4a1bd5017d88f0b33711 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 8 Mar 2019 17:32:11 +0100 Subject: [PATCH 612/676] 7.2.6 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 47e4cfe3c63e1..2a1e70bed520f 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.5", + "version": "7.2.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ee619b9928e30..246dc6f4573d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.5", + "version": "7.2.6", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 89527e0c354788d93063ba28321983a2ea22b358 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 9 Mar 2019 16:23:09 +0100 Subject: [PATCH 613/676] Ignore basic dev change for all lights. https://github.com/Koenkk/zigbee2mqtt/issues/1064 --- devices.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/devices.js b/devices.js index 3e4c9a80d5de2..9e335f36a06db 100644 --- a/devices.js +++ b/devices.js @@ -15,13 +15,16 @@ const coordinatorGroup = 99; const generic = { light_onoff_brightness: { supports: 'on/off, brightness', - fromZigbee: [fz.brightness, fz.state_change, fz.state, fz.brightness_report, fz.ignore_genGroups_devChange], + fromZigbee: [ + fz.brightness, fz.state_change, fz.state, fz.brightness_report, + fz.ignore_genGroups_devChange, fz.ignore_basic_change, + ], toZigbee: [tz.light_onoff_brightness, tz.ignore_transition, tz.light_alert], }, light_onoff_brightness_colortemp: { supports: 'on/off, brightness, color temperature', fromZigbee: [ - fz.brightness, fz.color_colortemp, fz.state_change, fz.state, + fz.brightness, fz.color_colortemp, fz.state_change, fz.state, fz.ignore_basic_change, fz.brightness_report, fz.color_colortemp_report, fz.ignore_genGroups_devChange, ], toZigbee: [tz.light_onoff_brightness, tz.light_colortemp, tz.ignore_transition, tz.light_alert], @@ -29,7 +32,7 @@ const generic = { light_onoff_brightness_colorxy: { supports: 'on/off, brightness, color xy', fromZigbee: [ - fz.brightness, fz.color_colortemp, fz.state_change, fz.state, + fz.brightness, fz.color_colortemp, fz.state_change, fz.state, fz.ignore_basic_change, fz.brightness_report, fz.color_colortemp_report, fz.ignore_genGroups_devChange, ], toZigbee: [tz.light_onoff_brightness, tz.light_color, tz.ignore_transition, tz.light_alert], @@ -37,7 +40,7 @@ const generic = { light_onoff_brightness_colortemp_colorxy: { supports: 'on/off, brightness, color temperature, color xy', fromZigbee: [ - fz.brightness, fz.color_colortemp, fz.state_change, fz.state, + fz.brightness, fz.color_colortemp, fz.state_change, fz.state, fz.ignore_basic_change, fz.brightness_report, fz.color_colortemp_report, fz.ignore_genGroups_devChange, ], toZigbee: [ From c844748fb55559a04ff4c513ebc1644b8d2f35af Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 9 Mar 2019 16:40:05 +0100 Subject: [PATCH 614/676] Check if data has currentLevel attribute in brightness converters. https://github.com/Koenkk/zigbee2mqtt/issues/1212 --- converters/fromZigbee.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index dd75116731855..16b6f105d52f9 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -602,7 +602,9 @@ const converters = { cid: 'genLevelCtrl', type: 'devChange', convert: (model, msg, publish, options) => { - return {brightness: msg.data.data['currentLevel']}; + if (msg.data.data.hasOwnProperty('currentLevel')) { + return {brightness: msg.data.data['currentLevel']}; + } }, }, color_colortemp: { @@ -1594,9 +1596,9 @@ const converters = { cid: 'genLevelCtrl', type: 'attReport', convert: (model, msg, publish, options) => { - return { - brightness: msg.data.data['currentLevel'], - }; + if (msg.data.data.hasOwnProperty('currentLevel')) { + return {brightness: msg.data.data['currentLevel']}; + } }, }, smartsense_multi: { From 74b745ad2da8cf56cd9a74b53ee2ef45e87eab7f Mon Sep 17 00:00:00 2001 From: highground88 Date: Sun, 10 Mar 2019 01:55:36 +1000 Subject: [PATCH 615/676] Update devices.js for Nue HGZB-41 (#325) The Nue 1 gang smart switch model 'HGZB-41' identifies as 'FNB56-ZSW01LX2.0', the same as previously listed 'HGZB-42-UK' 2 gang switch. Updated model / description to allow for both. --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 9e335f36a06db..5ebf1ad4699c3 100644 --- a/devices.js +++ b/devices.js @@ -1806,8 +1806,8 @@ const devices = [ }, { zigbeeModel: ['FNB56-ZSW01LX2.0'], - model: 'HGZB-42-UK', - description: 'Zigbee smart switch 2 gang', + model: 'HGZB-42-UK / HGZB-41', + description: 'Zigbee smart switch 1/2 gang', vendor: 'Nue / 3A', supports: 'on/off', fromZigbee: [fz.ignore_onoff_change, fz.state], From 0d8277bc79ed64ba168b10a6671b591d8ebfe000 Mon Sep 17 00:00:00 2001 From: Rene Date: Sat, 9 Mar 2019 15:59:06 +0000 Subject: [PATCH 616/676] add Nyce-3043 and additional Smartthings devices (#324) * add Nyce-3043 and additional Smartthings devices * Update devices.js * Update fromZigbee.js --- converters/fromZigbee.js | 15 ++++++ devices.js | 102 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 16b6f105d52f9..3cddd575f30f7 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2159,6 +2159,21 @@ const converters = { type: 'cmdStop', convert: (model, msg, publish, options) => null, }, + ignore_poll_ctrl: { + cid: 'genPollCtrl', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, + ignore_poll_ctrl_change: { + cid: 'genPollCtrl', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, + ignore_genIdentify_change: { + cid: 'genIdentify', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; diff --git a/devices.js b/devices.js index 5ebf1ad4699c3..73b6128d1d219 100644 --- a/devices.js +++ b/devices.js @@ -2073,6 +2073,82 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['motionv4'], + model: 'STS-IRM-250', + vendor: 'SmartThings', + description: 'Motion sensor (2016 model)', + supports: 'occupancy and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.ias_zone_motion_dev_change, + fz.bosch_ias_zone_motion_status_change, fz.generic_batteryvoltage_3000_2500, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 0, 1000, 0, cb), + ]; + execute(device, actions, callback); + }, + }, + { + zigbeeModel: ['3305-S'], + model: '3305-S', + vendor: 'SmartThings', + description: 'Motion sensor (2014 model)', + supports: 'occupancy and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.ias_zone_motion_dev_change, + fz.ias_zone_motion_status_change, fz.generic_batteryvoltage_3000_2500, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 255}, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 0, 1000, 0, cb), + ]; + execute(device, actions, callback); + }, + }, + { + zigbeeModel: ['3300-S'], + model: '3300-S', + vendor: 'SmartThings', + description: 'Door sensor', + supports: 'contact and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.smartsense_multi, + fz.ias_contact_status_change, fz.ignore_iaszone_change, fz.generic_batteryvoltage_3000_2500, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 300, 600, 1, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 0, 1000, 0, cb), + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.report('ssIasZone', 'zoneStatus', 0, 1000, null, cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', { + enrollrspcode: 1, + zoneid: 255, + }, cb), + ]; + execute(device, actions, callback); + }, + }, // Trust { @@ -2937,6 +3013,32 @@ const devices = [ execute(device, actions, callback); }, }, + + // Nyce + { + zigbeeModel: ['3043'], + model: 'NCZ-3043-HA', + vendor: 'Nyce', + description: 'Motion sensor', + supports: 'motion, humidity and temperature', + fromZigbee: [ + fz.generic_occupancy, fz.xiaomi_humidity, fz.generic_temperature, fz.ignore_basic_report, + fz.ignore_genIdentify, fz.ignore_basic_change, fz.ignore_poll_ctrl, + fz.generic_temperature_change, fz.generic_battery_change, fz.ignore_humidity_change, + fz.ignore_iaszone_change, + fz.ignore_poll_ctrl_change, fz.ignore_genIdentify_change, fz.ignore_iaszone_report, + fz.ias_zone_motion_status_change, fz.generic_battery, fz.generic_battery_change, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 255}, cb), + ]; + execute(device, actions, callback); + }, + }, ]; module.exports = devices.map((device) => From 6343b7e19a5ccf2ac3ed43ba19934feb7b5092c4 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sat, 9 Mar 2019 17:00:00 +0100 Subject: [PATCH 617/676] 7.2.7 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 2a1e70bed520f..e2276dec71a3e 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.6", + "version": "7.2.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 246dc6f4573d4..729f132aa4fbf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.6", + "version": "7.2.7", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From c653ff22f6e5ede1e3d7800becf9cd810508d7bb Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Sat, 9 Mar 2019 21:24:30 +0100 Subject: [PATCH 618/676] Improve AC0251100NJ actions consistency Improve AC0251100NJ actions consistency --- converters/fromZigbee.js | 50 ++++++++++++++++++++++++++++++++++++++++ devices.js | 6 ++--- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3cddd575f30f7..3b9a559a731a9 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1997,6 +1997,56 @@ const converters = { return {pressure: precisionRoundOptions(pressure, options, 'pressure')}; }, }, + AC0251100NJ_on: { + cid: 'genOnOff', + type: 'cmdOn', + convert: (model, msg, publish, options) => { + return {action: 'up'}; + }, + }, + AC0251100NJ_off: { + cid: 'genOnOff', + type: 'cmdOff', + convert: (model, msg, publish, options) => { + return {action: 'down'}; + }, + }, + AC0251100NJ_on_hold: { + cid: 'genLevelCtrl', + type: 'cmdMoveWithOnOff', + convert: (model, msg, publish, options) => { + return {action: 'on_hold'}; + }, + }, + AC0251100NJ_off_hold: { + cid: 'genLevelCtrl', + type: 'cmdMove', + convert: (model, msg, publish, options) => { + return {action: 'off_hold'}; + }, + }, + AC0251100NJ_release: { + cid: 'genLevelCtrl', + type: 'cmdMoveToLevelWithOnOff', + convert: (model, msg, publish, options) => { + return {action: 'circle_press'}; + }, + }, + + AC0251100NJ_circle_release: { + cid: 'lightingColorCtrl', + type: 'cmdMoveHue', + convert: (model, msg, publish, options) => { + return {action: 'circle_hold'}; + }, + }, + AC0251100NJ_circle: { + cid: 'lightingColorCtrl', + type: 'cmdMoveToSaturation', + convert: (model, msg, publish, options) => { + return {action: 'circle_click'}; + }, + }, // Ignore converters (these message dont need parsing). ignore_light_brightness_change: { diff --git a/devices.js b/devices.js index 73b6128d1d219..4352b67c3a670 100644 --- a/devices.js +++ b/devices.js @@ -1237,9 +1237,9 @@ const devices = [ description: 'Smart+ switch mini', supports: 'on/off, brightness', fromZigbee: [ - fz.genOnOff_cmdOn, fz.genOnOff_cmdOff, fz.AC0251100NJ_long_middle, - fz.cmd_stop, fz.cmd_move, fz.cmd_move_with_onoff, - fz.cmd_move_to_level_with_onoff, fz.generic_batteryvoltage_3000_2500, + fz.AC0251100NJ_on, fz.AC0251100NJ_off, fz.AC0251100NJ_on_hold, fz.AC0251100NJ_off_hold, + fz.AC0251100NJ_release, fz.AC0251100NJ_circle, fz.AC0251100NJ_circle_release, + fz.generic_batteryvoltage_3000_2500, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { From 15c9da47c0af420642d49972ac60de4b4f24294d Mon Sep 17 00:00:00 2001 From: Oli <932481+tb-killa@users.noreply.github.com> Date: Sun, 10 Mar 2019 00:24:11 +0100 Subject: [PATCH 619/676] extend E1524 with genPowerCfg reporting (#326) * extend E1524 with genPowerCfg reporting * Add Whitespace to fix failured travis check * Update devices.js * Update devices.js --- devices.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/devices.js b/devices.js index 4352b67c3a670..4cc587ab2622a 100644 --- a/devices.js +++ b/devices.js @@ -608,8 +608,22 @@ const devices = [ fz.cmdToggle, fz.E1524_arrow_click, fz.E1524_arrow_hold, fz.E1524_arrow_release, fz.E1524_brightness_up_click, fz.E1524_brightness_down_click, fz.E1524_brightness_up_hold, fz.E1524_brightness_up_release, fz.E1524_brightness_down_hold, fz.E1524_brightness_down_release, + fz.generic_battery, fz.ignore_power_change, ], toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfg = { + direction: 0, attrId: 33, dataType: 32, minRepIntval: 0, maxRepIntval: repInterval.MAX, repChange: 0, + }; + + const actions = [ + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.foundation('genPowerCfg', 'configReport', [cfg], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['TRADFRI on/off switch'], From 6ea406ca50750f5fce97f6d97c61235d55dec167 Mon Sep 17 00:00:00 2001 From: "pixel::doc" Date: Sun, 10 Mar 2019 08:16:38 +0100 Subject: [PATCH 620/676] Update README.md (#327) Link to zigbee2mqtt. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9cd614d798cbc..86dca24f621a4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ [![NPM](https://nodei.co/npm/zigbee-shepherd-converters.png)](https://nodei.co/npm/zigbee-shepherd-converters/) # zigbee-shepherd-converters -Collection of device converters to be used with zigbee-shepherd +Collection of device converters to be used with zigbee-shepherd. + +Part of https://github.com/Koenkk/zigbee2mqtt . From 22ff992831e095684c3d53b198f9767bc7c1574f Mon Sep 17 00:00:00 2001 From: Oli <932481+tb-killa@users.noreply.github.com> Date: Sun, 10 Mar 2019 13:40:45 +0100 Subject: [PATCH 621/676] Bitron av2010/34 (#328) * AV2010/34 devices.js Part * add AV2010_34_click + generic ignore_power_report * Update devices.js --- converters/fromZigbee.js | 12 ++++++++++++ devices.js | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3b9a559a731a9..3d36d2e23ee40 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -183,6 +183,13 @@ const converters = { return {click: 'long_middle'}; }, }, + AV2010_34_click: { + cid: 'genScenes', + type: 'cmdRecall', + convert: (model, msg, publish, options) => { + return {click: msg.data.data.groupid}; + }, + }, bitron_power: { cid: 'seMetering', type: 'attReport', @@ -2129,6 +2136,11 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_power_report: { + cid: 'genPowerCfg', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, ignore_metering_change: { cid: 'seMetering', type: 'devChange', diff --git a/devices.js b/devices.js index 4cc587ab2622a..d78cfa43ec4ec 100644 --- a/devices.js +++ b/devices.js @@ -2247,6 +2247,22 @@ const devices = [ }, // Bitron + { + zigbeeModel: ['AV2010/34'], + model: 'AV2010/34', + vendor: 'Bitron', + description: '4-Touch single click buttons', + supports: 'click', + fromZigbee: [fz.ignore_power_report, fz.AV2010_34_click], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('genPowerCfg', coordinator, cb), + ]; + execute(device, actions, callback); + }, + }, { zigbeeModel: ['902010/22'], model: 'AV2010/22', From 205e323d470cbcf827cab9e668483c4a5a17be96 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 10 Mar 2019 13:43:49 +0100 Subject: [PATCH 622/676] Add extra guard to xiaomi_contact_interval. https://github.com/Koenkk/zigbee2mqtt/issues/1219 --- converters/fromZigbee.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3d36d2e23ee40..a074f1a164b24 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -602,7 +602,9 @@ const converters = { cid: 'genBasic', type: 'attReport', convert: (model, msg, publish, options) => { - return {contact: msg.data.data['65281']['100'] === 0}; + if (msg.data.data.hasOwnProperty('65281')) { + return {contact: msg.data.data['65281']['100'] === 0}; + } }, }, brightness: { From 58c20a6aa079106e1d215c3251a079fc74ad2260 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 10 Mar 2019 14:05:25 +0100 Subject: [PATCH 623/676] Update dependencies. --- npm-shrinkwrap.json | 60 ++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e2276dec71a3e..93db487d97d75 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -37,9 +37,9 @@ "dev": true }, "ajv": { - "version": "6.9.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz", - "integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -266,9 +266,9 @@ "dev": true }, "camelcase": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.2.0.tgz", + "integrity": "sha512-IXFsBS2pC+X0j0N/GE7Dm7j3bsEBp+oTpb7F50dwEVX7rf3IgwO9XatnegTsDtniKCUtEJH4fSU6Asw7uoVLfQ==", "dev": true }, "chai": { @@ -582,9 +582,9 @@ "dev": true }, "eslint": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.15.0.tgz", - "integrity": "sha512-xwG7SS5JLeqkiR3iOmVgtF8Y6xPdtr6AAsN6ph7Q6R/fv+3UlKYoika8SmNzmb35qdRF+RfTY35kMEdtbi+9wg==", + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.15.1.tgz", + "integrity": "sha512-NTcm6vQ+PTgN3UBsALw5BMhgO6i5EpIjQF/Xb5tIh3sk9QhrFafujUOczGz4J24JBlzWclSB9Vmx8d+9Z6bFCg==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -1248,18 +1248,18 @@ }, "dependencies": { "ansi-regex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", - "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "strip-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", - "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz", + "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==", "dev": true, "requires": { - "ansi-regex": "^4.0.0" + "ansi-regex": "^4.1.0" } } } @@ -1904,9 +1904,9 @@ "dev": true }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -2434,29 +2434,29 @@ }, "dependencies": { "ansi-regex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", - "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "string-width": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.0.0.tgz", - "integrity": "sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.0.0" + "strip-ansi": "^5.1.0" } }, "strip-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", - "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.1.0.tgz", + "integrity": "sha512-TjxrkPONqO2Z8QDCpeE2j6n0M6EwxzyDgzEeGp+FbdvaJAt//ClYi6W5my+3ROlC/hZX2KACUwDfK49Ka5eDvg==", "dev": true, "requires": { - "ansi-regex": "^4.0.0" + "ansi-regex": "^4.1.0" } } } From 5345cff8717005357a1e643dc93bdfff6ddc8d42 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Sun, 10 Mar 2019 14:05:30 +0100 Subject: [PATCH 624/676] 7.2.8 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 93db487d97d75..60211d15a5236 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.7", + "version": "7.2.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 729f132aa4fbf..a5a628483344f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.7", + "version": "7.2.8", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 30474e16588c0608bbf3d5af09ef829805974fc0 Mon Sep 17 00:00:00 2001 From: highground88 Date: Mon, 11 Mar 2019 06:49:19 +1000 Subject: [PATCH 625/676] Update devices.js to support FNB56-ZSW03LX2.0 - Nue 3 gang smart switch v2.0 (#330) * Update devices.js to support FNB56-ZSW03LX2.0 - Nue 3 gang smart switch v2.0 Endpoints changed between versions. Possibly using newer Zigbee protocol now also * Update devices.js --- devices.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/devices.js b/devices.js index d78cfa43ec4ec..a93918f258a73 100644 --- a/devices.js +++ b/devices.js @@ -1733,6 +1733,28 @@ const devices = [ }, // Nue, 3A + { + zigbeeModel: ['FNB56-ZSW03LX2.0'], + model: 'HGZB-43', + vendor: 'Nue / 3A', + description: 'Smart light switch - 3 gang v2.0', + supports: 'on/off', + fromZigbee: [fz.generic_state_multi_ep, fz.ignore_onoff_change], + toZigbee: [tz.on_off], + ep: (device) => { + return {'top': 1, 'center': 2, 'bottom': 3}; + }, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const ep1 = shepherd.find(ieeeAddr, 1); + execute(ep1, [(cb) => ep1.bind('genOnOff', coordinator, cb)], () => { + const ep2 = shepherd.find(ieeeAddr, 2); + execute(ep2, [(cb) => ep2.bind('genOnOff', coordinator, cb)], () => { + const ep3 = shepherd.find(ieeeAddr, 3); + execute(ep3, [(cb) => ep3.bind('genOnOff', coordinator, cb)], callback); + }); + }); + }, + }, { zigbeeModel: ['FB56+ZSW1IKJ1.7'], model: 'HGZB-043', From ab567efc7ce39e1139a9b012e43179a579443600 Mon Sep 17 00:00:00 2001 From: Roger Date: Mon, 11 Mar 2019 12:54:50 -0400 Subject: [PATCH 626/676] Add Securifi Peanut Smart Plug (#331) * Add Securifi Peanut Smart Plug Measurements not supported/tested as they require a firmware upgrade (?). Switch works though. See https://github.com/Koenkk/zigbee2mqtt/issues/809 * Update devices.js --- devices.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/devices.js b/devices.js index a93918f258a73..81900f61d07f2 100644 --- a/devices.js +++ b/devices.js @@ -3091,6 +3091,33 @@ const devices = [ execute(device, actions, callback); }, }, + + // Securifi + { + zigbeeModel: ['PP-WHT-US'], + model: 'PP-WHT-US', + vendor: 'Securifi', + description: 'Peanut Smart Plug', + supports: 'on/off, power measurement', + fromZigbee: [fz.ignore_electrical_change, fz.state, fz.ignore_onoff_change], + toZigbee: [tz.on_off], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const onOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 0, maxRepIntval: 1000, repChange: 0}; + const rmsCurrent = { + direction: 0, attrId: 1288, dataType: 33, minRepIntval: 0, maxRepIntval: 3, repChange: 0, + }; + const electricalCfg = [rmsCurrent]; + const actions = [ + (cb) => device.foundation('genOnOff', 'configReport', [onOff], foundationCfg, cb), + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('haElectricalMeasurement', 'configReport', electricalCfg, foundationCfg, cb), + (cb) => device.bind('haElectricalMeasurement', coordinator, cb), + ]; + + execute(device, actions, callback); + }, + }, ]; module.exports = devices.map((device) => From eb80991451b9fb560ddf771b77e06218409a156d Mon Sep 17 00:00:00 2001 From: highground88 Date: Tue, 12 Mar 2019 02:55:58 +1000 Subject: [PATCH 627/676] Update fromZigbee.js to support Nue Scene Switches (#332) --- converters/fromZigbee.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index a074f1a164b24..cb9c7443d4105 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -285,6 +285,13 @@ const converters = { return result; }, }, + nue_click: { + cid: 'genScenes', + type: 'cmdRecall', + convert: (model, msg, publish, options) => { + return {click: msg.data.data.sceneid}; + }, + }, smartthings_contact: { cid: 'ssIasZone', type: 'statusChange', From 21e49b733351886987e9665b9019ecbe322b9644 Mon Sep 17 00:00:00 2001 From: highground88 Date: Tue, 12 Mar 2019 02:59:40 +1000 Subject: [PATCH 628/676] Add 'FTB56+ZSN15HG1.0' & 'FB56+ZSN08KJ2.3' Nue Scene Switches (#333) * Add 'FTB56+ZSN15HG1.0' & 'FB56+ZSN08KJ2.3' Nue Scene Switches * Update devices.js --- devices.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/devices.js b/devices.js index 81900f61d07f2..8c2f0fcfee8ca 100644 --- a/devices.js +++ b/devices.js @@ -1733,6 +1733,24 @@ const devices = [ }, // Nue, 3A + { + zigbeeModel: ['FTB56+ZSN15HG1.0'], + model: 'HGZB-1S', + vendor: 'Nue / 3A', + description: 'Smart 1 key scene wall switch', + supports: 'on/off, click', + toZigbee: [tz.on_off], + fromZigbee: [fz.nue_click, fz.ignore_power_report, fz.ignore_power_change], + }, + { + zigbeeModel: ['FB56+ZSN08KJ2.3'], + model: 'HGZB-045', + vendor: 'Nue / 3A', + description: 'Smart 4 key scene wall switch', + supports: 'on/off, click', + toZigbee: [tz.on_off], + fromZigbee: [fz.nue_click, fz.ignore_power_report, fz.ignore_power_change], + }, { zigbeeModel: ['FNB56-ZSW03LX2.0'], model: 'HGZB-43', From a0c272657c1f2fd9a94bf28c2dcccd669c084ac8 Mon Sep 17 00:00:00 2001 From: highground88 Date: Tue, 12 Mar 2019 03:03:33 +1000 Subject: [PATCH 629/676] Update devices.js to support FB56+ZSW1HKJ2.5 2 gang Nue smart switch (#334) * Update devices.js to support FB56+ZSW1HKJ2.5 2 gang Nue smart switch This has the same model number HGZB-042 as FB56+ZSW1HKJ1.7 * Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 8c2f0fcfee8ca..c825a3de5770b 100644 --- a/devices.js +++ b/devices.js @@ -1805,7 +1805,7 @@ const devices = [ fromZigbee: [fz.state, fz.ignore_onoff_change, fz.brightness_report, fz.ignore_light_brightness_change], }, { - zigbeeModel: ['FB56+ZSW1HKJ1.7'], + zigbeeModel: ['FB56+ZSW1HKJ1.7', 'FB56+ZSW1HKJ2.5'], model: 'HGZB-042', vendor: 'Nue / 3A', description: 'Smart light switch - 2 gang', From 71749b16b515613bbbc19758395b28ff7557a013 Mon Sep 17 00:00:00 2001 From: jace Date: Mon, 11 Mar 2019 10:36:26 -0700 Subject: [PATCH 630/676] Add support for Visonic MCT-350 contact sensor. (#336) * Add support for Visonic MCT-350 contact sensor. * Update devices.js * Update fromZigbee.js --- converters/fromZigbee.js | 12 ++++++++++++ devices.js | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index cb9c7443d4105..f88b81a2705e7 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2063,6 +2063,18 @@ const converters = { return {action: 'circle_click'}; }, }, + visonic_contact: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.zoneStatus; + return { + contact: !((zoneStatus & 1) > 0), // Bit 1 = Alarm: Contact detection + tamper: (zoneStatus & 1<<2) > 0, // Bit 3 = Tamper status + battery_low: (zoneStatus & 1<<3) > 0, // Bit 4 = Battery LOW indicator + }; + }, + }, // Ignore converters (these message dont need parsing). ignore_light_brightness_change: { diff --git a/devices.js b/devices.js index c825a3de5770b..82892252eed85 100644 --- a/devices.js +++ b/devices.js @@ -3136,6 +3136,17 @@ const devices = [ execute(device, actions, callback); }, }, + + // Visonic + { + zigbeeModel: ['MCT-350 SMA'], + model: 'MCT-350 SMA', + vendor: 'Visonic', + description: 'Magnetic door & window contact sensor', + supports: 'contact', + fromZigbee: [fz.visonic_contact, fz.ignore_power_change], + toZigbee: [], + }, ]; module.exports = devices.map((device) => From ab3723703eb8ea80bf6ff1f9429d99bb3e4f6ea1 Mon Sep 17 00:00:00 2001 From: Frank Wammes Date: Tue, 12 Mar 2019 20:35:53 +0100 Subject: [PATCH 631/676] Add support for OJB-CR701-YZ Gas and CO sensor (#338) * Add statuschange converter for OJB-CR701-YZ * Add OJB-CR701-YZ to devices.js * Fix eslint * amend * fix: Set proper vendor for OJB-CR701-YZ * Update devices.js * Update fromZigbee.js * Update devices.js * Update devices.js * Update fromZigbee.js --- converters/fromZigbee.js | 17 +++++++++++++++++ devices.js | 20 ++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index f88b81a2705e7..e6e379ba73747 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2075,6 +2075,23 @@ const converters = { }; }, }, + OJBCR701YZ_statuschange: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + const {zoneStatus} = msg.data; + return { + carbon_monoxide: (zoneStatus & 1) > 0, // Bit 0 = Alarm 1: Carbon Monoxide (CO) + gas: (zoneStatus & 1 << 1) > 0, // Bit 1 = Alarm 2: Gas (CH4) + tamper: (zoneStatus & 1 << 2) > 0, // Bit 2 = Tamper + battery_low: (zoneStatus & 1 << 3) > 0, // Bit 3 = Low battery alarm + trouble: (zoneStatus & 1 << 6) > 0, // Bit 6 = Trouble/Failure + ac_connected: !((zoneStatus & 1 << 7) > 0), // Bit 7 = AC Connected + test: (zoneStatus & 1 << 8) > 0, // Bit 8 = Self test + battery_defect: (zoneStatus & 1 << 9) > 0, // Bit 9 = Battery Defect + }; + }, + }, // Ignore converters (these message dont need parsing). ignore_light_brightness_change: { diff --git a/devices.js b/devices.js index 82892252eed85..754ca53307995 100644 --- a/devices.js +++ b/devices.js @@ -2639,6 +2639,26 @@ const devices = [ toZigbee: [], }, + // Oujiabao + { + zigbeeModel: ['OJB-CR701-YZ'], + model: 'CR701-YZ', + vendor: 'Oujiabao', + description: 'Gas and carbon monoxide alarm', + supports: 'gas and carbon monoxide', + fromZigbee: [fz.OJBCR701YZ_statuschange], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('ssIasZone', coordinator, cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + ]; + + execute(device, actions, callback, 1000); + }, + }, + // Calex { zigbeeModel: ['EC-Z3.0-CCT '], From c0cad43a998affec537b2e69e4222d45056bbb8d Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 12 Mar 2019 21:41:25 +0100 Subject: [PATCH 632/676] Add more ignore converters. --- converters/fromZigbee.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index e6e379ba73747..3ef586a715b3a 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2134,6 +2134,16 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_illuminance_report: { + cid: 'msIlluminanceMeasurement', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, + ignore_occupancy_report: { + cid: 'msOccupancySensing', + type: 'attReport', + convert: (model, msg, publish, options) => null, + }, ignore_temperature_change: { cid: 'msTemperatureMeasurement', type: 'devChange', From b5d55c05ff0db7b12a6a195b0aad02f5169b7fe7 Mon Sep 17 00:00:00 2001 From: highground88 Date: Thu, 14 Mar 2019 03:54:55 +1000 Subject: [PATCH 633/676] Changed to correct external model details (#335) * Changed to correct external model details * Fix model numbers * Update devices.js --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 754ca53307995..1077820e8cbfc 100644 --- a/devices.js +++ b/devices.js @@ -1825,7 +1825,7 @@ const devices = [ }, { zigbeeModel: ['FB56+ZSW05HG1.2'], - model: 'FB56+ZSW05HG1.2', + model: 'HGZB-01A/02A', vendor: 'Nue / 3A', description: 'ZigBee one gang wall / in-wall smart switch', supports: 'on/off', From d3c6838e5b4c1595b60a4a403d5ca35d51961ef6 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 13 Mar 2019 19:23:39 +0100 Subject: [PATCH 634/676] Allow type to be an array. --- converters/fromZigbee.js | 146 +++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 3ef586a715b3a..bb0e1001932e7 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -136,7 +136,7 @@ const holdUpdateBrightness324131092621 = (deviceID) => { const converters = { YRD426NRSC_lock: { cid: 'closuresDoorLock', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {state: msg.data.data.lockState === 2 ? 'UNLOCK' : 'LOCK'}; }, @@ -192,7 +192,7 @@ const converters = { }, bitron_power: { cid: 'seMetering', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {power: parseFloat(msg.data.data['instantaneousDemand']) / 10.0}; }, @@ -225,7 +225,7 @@ const converters = { }, bitron_battery: { cid: 'genPowerCfg', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const battery = {max: 3200, min: 2500}; const voltage = msg.data.data['batteryVoltage'] * 100; @@ -237,7 +237,7 @@ const converters = { }, bitron_thermostat_att_report: { cid: 'hvacThermostat', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const result = {}; if (typeof msg.data.data['localTemp'] == 'number') { @@ -301,7 +301,7 @@ const converters = { }, xiaomi_battery_3v: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { let voltage = null; @@ -321,7 +321,7 @@ const converters = { }, RTCGQ11LM_interval: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data['65281']) { return {illuminance: msg.data.data['65281']['11']}; @@ -330,7 +330,7 @@ const converters = { }, WSDCGQ01LM_WSDCGQ11LM_interval: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data['65281']) { const temperature = parseFloat(msg.data.data['65281']['100']) / 100.0; @@ -361,7 +361,7 @@ const converters = { }, WXKG01LM_click: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const deviceID = msg.endpoints[0].device.ieeeAddr; const state = msg.data.data['onOff']; @@ -398,7 +398,7 @@ const converters = { }, generic_temperature: { cid: 'msTemperatureMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const temperature = parseFloat(msg.data.data['measuredValue']) / 100.0; return {temperature: precisionRoundOptions(temperature, options, 'temperature')}; @@ -414,7 +414,7 @@ const converters = { }, xiaomi_temperature: { cid: 'msTemperatureMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const temperature = parseFloat(msg.data.data['measuredValue']) / 100.0; @@ -428,7 +428,7 @@ const converters = { }, MFKZQ01LM_action_multistate: { cid: 'genMultistateInput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { /* Source: https://github.com/kirovilya/ioBroker.zigbee @@ -468,7 +468,7 @@ const converters = { }, MFKZQ01LM_action_analog: { cid: 'genAnalogInput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { /* Source: https://github.com/kirovilya/ioBroker.zigbee @@ -483,7 +483,7 @@ const converters = { }, WXKG12LM_action_click_multistate: { cid: 'genMultistateInput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const value = msg.data.data['presentValue']; const lookup = { @@ -499,7 +499,7 @@ const converters = { }, xiaomi_action_click_multistate: { cid: 'genMultistateInput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const value = msg.data.data['presentValue']; const lookup = { @@ -514,7 +514,7 @@ const converters = { }, xiaomi_humidity: { cid: 'msRelativeHumidity', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const humidity = parseFloat(msg.data.data['measuredValue']) / 100.0; @@ -531,7 +531,7 @@ const converters = { // Note: options.occupancy_timeout not available yet, to implement it will be // needed to update device report intervall as well, see devices.js cid: 'msOccupancySensing', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data.occupancy === 0) { return {occupancy: false}; @@ -568,7 +568,7 @@ const converters = { // but do not send a motion stop. // Therefore we need to publish the no_motion detected by ourselves. cid: 'msOccupancySensing', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data.occupancy !== 1) { // In case of 0 no occupancy is reported. @@ -600,14 +600,14 @@ const converters = { }, xiaomi_contact: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {contact: msg.data.data['onOff'] === 0}; }, }, xiaomi_contact_interval: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data.hasOwnProperty('65281')) { return {contact: msg.data.data['65281']['100'] === 0}; @@ -667,7 +667,7 @@ const converters = { }, color_colortemp_report: { cid: 'lightingColorCtrl', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const result = {}; @@ -709,7 +709,7 @@ const converters = { }, WXKG11LM_click: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const data = msg.data.data; let clicks; @@ -727,14 +727,14 @@ const converters = { }, generic_illuminance: { cid: 'msIlluminanceMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {illuminance: msg.data.data['measuredValue']}; }, }, generic_pressure: { cid: 'msPressureMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const pressure = parseFloat(msg.data.data['measuredValue']); return {pressure: precisionRoundOptions(pressure, options, 'pressure')}; @@ -742,7 +742,7 @@ const converters = { }, WXKG02LM_click: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const ep = msg.endpoints[0]; return {click: getKey(model.ep(ep.device), ep.epId)}; @@ -750,7 +750,7 @@ const converters = { }, WXKG02LM_click_multistate: { cid: 'genMultistateInput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const ep = msg.endpoints[0]; const button = getKey(model.ep(ep.device), ep.epId); @@ -771,7 +771,7 @@ const converters = { }, WXKG03LM_click: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {click: 'single'}; }, @@ -785,7 +785,7 @@ const converters = { }, state: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data.hasOwnProperty('onOff')) { return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; @@ -803,14 +803,14 @@ const converters = { }, xiaomi_power: { cid: 'genAnalogInput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {power: precisionRound(msg.data.data['presentValue'], 2)}; }, }, xiaomi_plug_state: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data['65281']) { const data = msg.data.data['65281']; @@ -826,7 +826,7 @@ const converters = { }, xiaomi_bulb_interval: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data['65281']) { const data = msg.data.data['65281']; @@ -840,7 +840,7 @@ const converters = { }, QBKG11LM_power: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data['65281']) { const data = msg.data.data['65281']; @@ -854,7 +854,7 @@ const converters = { }, QBKG12LM_power: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data['65281']) { const data = msg.data.data['65281']; @@ -868,7 +868,7 @@ const converters = { }, QBKG04LM_QBKG11LM_state: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data['61440']) { return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; @@ -894,7 +894,7 @@ const converters = { }, QBKG03LM_QBKG12LM_state: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data['61440']) { const ep = msg.endpoints[0]; @@ -947,7 +947,7 @@ const converters = { }, xiaomi_lock_report: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data['65328']) { const data = msg.data.data['65328']; @@ -995,7 +995,7 @@ const converters = { }, ZNCLDJ11LM_curtain_genAnalogOutput_report: { cid: 'genAnalogOutput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { let running = false; @@ -1027,7 +1027,7 @@ const converters = { }, battery_200: { cid: 'genPowerCfg', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const batt = msg.data.data.batteryPercentageRemaining; const battLow = msg.data.data.batteryAlarmState; @@ -1106,7 +1106,7 @@ const converters = { }, JTQJBF01LMBW_gas_density: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const data = msg.data.data; if (data && data['65281']) { @@ -1140,7 +1140,7 @@ const converters = { }, DJT11LM_vibration: { cid: 'closuresDoorLock', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const result = {}; const vibrationLookup = { @@ -1188,21 +1188,21 @@ const converters = { }, generic_power: { cid: 'seMetering', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {power: precisionRound(msg.data.data['instantaneousDemand'], 2)}; }, }, CC2530ROUTER_state: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {state: msg.data.data['onOff'] === 1}; }, }, CC2530ROUTER_meta: { cid: 'genBinaryValue', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const data = msg.data.data; return { @@ -1214,7 +1214,7 @@ const converters = { }, DNCKAT_S00X_state: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const ep = msg.endpoints[0]; const key = `state_${getKey(model.ep(ep.device), ep.epId)}`; @@ -1236,7 +1236,7 @@ const converters = { }, Z809A_power: { cid: 'haElectricalMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return { power: msg.data.data['activePower'], @@ -1248,7 +1248,7 @@ const converters = { }, SP120_power: { cid: 'haElectricalMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const result = {}; @@ -1269,7 +1269,7 @@ const converters = { }, STS_PRS_251_presence: { cid: 'genBinaryInput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const useOptionsTimeout = options && options.hasOwnProperty('presence_timeout'); const timeout = useOptionsTimeout ? options.presence_timeout : 100; // 100 seconds by default @@ -1291,7 +1291,7 @@ const converters = { }, generic_batteryvoltage_3000_2500: { cid: 'genPowerCfg', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const battery = {max: 3000, min: 2500}; const voltage = msg.data.data['batteryVoltage'] * 100; @@ -1446,7 +1446,7 @@ const converters = { }, generic_battery: { cid: 'genPowerCfg', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data.hasOwnProperty('batteryPercentageRemaining')) { return {battery: msg.data.data['batteryPercentageRemaining']}; @@ -1464,14 +1464,14 @@ const converters = { }, hue_battery: { cid: 'genPowerCfg', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {battery: precisionRound(msg.data.data['batteryPercentageRemaining'], 2) / 2}; }, }, generic_battery_voltage: { cid: 'genPowerCfg', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {voltage: msg.data.data['batteryVoltage'] / 100}; }, @@ -1503,7 +1503,7 @@ const converters = { }, iris_3210L_power: { cid: 'haElectricalMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return {power: msg.data.data['activePower'] / 10.0}; }, @@ -1517,7 +1517,7 @@ const converters = { }, nue_power_state: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const ep = msg.endpoints[0]; const button = getKey(model.ep(ep.device), ep.epId); @@ -1530,7 +1530,7 @@ const converters = { }, generic_state_multi_ep: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const ep = msg.endpoints[0]; const key = `state_${getKey(model.ep(ep.device), ep.epId)}`; @@ -1541,7 +1541,7 @@ const converters = { }, RZHAC_4256251_power: { cid: 'haElectricalMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { return { power: msg.data.data['activePower'], @@ -1610,7 +1610,7 @@ const converters = { }, brightness_report: { cid: 'genLevelCtrl', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { if (msg.data.data.hasOwnProperty('currentLevel')) { return {brightness: msg.data.data['currentLevel']}; @@ -1619,7 +1619,7 @@ const converters = { }, smartsense_multi: { cid: 'ssIasZone', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const zoneStatus = msg.data.data.zoneStatus; return { @@ -1690,7 +1690,7 @@ const converters = { }, thermostat_att_report: { cid: 'hvacThermostat', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const result = {}; if (typeof msg.data.data['localTemp'] == 'number') { @@ -1987,7 +1987,7 @@ const converters = { }, cover_position_report: { cid: 'genLevelCtrl', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { const currentLevel = msg.data.data['currentLevel']; const position = Math.round(Number(currentLevel) / 2.55).toString(); @@ -2006,7 +2006,7 @@ const converters = { }, keen_home_smart_vent_pressure_report: { cid: 'msPressureMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => { // '{"cid":"msPressureMeasurement","data":{"32":990494}}' const pressure = parseFloat(msg.data.data['32']) / 1000.0; @@ -2111,7 +2111,7 @@ const converters = { }, ignore_onoff_report: { cid: 'genOnOff', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_basic_change: { @@ -2121,7 +2121,7 @@ const converters = { }, ignore_basic_report: { cid: 'genBasic', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_illuminance_change: { @@ -2136,12 +2136,12 @@ const converters = { }, ignore_illuminance_report: { cid: 'msIlluminanceMeasurement', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_occupancy_report: { cid: 'msOccupancySensing', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_temperature_change: { @@ -2166,12 +2166,12 @@ const converters = { }, ignore_analog_report: { cid: 'genAnalogInput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_multistate_report: { cid: 'genMultistateInput', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_multistate_change: { @@ -2186,7 +2186,7 @@ const converters = { }, ignore_power_report: { cid: 'genPowerCfg', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_metering_change: { @@ -2201,12 +2201,12 @@ const converters = { }, ignore_light_brightness_report: { cid: 'genLevelCtrl', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_light_color_colortemp_report: { cid: 'lightingColorCtrl', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_closuresWindowCovering_change: { @@ -2216,7 +2216,7 @@ const converters = { }, ignore_closuresWindowCovering_report: { cid: 'closuresWindowCovering', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_thermostat_change: { @@ -2226,7 +2226,7 @@ const converters = { }, ignore_thermostat_report: { cid: 'hvacThermostat', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_genGroups_devChange: { @@ -2241,12 +2241,12 @@ const converters = { }, ignore_iaszone_report: { cid: 'ssIasZone', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_genIdentify: { cid: 'genIdentify', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, _324131092621_ignore_on: { @@ -2271,7 +2271,7 @@ const converters = { }, ignore_poll_ctrl: { cid: 'genPollCtrl', - type: 'attReport', + type: ['attReport', 'readRsp'], convert: (model, msg, publish, options) => null, }, ignore_poll_ctrl_change: { From 0151dde810092b50d4220c36bf900cef86c7b826 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 13 Mar 2019 19:23:47 +0100 Subject: [PATCH 635/676] 8.0.0 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 60211d15a5236..e758cb5fe66d3 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.8", + "version": "8.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a5a628483344f..6b34f1e872ec0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "7.2.8", + "version": "8.0.0", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From a54dfe45436860c4de37e03d1db8b2e02e37d9a0 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 13 Mar 2019 19:45:16 +0100 Subject: [PATCH 636/676] =?UTF-8?q?Don=E2=80=99t=20convert=20readRsp=20for?= =?UTF-8?q?=20ZNLDP12LM.=20https://github.com/Koenkk/zigbee2mqtt/issues/12?= =?UTF-8?q?40?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- converters/fromZigbee.js | 9 +++++++++ devices.js | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index bb0e1001932e7..a4b7e6e081138 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -792,6 +792,15 @@ const converters = { } }, }, + state_report: { + cid: 'genOnOff', + type: 'attReport', + convert: (model, msg, publish, options) => { + if (msg.data.data.hasOwnProperty('onOff')) { + return {state: msg.data.data['onOff'] === 1 ? 'ON' : 'OFF'}; + } + }, + }, state_change: { cid: 'genOnOff', type: 'devChange', diff --git a/devices.js b/devices.js index 1077820e8cbfc..3039b44c5257f 100644 --- a/devices.js +++ b/devices.js @@ -142,7 +142,7 @@ const devices = [ description: 'Aqara smart LED bulb', extend: generic.light_onoff_brightness_colortemp, fromZigbee: [ - fz.brightness, fz.color_colortemp, fz.state, fz.xiaomi_bulb_interval, + fz.brightness, fz.color_colortemp, fz.state_report, fz.xiaomi_bulb_interval, fz.ignore_light_brightness_report, fz.ignore_light_color_colortemp_report, fz.ignore_onoff_change, fz.ignore_basic_change, ], From 71ac600a549148dbbf03434ed33288d0dea432df Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 13 Mar 2019 19:45:29 +0100 Subject: [PATCH 637/676] 8.0.1 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index e758cb5fe66d3..8230ac92a1e08 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "8.0.0", + "version": "8.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6b34f1e872ec0..ff41ec8c01b34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "8.0.0", + "version": "8.0.1", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 0420989c197a8afd06984d8b3c1d16a296b7a176 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 13 Mar 2019 19:50:41 +0100 Subject: [PATCH 638/676] Add alias for 4058075036185. https://github.com/Koenkk/zigbee2mqtt/issues/1245 --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 3039b44c5257f..0d7f9ead6bd35 100644 --- a/devices.js +++ b/devices.js @@ -1186,7 +1186,7 @@ const devices = [ extend: generic.light_onoff_brightness_colortemp_colorxy, }, { - zigbeeModel: ['LIGHTIFY Outdoor Flex RGBW'], + zigbeeModel: ['LIGHTIFY Outdoor Flex RGBW', 'LIGHTIFY FLEX OUTDOOR RGBW'], model: '4058075036185', vendor: 'OSRAM', description: 'Outdoor Flex RGBW', From 392a017843b7ba94e6496319d7b7c718ee7965e2 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 13 Mar 2019 19:58:33 +0100 Subject: [PATCH 639/676] Ignore false ZNCZ02LM and ZNLDP12LM messages. --- converters/fromZigbee.js | 15 +++++++++++++++ devices.js | 8 ++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index a4b7e6e081138..1aa64ba9b2309 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2158,16 +2158,31 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_temperature_report: { + cid: 'msTemperatureMeasurement', + type: ['attReport', 'readRsp'], + convert: (model, msg, publish, options) => null, + }, ignore_humidity_change: { cid: 'msRelativeHumidity', type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_humidity_report: { + cid: 'msRelativeHumidity', + type: ['attReport', 'readRsp'], + convert: (model, msg, publish, options) => null, + }, ignore_pressure_change: { cid: 'msPressureMeasurement', type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_pressure_report: { + cid: 'msPressureMeasurement', + type: ['attReport', 'readRsp'], + convert: (model, msg, publish, options) => null, + }, ignore_analog_change: { cid: 'genAnalogInput', type: 'devChange', diff --git a/devices.js b/devices.js index 0d7f9ead6bd35..2ead222dcc1b8 100644 --- a/devices.js +++ b/devices.js @@ -144,7 +144,9 @@ const devices = [ fromZigbee: [ fz.brightness, fz.color_colortemp, fz.state_report, fz.xiaomi_bulb_interval, fz.ignore_light_brightness_report, fz.ignore_light_color_colortemp_report, fz.ignore_onoff_change, - fz.ignore_basic_change, + fz.ignore_basic_change, fz.ignore_occupancy_report, fz.ignore_temperature_change, + fz.ignore_humidity_change, fz.ignore_pressure_change, fz.ignore_humidity_report, + fz.ignore_pressure_report, fz.ignore_temperature_report, ], }, { @@ -361,7 +363,9 @@ const devices = [ vendor: 'Xiaomi', fromZigbee: [ fz.state, fz.xiaomi_power, fz.xiaomi_plug_state, fz.ignore_onoff_change, - fz.ignore_basic_change, fz.ignore_analog_change, + fz.ignore_basic_change, fz.ignore_analog_change, fz.ignore_occupancy_report, + fz.ignore_illuminance_report, fz.ignore_temperature_change, + fz.ignore_humidity_change, fz.ignore_pressure_change, ], toZigbee: [tz.on_off], }, From d202a40ec88f51faff871e3574bfca28210448d5 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Wed, 13 Mar 2019 19:59:09 +0100 Subject: [PATCH 640/676] 8.0.2 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 8230ac92a1e08..fcf25ab9c2bb1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "8.0.1", + "version": "8.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ff41ec8c01b34..f11b23b59b8e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "8.0.1", + "version": "8.0.2", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From d5dbc78bff02adc8484725d225f4b2222718feab Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 1 Jan 2019 15:47:32 -0600 Subject: [PATCH 641/676] Add support for Sengled E12-N14 (BR30) Light --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index 2ead222dcc1b8..1ea6405583ab5 100644 --- a/devices.js +++ b/devices.js @@ -1695,6 +1695,15 @@ const devices = [ description: 'Element downlight smart LED bulb', extend: generic.light_onoff_brightness, }, + { + zigbeeModel: ['E12-N14'], + model: 'E12-N14', + vendor: 'Sengled', + description: 'Element Classic (BR30)', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, // JIAWEN { From 951067230668fc6fe0793c984811e62838a1507f Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 12 Feb 2019 19:22:47 +0100 Subject: [PATCH 642/676] Update devices.js --- devices.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/devices.js b/devices.js index 1ea6405583ab5..2ead222dcc1b8 100644 --- a/devices.js +++ b/devices.js @@ -1695,15 +1695,6 @@ const devices = [ description: 'Element downlight smart LED bulb', extend: generic.light_onoff_brightness, }, - { - zigbeeModel: ['E12-N14'], - model: 'E12-N14', - vendor: 'Sengled', - description: 'Element Classic (BR30)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, - }, // JIAWEN { From 88819ea9443f7f3fc415a1deb432aa34b7ce8917 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 14 Mar 2019 01:38:40 -0500 Subject: [PATCH 643/676] Add Support SwannOne Key Fob SWO-KEF1PA --- converters/fromZigbee.js | 20 ++++++++++++++++++++ devices.js | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 1aa64ba9b2309..ffe7b4a59cae7 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -776,6 +776,26 @@ const converters = { return {click: 'single'}; }, }, + KEF1PA_arm: { + cid: 'ssIasAce', + type: 'cmdArm', + convert: (model, msg, publish, options) => { + const value = msg.data.data['armmode']; + const modeLookup = { + 0: 'home', + 2: 'night', + 3: 'away', + }; + return { armmode : modeLookup[value] }; + }, + }, + KEF1PA_panic: { + cid: 'ssIasAce', + type: 'cmdPanic', + convert: (model, msg, publish, options) => { + return { armmode : 'panic' }; + }, + }, SJCGQ11LM_water_leak_iaszone: { cid: 'ssIasZone', type: 'statusChange', diff --git a/devices.js b/devices.js index 2ead222dcc1b8..fcf372968ddb6 100644 --- a/devices.js +++ b/devices.js @@ -1696,6 +1696,26 @@ const devices = [ extend: generic.light_onoff_brightness, }, + // SwannOne + { + zigbeeModel: ['SWO-KEF1PA'], + model: 'SWO-KEF1PA', + vendor: 'SwannONe', + description: 'Key Fob Remote', + supports: 'panic, home, away, night', + fromZigbee: [fz.KEF1PA_arm, fz.KEF1PA_panic], + toZigbee: [tz.factory_reset], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('ssIasZone', coordinator, cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + ]; + + execute(device, actions, callback, 250); + }, + }, + // JIAWEN { zigbeeModel: ['FB56-ZCW08KU1.1'], From b6186d7e0ce544cd2dcb798e482dc36781243954 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 14 Mar 2019 02:21:04 -0500 Subject: [PATCH 644/676] Modify payload to be more compatible with Home Assistant --- converters/fromZigbee.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index ffe7b4a59cae7..b39561d4e89a0 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -780,20 +780,22 @@ const converters = { cid: 'ssIasAce', type: 'cmdArm', convert: (model, msg, publish, options) => { - const value = msg.data.data['armmode']; + const action = msg.data.data['armmode']; + delete msg.data.data['armmode']; const modeLookup = { 0: 'home', - 2: 'night', + 2: 'sleep', 3: 'away', }; - return { armmode : modeLookup[value] }; + return { action : modeLookup[action] }; }, }, KEF1PA_panic: { cid: 'ssIasAce', type: 'cmdPanic', convert: (model, msg, publish, options) => { - return { armmode : 'panic' }; + delete msg.data.data['armmode']; + return { action : 'panic' }; }, }, SJCGQ11LM_water_leak_iaszone: { From 73c657121adc287b8951be7ef48afcb9adc5df64 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 1 Jan 2019 15:47:32 -0600 Subject: [PATCH 645/676] Add support for Sengled E12-N14 (BR30) Light --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index fcf372968ddb6..608cc794ac7ac 100644 --- a/devices.js +++ b/devices.js @@ -1695,6 +1695,15 @@ const devices = [ description: 'Element downlight smart LED bulb', extend: generic.light_onoff_brightness, }, + { + zigbeeModel: ['E12-N14'], + model: 'E12-N14', + vendor: 'Sengled', + description: 'Element Classic (BR30)', + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee, + toZigbee: generic.light_onoff_brightness.toZigbee, + }, // SwannOne { From 79c520925d6c6b91fa4fcae7054f02d806bf6fa8 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Tue, 12 Feb 2019 19:22:47 +0100 Subject: [PATCH 646/676] Update devices.js --- devices.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/devices.js b/devices.js index 608cc794ac7ac..fcf372968ddb6 100644 --- a/devices.js +++ b/devices.js @@ -1695,15 +1695,6 @@ const devices = [ description: 'Element downlight smart LED bulb', extend: generic.light_onoff_brightness, }, - { - zigbeeModel: ['E12-N14'], - model: 'E12-N14', - vendor: 'Sengled', - description: 'Element Classic (BR30)', - supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee, - toZigbee: generic.light_onoff_brightness.toZigbee, - }, // SwannOne { From 6b9450331b3bb385e44171e3667fcdd93edfb974 Mon Sep 17 00:00:00 2001 From: arteck <6681528+arteck@users.noreply.github.com> Date: Thu, 14 Mar 2019 18:33:24 +0100 Subject: [PATCH 647/676] Sunricher (#340) * Sunricher * Update devices.js --- devices.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/devices.js b/devices.js index fcf372968ddb6..314fd9f89c3d6 100644 --- a/devices.js +++ b/devices.js @@ -3191,6 +3191,15 @@ const devices = [ fromZigbee: [fz.visonic_contact, fz.ignore_power_change], toZigbee: [], }, + + // Sunricher + { + zigbeeModel: ['ZG9101SAC-HP'], + model: 'ZG9101SAC-HP', + vendor: 'Sunricher', + description: 'ZigBee AC phase-cut dimmer', + extend: generic.light_onoff_brightness, + }, ]; module.exports = devices.map((device) => From 11db5f630d5f35bc231c9290283d34a86420c0a4 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Thu, 14 Mar 2019 18:34:17 +0100 Subject: [PATCH 648/676] Update devices.js (#341) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 314fd9f89c3d6..737e380dc4cce 100644 --- a/devices.js +++ b/devices.js @@ -1997,7 +1997,7 @@ const devices = [ }, }, { - zigbeeModel: ['GL-D-003Z'], + zigbeeModel: ['GL-D-003Z', 'GL-D-005Z'], model: 'GL-D-003Z', vendor: 'Gledopto', description: 'LED RGB + CCT downlight ', From e63294aef2d911852a519a3ec91da0160f710f96 Mon Sep 17 00:00:00 2001 From: Hai Phan Date: Fri, 15 Mar 2019 00:36:34 +0700 Subject: [PATCH 649/676] Adding `wireless mode` support for Xiaomi Switches QBKB11LM/QBKG12LM (#342) * Update fromZigbee.js rename methods for xiaomi aqara switch wireless mode * Update devices.js wireless mode for aqara wired switches * Update devices.js --- converters/fromZigbee.js | 4 ++-- devices.js | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index b39561d4e89a0..44edb7f204c60 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -908,7 +908,7 @@ const converters = { } }, }, - QBKG04LM_operation_mode: { + QBKG04LM_QBKG11LM_operation_mode: { cid: 'genBasic', type: 'devChange', convert: (model, msg, publish, options) => { @@ -953,7 +953,7 @@ const converters = { } }, }, - QBKG03LM_operation_mode: { + QBKG03LM_QBKG12LM_operation_mode: { cid: 'genBasic', type: 'devChange', convert: (model, msg, publish, options) => { diff --git a/devices.js b/devices.js index 737e380dc4cce..58de024a24073 100644 --- a/devices.js +++ b/devices.js @@ -216,7 +216,8 @@ const devices = [ description: 'Aqara single key wired wall switch', supports: 'on/off', fromZigbee: [ - fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change, fz.QBKG04LM_operation_mode, fz.ignore_basic_report, + fz.QBKG04LM_QBKG11LM_state, fz.ignore_onoff_change, + fz.QBKG04LM_QBKG11LM_operation_mode, fz.ignore_basic_report, ], toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode], ep: (device) => { @@ -230,10 +231,11 @@ const devices = [ description: 'Aqara single key wired wall switch', supports: 'on/off, power measurement', fromZigbee: [ - fz.QBKG04LM_QBKG11LM_state, fz.QBKG11LM_power, fz.ignore_onoff_change, fz.ignore_basic_change, + fz.QBKG04LM_QBKG11LM_state, fz.QBKG11LM_power, fz.QBKG04LM_QBKG11LM_operation_mode, + fz.ignore_onoff_change, fz.ignore_basic_change, fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_analog_change, fz.xiaomi_power, ], - toZigbee: [tz.on_off], + toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode], }, { zigbeeModel: ['lumi.ctrl_neutral2'], @@ -242,7 +244,8 @@ const devices = [ description: 'Aqara double key wired wall switch', supports: 'release/hold, on/off', fromZigbee: [ - fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons, fz.QBKG03LM_operation_mode, fz.ignore_basic_report, + fz.QBKG03LM_QBKG12LM_state, fz.QBKG03LM_buttons, + fz.QBKG03LM_QBKG12LM_operation_mode, fz.ignore_basic_report, ], toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode], ep: (device) => { @@ -256,10 +259,11 @@ const devices = [ description: 'Aqara double key wired wall switch', supports: 'on/off, power measurement', fromZigbee: [ - fz.QBKG03LM_QBKG12LM_state, fz.QBKG12LM_power, fz.ignore_analog_change, fz.ignore_basic_change, + fz.QBKG03LM_QBKG12LM_state, fz.QBKG12LM_power, fz.QBKG03LM_QBKG12LM_operation_mode, + fz.ignore_analog_change, fz.ignore_basic_change, fz.ignore_multistate_report, fz.ignore_multistate_change, fz.ignore_onoff_change, fz.xiaomi_power, ], - toZigbee: [tz.on_off], + toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode], ep: (device) => { return {'left': 1, 'right': 2}; }, From b08d92b3625add62bd5c33f5ab6bca16519e69da Mon Sep 17 00:00:00 2001 From: highground88 Date: Sat, 16 Mar 2019 03:17:25 +1000 Subject: [PATCH 650/676] Add 2 additional Nue models FB56+ZSW1GKJ2.5 & FTB56+ZSN16HG1.0 (#348) Again .. another overlap of model but with different Zigbee ID. Entered differently per device. Tidied up descriptions further. --- devices.js | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/devices.js b/devices.js index 58de024a24073..817d08af7033e 100644 --- a/devices.js +++ b/devices.js @@ -1770,6 +1770,15 @@ const devices = [ toZigbee: [tz.on_off], fromZigbee: [fz.nue_click, fz.ignore_power_report, fz.ignore_power_change], }, + { + zigbeeModel: ['FTB56+ZSN16HG1.0'], + model: 'HGZB-02S', + vendor: 'Nue / 3A', + description: 'Smart 2 key scene wall switch', + supports: 'on/off, click', + toZigbee: [tz.on_off], + fromZigbee: [fz.nue_click, fz.ignore_power_report, fz.ignore_power_change], + }, { zigbeeModel: ['FB56+ZSN08KJ2.3'], model: 'HGZB-045', @@ -1827,7 +1836,7 @@ const devices = [ zigbeeModel: ['FB56+ZSC05HG1.0'], model: 'HGZB-04D', vendor: 'Nue / 3A', - description: 'ZigBee smart dimmer wall switch', + description: 'Smart dimmer wall switch', supports: 'on/off, brightness', toZigbee: [tz.on_off, tz.light_brightness], fromZigbee: [fz.state, fz.ignore_onoff_change, fz.brightness_report, fz.ignore_light_brightness_change], @@ -1855,7 +1864,16 @@ const devices = [ zigbeeModel: ['FB56+ZSW05HG1.2'], model: 'HGZB-01A/02A', vendor: 'Nue / 3A', - description: 'ZigBee one gang wall / in-wall smart switch', + description: 'Smart 1 gang wall or in-wall switch', + supports: 'on/off', + fromZigbee: [fz.state, fz.ignore_onoff_change], + toZigbee: [tz.on_off], + }, + { + zigbeeModel: ['FB56+ZSW1GKJ2.5'], + model: 'HGZB-41', + vendor: 'Nue / 3A', + description: 'Smart one gang wall switch', supports: 'on/off', fromZigbee: [fz.state, fz.ignore_onoff_change], toZigbee: [tz.on_off], @@ -1864,7 +1882,7 @@ const devices = [ zigbeeModel: ['FNB56-SKT1DHG1.4'], model: 'MG-AUWS01', vendor: 'Nue / 3A', - description: 'ZigBee Double GPO', + description: 'Smart Double GPO', supports: 'on/off', fromZigbee: [fz.nue_power_state, fz.ignore_onoff_change], toZigbee: [tz.on_off], @@ -1876,20 +1894,20 @@ const devices = [ zigbeeModel: ['FNB56-ZSW23HG1.1'], model: 'HGZB-01A', vendor: 'Nue / 3A', - description: 'ZigBee smart light controller', + description: 'Smart light controller', extend: generic.light_onoff_brightness, }, { zigbeeModel: ['FNB56-ZSC01LX1.2'], model: 'HGZB-02A', vendor: 'Nue / 3A', - description: 'ZigBee smart light controller', + description: 'Smart light controller', extend: generic.light_onoff_brightness, }, { zigbeeModel: ['FNB56-ZSW01LX2.0'], model: 'HGZB-42-UK / HGZB-41', - description: 'Zigbee smart switch 1/2 gang', + description: 'Smart switch 1 or 2 gang', vendor: 'Nue / 3A', supports: 'on/off', fromZigbee: [fz.ignore_onoff_change, fz.state], From 903ed8cf0a6e96206cbb30d8c513792a790e2033 Mon Sep 17 00:00:00 2001 From: Rene Date: Fri, 15 Mar 2019 18:41:12 +0100 Subject: [PATCH 651/676] Added Smartthings devices (#344) * add Nyce-3043 and additional Smartthings devices * Update devices.js * Update fromZigbee.js * additional Smartthings devices * added converters * updated 3315-S * added st_leak_change * updated 3305-S, ignore change on genpower * Update devices.js * Update devices.js * Update devices.js * Update fromZigbee.js --- converters/fromZigbee.js | 31 +++++++++++++++ devices.js | 82 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 112 insertions(+), 1 deletion(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 44edb7f204c60..06dd3386d0223 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -1659,6 +1659,37 @@ const converters = { }; }, }, + st_leak: { + cid: 'ssIasZone', + type: 'attReport', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.data.zoneStatus; + return { + water_leak: (zoneStatus & 1) > 0, // Bit 1 = wet + }; + }, + }, + st_leak_change: { + cid: 'ssIasZone', + type: 'devChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.data.zoneStatus; + return { + water_leak: (zoneStatus & 1) > 0, // Bit 1 = wet + }; + }, + }, + st_contact_status_change: { + cid: 'ssIasZone', + type: 'statusChange', + convert: (model, msg, publish, options) => { + const zoneStatus = msg.data.zoneStatus; + return { + contact: !((zoneStatus & 1) > 0), // Bit 0 = Alarm: Contact detection + battery_low: (zoneStatus & 1<<3) > 0, // Bit 3 = Battery LOW indicator + }; + }, + }, thermostat_dev_change: { cid: 'hvacThermostat', type: 'devChange', diff --git a/devices.js b/devices.js index 817d08af7033e..61f3dd99aa3bd 100644 --- a/devices.js +++ b/devices.js @@ -2205,7 +2205,7 @@ const devices = [ supports: 'occupancy and temperature', fromZigbee: [ fz.generic_temperature, fz.ignore_temperature_change, fz.ias_zone_motion_dev_change, - fz.ias_zone_motion_status_change, fz.generic_batteryvoltage_3000_2500, + fz.ias_zone_motion_status_change, fz.generic_batteryvoltage_3000_2500, fz.ignore_power_change, ], toZigbee: [], configure: (ieeeAddr, shepherd, coordinator, callback) => { @@ -2249,6 +2249,86 @@ const devices = [ execute(device, actions, callback); }, }, + { + zigbeeModel: ['multiv4'], + model: 'F-MLT-US-2', + vendor: 'SmartThings', + description: 'Multipurpose sensor (2016 model)', + supports: 'contact', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.st_contact_status_change, + fz.generic_batteryvoltage_3000_2500, fz.ias_contact_dev_change, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', {enrollrspcode: 0, zoneid: 23}, cb), + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 30, 600, 1, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 0, 1000, 0, cb), + ]; + execute(device, actions, callback); + }, + }, + { + /** + * Note: humidity not (yet) implemented, as this seems to use proprietary cluster + * see Smartthings device handler (profileID: 0x9194, clusterId: 0xFC45 + * https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/861ec6b88eb45273e341436a23d35274dc367c3b/ + * devicetypes/smartthings/smartsense-temp-humidity-sensor.src/smartsense-temp-humidity-sensor.groovy#L153-L156 + */ + zigbeeModel: ['3310-S'], + model: '3310-S', + vendor: 'SmartThings', + description: 'Temperature and humidity sensor', + supports: 'temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, + fz.generic_batteryvoltage_3000_2500, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 150, 300, 0.5, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 0, 1000, 0, cb), + ]; + execute(device, actions, callback); + }, + }, + { + zigbeeModel: ['3315-S'], + model: '3315-S', + vendor: 'SmartThings', + description: 'Water sensor', + supports: 'water and temperature', + fromZigbee: [ + fz.generic_temperature, fz.ignore_temperature_change, fz.ignore_power_change, + fz.st_leak, fz.st_leak_change, fz.generic_batteryvoltage_3000_2500, + ], + toZigbee: [], + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const actions = [ + (cb) => device.bind('msTemperatureMeasurement', coordinator, cb), + (cb) => device.report('msTemperatureMeasurement', 'measuredValue', 300, 600, 1, cb), + (cb) => device.bind('genPowerCfg', coordinator, cb), + (cb) => device.report('genPowerCfg', 'batteryVoltage', 0, 1000, 0, cb), + (cb) => device.write('ssIasZone', 'iasCieAddr', coordinator.device.getIeeeAddr(), cb), + (cb) => device.report('ssIasZone', 'zoneStatus', 0, 1000, null, cb), + (cb) => device.functional('ssIasZone', 'enrollRsp', { + enrollrspcode: 1, + zoneid: 255, + }, cb), + ]; + execute(device, actions, callback); + }, + }, // Trust { From a3caa45b21da8bee298b3c6391dbe3ea3e8e4d20 Mon Sep 17 00:00:00 2001 From: qosmio Date: Fri, 15 Mar 2019 13:14:59 -0500 Subject: [PATCH 652/676] Add Support SwannOne Key Fob SWO-KEF1PA (#346) * Add support for Sengled E12-N14 (BR30) Light * Add Osram BR30 RGBW LED to HA * Update devices.js * Add Support SwannOne Key Fob SWO-KEF1PA * Modify payload to be more compatible with Home Assistant * Update devices.js * Update fromZigbee.js * Update fromZigbee.js --- converters/fromZigbee.js | 4 ++-- devices.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 06dd3386d0223..d3e609bbd1614 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -787,7 +787,7 @@ const converters = { 2: 'sleep', 3: 'away', }; - return { action : modeLookup[action] }; + return {action: modeLookup[action]}; }, }, KEF1PA_panic: { @@ -795,7 +795,7 @@ const converters = { type: 'cmdPanic', convert: (model, msg, publish, options) => { delete msg.data.data['armmode']; - return { action : 'panic' }; + return {action: 'panic'}; }, }, SJCGQ11LM_water_leak_iaszone: { diff --git a/devices.js b/devices.js index 61f3dd99aa3bd..287839576c799 100644 --- a/devices.js +++ b/devices.js @@ -1700,13 +1700,13 @@ const devices = [ extend: generic.light_onoff_brightness, }, - // SwannOne + // Swann { zigbeeModel: ['SWO-KEF1PA'], model: 'SWO-KEF1PA', - vendor: 'SwannONe', - description: 'Key Fob Remote', - supports: 'panic, home, away, night', + vendor: 'Swann', + description: 'Key fob remote', + supports: 'panic, home, away, sleep', fromZigbee: [fz.KEF1PA_arm, fz.KEF1PA_panic], toZigbee: [tz.factory_reset], configure: (ieeeAddr, shepherd, coordinator, callback) => { From 013599c6dd34717f1ae6098789c9300d9eb3260e Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 15 Mar 2019 19:15:23 +0100 Subject: [PATCH 653/676] 8.0.3 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index fcf25ab9c2bb1..a80825c1b1686 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "8.0.2", + "version": "8.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f11b23b59b8e3..748a26f55808e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "8.0.2", + "version": "8.0.3", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 19d88d404bb0afa28b84e58aaefc4fc719416b82 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Fri, 15 Mar 2019 16:11:52 -0500 Subject: [PATCH 654/676] Add converters for ignoring 'diagnostic' and 'genscenes' dev changes --- converters/fromZigbee.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index d3e609bbd1614..453c0fb801315 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2361,6 +2361,16 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_diagnostic_change: { + cid: 'haDiagnostic', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, + ignore_genscenes_change: { + cid: 'genScenes', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; From 375ebe7cda5ca7fed80f85cbacb0f4468a208435 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 15 Mar 2019 23:19:58 +0100 Subject: [PATCH 655/676] Implement no_occupancy_since for RTCGQ01LM and RTCGQ11LM. https://github.com/Koenkk/zigbee2mqtt/issues/1195 --- converters/fromZigbee.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 453c0fb801315..7e455f4ef7695 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -582,17 +582,29 @@ const converters = { const timeout = useOptionsTimeout ? options.occupancy_timeout : occupancyTimeout; const deviceID = msg.endpoints[0].device.ieeeAddr; - // Stop existing timer because motion is detected and set a new one. + // Stop existing timers because motion is detected and set a new one. if (store[deviceID]) { - clearTimeout(store[deviceID]); - store[deviceID] = null; + store[deviceID].forEach((t) => clearTimeout(t)); } + store[deviceID] = []; + if (timeout !== 0) { - store[deviceID] = setTimeout(() => { + const timer = setTimeout(() => { publish({occupancy: false}); - store[deviceID] = null; }, timeout * 1000); + + store[deviceID].push(timer); + } + + // No occupancy since + if (options && options.no_occupancy_since) { + options.no_occupancy_since.forEach((since) => { + const timer = setTimeout(() => { + publish({no_occupancy_since: since}); + }, since * 1000); + store[deviceID].push(timer); + }); } return {occupancy: true}; From 5bc6e3ba4432477051feba3577dff6ca1ee0ae0c Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Fri, 15 Mar 2019 23:20:08 +0100 Subject: [PATCH 656/676] 8.0.4 --- npm-shrinkwrap.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a80825c1b1686..cfebd31fb080c 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "8.0.3", + "version": "8.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 748a26f55808e..32e9895e2b0c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zigbee-shepherd-converters", - "version": "8.0.3", + "version": "8.0.4", "description": "Collection of device converters to be used with zigbee-shepherd", "main": "index.js", "files": [ From 6c9d34341ae895b6be0d0ad45e7f59634501a4c4 Mon Sep 17 00:00:00 2001 From: qosmio Date: Fri, 15 Mar 2019 17:37:24 -0500 Subject: [PATCH 657/676] Add converters for ignoring 'diagnostic' and 'genscenes' dev changes (#350) * Add support for Sengled E12-N14 (BR30) Light * Add Osram BR30 RGBW LED to HA * Update devices.js * Add support for Sengled E12-N14 (BR30) Light * Update devices.js * Add Support SwannOne Key Fob SWO-KEF1PA * Modify payload to be more compatible with Home Assistant * Add support for Sengled E12-N14 (BR30) Light * Update devices.js * Add Support SwannOne Key Fob SWO-KEF1PA * Modify payload to be more compatible with Home Assistant * Add converters for ignoring 'diagnostic' and 'genscenes' dev changes --- converters/fromZigbee.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 7e455f4ef7695..58a408ed599cc 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2383,6 +2383,16 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, + ignore_diagnostic_change: { + cid: 'haDiagnostic', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, + ignore_genscenes_change: { + cid: 'genScenes', + type: 'devChange', + convert: (model, msg, publish, options) => null, + }, }; module.exports = converters; From ab6e2f0f28f33383290224b583df56214381dd00 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Fri, 15 Mar 2019 20:11:27 -0500 Subject: [PATCH 658/676] Sengled: Add configure feature for reporting 'genOnOff' and 'genLevelCtrl' Wireshark reported Sengled's own hub configured the bulbs for reporting on/off states and brightness. --- devices.js | 102 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 96 insertions(+), 6 deletions(-) diff --git a/devices.js b/devices.js index 287839576c799..c0b9ebfeb2a42 100644 --- a/devices.js +++ b/devices.js @@ -1655,42 +1655,132 @@ const devices = [ model: 'E11-G13', vendor: 'Sengled', description: 'Element Classic (A19)', - extend: generic.light_onoff_brightness, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + toZigbee: generic.light_onoff_brightness.toZigbee, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['E11-G23', 'E11-G33'], model: 'E11-G23/E11-G33', vendor: 'Sengled', description: 'Element Classic (A60)', - extend: generic.light_onoff_brightness, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + toZigbee: generic.light_onoff_brightness.toZigbee, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['Z01-CIA19NAE26'], model: 'Z01-CIA19NAE26', vendor: 'Sengled', description: 'Element Touch (A19)', - extend: generic.light_onoff_brightness, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + toZigbee: generic.light_onoff_brightness.toZigbee, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['Z01-A19NAE26'], model: 'Z01-A19NAE26', vendor: 'Sengled', description: 'Element Plus (A19)', - extend: generic.light_onoff_brightness_colortemp, + supports: generic.light_onoff_brightness_colortemp.supports, + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['E11-N1EA'], model: 'E11-N1EA', vendor: 'Sengled', description: 'Element Plus Color (A19)', - extend: generic.light_onoff_brightness_colortemp_colorxy, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['E12-N14'], model: 'E12-N14', vendor: 'Sengled', description: 'Element Classic (BR30)', - extend: generic.light_onoff_brightness, + supports: generic.light_onoff_brightness.supports, + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + toZigbee: generic.light_onoff_brightness.toZigbee, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['E1A-AC2'], From c41da7704f129926e7e43baf557855a1754b71a7 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Fri, 15 Mar 2019 20:37:41 -0500 Subject: [PATCH 659/676] Osram/Sylvania: Add vendor specific functions NOTE: Will require updated zcl-id and zcl-packet defs: https://github.com/qosmio/zcl-id/commit/859d6575cac060c79c73405ea0e5c3760616e8a6 https://github.com/qosmio/zcl-packet/commit/f74d92ce6f8da88723e3c9174d347e77c96f2c75 Two new functions: * osram_set_transition: Allows setting a default transition time whenever lights are turned back on manually. * osram_remember_state: Allows the end device to remember its last brightness/hue/color/etc state when light is turned on manually. Currently it resets to default. Also adding options to the ignore list. - fz.ignore_genIdentify_change - fz.ignore_diagnostic_change - fz.ignore_genscenes_change --- converters/toZigbee.js | 52 ++++++++++++++++++++++++++++++++++++++++++ devices.js | 22 +++++++++++++++--- 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 42cb4d65022fe..8dd8514ad08ec 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -18,6 +18,10 @@ const cfg = { manufSpec: 1, manufCode: 4151, }, + osram: { + manufSpec: 1, + manufCode: 0x110c, + }, }; const converters = { @@ -987,6 +991,54 @@ const converters = { }; }, }, + osram_set_transition: { + key: ['osram_set_transition'], + convert: (key, value, message, type, postfix) => { + if (type === 'set'){ + const transition = ( value > 1 ) ? (Math.round((value * 2).toFixed(1))/2).toFixed(1) * 10 : 1; + if(value) { + return { + cid: 'genLevelCtrl', + cmd: 'write', + cmdType: 'foundation', + zclData: [{ + attrId: 0x0012, + dataType: 0x21, + attrData: transition + },{ attrId: 0x0013, + dataType: 0x21, + attrData: transition + }], + cfg: cfg.default, + }; + } + } + }, + }, + osram_remember_state: { + key: 'osram_remember_state', + convert: (key, value, message, type, postfix) => { + if (type === 'set'){ + if(value === true) { + return { + cid: 'manuSpecificOsram', + cmd: 'saveStartupParams', + cmdType: 'functional', + zclData: {}, + cfg: cfg.osram, + }; + } else if ( value === false ) { + return { + cid: 'manuSpecificOsram', + cmd: 'resetStartupParams', + cmdType: 'functional', + zclData: {}, + cfg: cfg.osram, + }; + } + } + }, + }, eurotronic_system_mode: { key: 'eurotronic_system_mode', convert: (key, value, message, type, postfix) => { diff --git a/devices.js b/devices.js index 287839576c799..f01feb59e77c9 100644 --- a/devices.js +++ b/devices.js @@ -1519,14 +1519,18 @@ const devices = [ model: '73739', vendor: 'Sylvania', description: 'LIGHTIFY LED RGBW BR30', - extend: generic.light_onoff_brightness_colortemp_colorxy, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee.concat([tz.osram_remember_state,tz.osram_set_transition]), + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee.concat([fz.ignore_genIdentify_change,fz.ignore_diagnostic_change,fz.ignore_genscenes_change]), }, { zigbeeModel: ['LIGHTIFY A19 RGBW'], model: '73693', vendor: 'Sylvania', description: 'LIGHTIFY LED RGBW A19', - extend: generic.light_onoff_brightness_colortemp_colorxy, + supports: generic.light_onoff_brightness_colortemp_colorxy.supports, + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee.concat([tz.osram_remember_state,tz.osram_set_transition]), + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, }, { zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM', 'LIGHTIFY A19 ON/OFF/DIM 10 Year'], @@ -1540,7 +1544,19 @@ const devices = [ model: '74696', vendor: 'Sylvania', description: 'LIGHTIFY LED soft white dimmable A19', - extend: generic.light_onoff_brightness, + supports: generic.light_onoff_brightness.supports, + toZigbee: generic.light_onoff_brightness.toZigbee.concat([tz.osram_remember_state,tz.osram_set_transition]), + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_genIdentify_change,fz.ignore_diagnostic_change,fz.ignore_genscenes_change]), + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 1); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 5, maxRepIntval: 300, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['PLUG'], From b06a5a94bb7262816e6ee174fafbba040c45882e Mon Sep 17 00:00:00 2001 From: Qosmio Date: Fri, 15 Mar 2019 21:40:29 -0500 Subject: [PATCH 660/676] Fixing eslinting issues. --- converters/toZigbee.js | 14 +++++++------- devices.js | 24 +++++++++++++++++++----- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 8dd8514ad08ec..35f2858d5bf20 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -994,9 +994,9 @@ const converters = { osram_set_transition: { key: ['osram_set_transition'], convert: (key, value, message, type, postfix) => { - if (type === 'set'){ + if (type === 'set') { const transition = ( value > 1 ) ? (Math.round((value * 2).toFixed(1))/2).toFixed(1) * 10 : 1; - if(value) { + if (value) { return { cid: 'genLevelCtrl', cmd: 'write', @@ -1004,10 +1004,10 @@ const converters = { zclData: [{ attrId: 0x0012, dataType: 0x21, - attrData: transition - },{ attrId: 0x0013, + attrData: transition, + }, {attrId: 0x0013, dataType: 0x21, - attrData: transition + attrData: transition, }], cfg: cfg.default, }; @@ -1018,8 +1018,8 @@ const converters = { osram_remember_state: { key: 'osram_remember_state', convert: (key, value, message, type, postfix) => { - if (type === 'set'){ - if(value === true) { + if (type === 'set') { + if (value === true) { return { cid: 'manuSpecificOsram', cmd: 'saveStartupParams', diff --git a/devices.js b/devices.js index f01feb59e77c9..01ea257c3edea 100644 --- a/devices.js +++ b/devices.js @@ -1520,8 +1520,15 @@ const devices = [ vendor: 'Sylvania', description: 'LIGHTIFY LED RGBW BR30', supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee.concat([tz.osram_remember_state,tz.osram_set_transition]), - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee.concat([fz.ignore_genIdentify_change,fz.ignore_diagnostic_change,fz.ignore_genscenes_change]), + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee.concat([ + tz.osram_remember_state, + tz.osram_set_transition, + ]), + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee.concat([ + fz.ignore_genIdentify_change, + fz.ignore_diagnostic_change, + fz.ignore_genscenes_change, + ]), }, { zigbeeModel: ['LIGHTIFY A19 RGBW'], @@ -1529,7 +1536,10 @@ const devices = [ vendor: 'Sylvania', description: 'LIGHTIFY LED RGBW A19', supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee.concat([tz.osram_remember_state,tz.osram_set_transition]), + toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee.concat([ + tz.osram_remember_state, + tz.osram_set_transition, + ]), fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, }, { @@ -1545,8 +1555,12 @@ const devices = [ vendor: 'Sylvania', description: 'LIGHTIFY LED soft white dimmable A19', supports: generic.light_onoff_brightness.supports, - toZigbee: generic.light_onoff_brightness.toZigbee.concat([tz.osram_remember_state,tz.osram_set_transition]), - fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_genIdentify_change,fz.ignore_diagnostic_change,fz.ignore_genscenes_change]), + toZigbee: generic.light_onoff_brightness.toZigbee.concat([tz.osram_remember_state, tz.osram_set_transition]), + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([ + fz.ignore_genIdentify_change, + fz.ignore_diagnostic_change, + fz.ignore_genscenes_change, + ]), configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 5, maxRepIntval: 300, repChange: 1}; From 70010acbdc554833fb10ddb5d205beb3f824998b Mon Sep 17 00:00:00 2001 From: Qosmio Date: Fri, 15 Mar 2019 23:58:46 -0500 Subject: [PATCH 661/676] Sylvania/Osram: Configure BR30, A19, A19 RGBW to report on/off --- devices.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 01ea257c3edea..9c345dcbc95e3 100644 --- a/devices.js +++ b/devices.js @@ -1529,6 +1529,19 @@ const devices = [ fz.ignore_diagnostic_change, fz.ignore_genscenes_change, ]), + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 3); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['LIGHTIFY A19 RGBW'], @@ -1541,6 +1554,19 @@ const devices = [ tz.osram_set_transition, ]), fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, + configure: (ieeeAddr, shepherd, coordinator, callback) => { + const device = shepherd.find(ieeeAddr, 3); + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const actions = [ + (cb) => device.bind('genOnOff', coordinator, cb), + (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), + ]; + + execute(device, actions, callback); + }, }, { zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM', 'LIGHTIFY A19 ON/OFF/DIM 10 Year'], @@ -1563,10 +1589,13 @@ const devices = [ ]), configure: (ieeeAddr, shepherd, coordinator, callback) => { const device = shepherd.find(ieeeAddr, 1); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 5, maxRepIntval: 300, repChange: 1}; + const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; + const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; const actions = [ (cb) => device.bind('genOnOff', coordinator, cb), (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), + (cb) => device.bind('genLevelCtrl', coordinator, cb), + (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), ]; execute(device, actions, callback); From 3af2296ebac219ac673a64c376af25233e1e3510 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Sat, 16 Mar 2019 17:56:05 -0500 Subject: [PATCH 662/676] Revert 'configure' options for reporting. Being worked on upstream https://github.com/Koenkk/zigbee2mqtt/issues/1064 --- devices.js | 108 ++++++++++++----------------------------------------- 1 file changed, 24 insertions(+), 84 deletions(-) diff --git a/devices.js b/devices.js index c0b9ebfeb2a42..fe622a77876da 100644 --- a/devices.js +++ b/devices.js @@ -1656,21 +1656,11 @@ const devices = [ vendor: 'Sengled', description: 'Element Classic (A19)', supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([ + fz.ignore_metering_change, + fz.ignore_diagnostic_change, + ]), toZigbee: generic.light_onoff_brightness.toZigbee, - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; - const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), - (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), - ]; - - execute(device, actions, callback); - }, }, { zigbeeModel: ['E11-G23', 'E11-G33'], @@ -1678,21 +1668,11 @@ const devices = [ vendor: 'Sengled', description: 'Element Classic (A60)', supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([ + fz.ignore_metering_change, + fz.ignore_diagnostic_change, + ]), toZigbee: generic.light_onoff_brightness.toZigbee, - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; - const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), - (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), - ]; - - execute(device, actions, callback); - }, }, { zigbeeModel: ['Z01-CIA19NAE26'], @@ -1700,21 +1680,11 @@ const devices = [ vendor: 'Sengled', description: 'Element Touch (A19)', supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([ + fz.ignore_metering_change, + fz.ignore_diagnostic_change, + ]), toZigbee: generic.light_onoff_brightness.toZigbee, - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; - const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), - (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), - ]; - - execute(device, actions, callback); - }, }, { zigbeeModel: ['Z01-A19NAE26'], @@ -1722,21 +1692,11 @@ const devices = [ vendor: 'Sengled', description: 'Element Plus (A19)', supports: generic.light_onoff_brightness_colortemp.supports, - fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + fromZigbee: generic.light_onoff_brightness_colortemp.fromZigbee.concat([ + fz.ignore_metering_change, + fz.ignore_diagnostic_change, + ]), toZigbee: generic.light_onoff_brightness_colortemp.toZigbee, - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; - const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), - (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), - ]; - - execute(device, actions, callback); - }, }, { zigbeeModel: ['E11-N1EA'], @@ -1744,21 +1704,11 @@ const devices = [ vendor: 'Sengled', description: 'Element Plus Color (A19)', supports: generic.light_onoff_brightness_colortemp_colorxy.supports, - fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee.concat([ + fz.ignore_metering_change, + fz.ignore_diagnostic_change, + ]), toZigbee: generic.light_onoff_brightness_colortemp_colorxy.toZigbee, - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; - const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), - (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), - ]; - - execute(device, actions, callback); - }, }, { zigbeeModel: ['E12-N14'], @@ -1766,21 +1716,11 @@ const devices = [ vendor: 'Sengled', description: 'Element Classic (BR30)', supports: generic.light_onoff_brightness.supports, - fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([fz.ignore_metering_change, fz.ignore_diagnostic_change]), + fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([ + fz.ignore_metering_change, + fz.ignore_diagnostic_change, + ]), toZigbee: generic.light_onoff_brightness.toZigbee, - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 65534, repChange: 1}; - const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), - (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), - ]; - - execute(device, actions, callback); - }, }, { zigbeeModel: ['E1A-AC2'], From 4d20440830c478f24b9498a031f21ea3eb01387b Mon Sep 17 00:00:00 2001 From: Qosmio Date: Sat, 16 Mar 2019 18:03:59 -0500 Subject: [PATCH 663/676] FIX: Key was incorrectly defined as a list of options. --- converters/toZigbee.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 35f2858d5bf20..6fba222d5f142 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -992,7 +992,7 @@ const converters = { }, }, osram_set_transition: { - key: ['osram_set_transition'], + key: 'osram_set_transition', convert: (key, value, message, type, postfix) => { if (type === 'set') { const transition = ( value > 1 ) ? (Math.round((value * 2).toFixed(1))/2).toFixed(1) * 10 : 1; From 0905512cd88e6b7a56c6144ded5c0d8dba105516 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Sat, 16 Mar 2019 18:10:16 -0500 Subject: [PATCH 664/676] Revert 'configure' options for reporting. Being worked on upstream See: https://github.com/Koenkk/zigbee2mqtt/issues/1064 --- devices.js | 44 ++++---------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/devices.js b/devices.js index 9c345dcbc95e3..49e8ede3b1037 100644 --- a/devices.js +++ b/devices.js @@ -1529,19 +1529,6 @@ const devices = [ fz.ignore_diagnostic_change, fz.ignore_genscenes_change, ]), - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 3); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), - (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), - ]; - - execute(device, actions, callback); - }, }, { zigbeeModel: ['LIGHTIFY A19 RGBW'], @@ -1554,19 +1541,6 @@ const devices = [ tz.osram_set_transition, ]), fromZigbee: generic.light_onoff_brightness_colortemp_colorxy.fromZigbee, - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 3); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), - (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), - ]; - - execute(device, actions, callback); - }, }, { zigbeeModel: ['LIGHTIFY A19 ON/OFF/DIM', 'LIGHTIFY A19 ON/OFF/DIM 10 Year'], @@ -1581,25 +1555,15 @@ const devices = [ vendor: 'Sylvania', description: 'LIGHTIFY LED soft white dimmable A19', supports: generic.light_onoff_brightness.supports, - toZigbee: generic.light_onoff_brightness.toZigbee.concat([tz.osram_remember_state, tz.osram_set_transition]), + toZigbee: generic.light_onoff_brightness.toZigbee.concat([ + tz.osram_remember_state, + tz.osram_set_transition, + ]), fromZigbee: generic.light_onoff_brightness.fromZigbee.concat([ fz.ignore_genIdentify_change, fz.ignore_diagnostic_change, fz.ignore_genscenes_change, ]), - configure: (ieeeAddr, shepherd, coordinator, callback) => { - const device = shepherd.find(ieeeAddr, 1); - const cfgOnOff = {direction: 0, attrId: 0, dataType: 16, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const cfgLevel = {direction: 0, attrId: 0, dataType: 32, minRepIntval: 3, maxRepIntval: 1000, repChange: 1}; - const actions = [ - (cb) => device.bind('genOnOff', coordinator, cb), - (cb) => device.foundation('genOnOff', 'configReport', [cfgOnOff], foundationCfg, cb), - (cb) => device.bind('genLevelCtrl', coordinator, cb), - (cb) => device.foundation('genLevelCtrl', 'configReport', [cfgLevel], foundationCfg, cb), - ]; - - execute(device, actions, callback); - }, }, { zigbeeModel: ['PLUG'], From f3c6f62ff72b5efb00148b07704b42a195c8f949 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Sat, 16 Mar 2019 18:16:34 -0500 Subject: [PATCH 665/676] FIX: duplicate keys that were already merged. --- converters/fromZigbee.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 58a408ed599cc..7e455f4ef7695 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2383,16 +2383,6 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, - ignore_diagnostic_change: { - cid: 'haDiagnostic', - type: 'devChange', - convert: (model, msg, publish, options) => null, - }, - ignore_genscenes_change: { - cid: 'genScenes', - type: 'devChange', - convert: (model, msg, publish, options) => null, - }, }; module.exports = converters; From 5e5f6c6491d3e22fdf66373ee6a568f58353f520 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Sat, 16 Mar 2019 18:25:51 -0500 Subject: [PATCH 666/676] FIX: Remove duplicate keys that were already merged. --- converters/fromZigbee.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 58a408ed599cc..7e455f4ef7695 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2383,16 +2383,6 @@ const converters = { type: 'devChange', convert: (model, msg, publish, options) => null, }, - ignore_diagnostic_change: { - cid: 'haDiagnostic', - type: 'devChange', - convert: (model, msg, publish, options) => null, - }, - ignore_genscenes_change: { - cid: 'genScenes', - type: 'devChange', - convert: (model, msg, publish, options) => null, - }, }; module.exports = converters; From 24d57a497704cdb4da0dfc03690c7b3b521e3ffa Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 18 Dec 2019 18:58:15 -0600 Subject: [PATCH 667/676] eslinting fixes --- converters/fromZigbee.js | 8 ++++---- converters/toZigbee.js | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index c512662a45b16..bb36a91ea88ed 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -273,17 +273,17 @@ const converters = { const payload = {}; if (msg.data.hasOwnProperty('activePower')) { const multiplier = msg.endpoint.getClusterAttributeValue( - 'haElectricalMeasurement', 'acPowerMultiplier' + 'haElectricalMeasurement', 'acPowerMultiplier', ); const divisor = msg.endpoint.getClusterAttributeValue( - 'haElectricalMeasurement', 'acPowerDivisor' + 'haElectricalMeasurement', 'acPowerDivisor', ); const factor = multiplier && divisor ? multiplier / divisor : 1; payload.power = precisionRound(msg.data['activePower'] * factor, 2); } if (msg.data.hasOwnProperty('rmsCurrent')) { const multiplier = msg.endpoint.getClusterAttributeValue( - 'haElectricalMeasurement', 'acCurrentMultiplier' + 'haElectricalMeasurement', 'acCurrentMultiplier', ); const divisor = msg.endpoint.getClusterAttributeValue('haElectricalMeasurement', 'acCurrentDivisor'); const factor = multiplier && divisor ? multiplier / divisor : 1; @@ -291,7 +291,7 @@ const converters = { } if (msg.data.hasOwnProperty('rmsVoltage')) { const multiplier = msg.endpoint.getClusterAttributeValue( - 'haElectricalMeasurement', 'acVoltageMultiplier' + 'haElectricalMeasurement', 'acVoltageMultiplier', ); const divisor = msg.endpoint.getClusterAttributeValue('haElectricalMeasurement', 'acVoltageDivisor'); const factor = multiplier && divisor ? multiplier / divisor : 1; diff --git a/converters/toZigbee.js b/converters/toZigbee.js index 03f890f98138c..84dd1fa546332 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -134,7 +134,7 @@ const converters = { 'genLevelCtrl', 'moveToLevel', {level: Math.round(Number(value) * 2.55).toString(), transtime: 0}, - getOptions(meta) + getOptions(meta), ); return {state: {position: value}, readAfterWriteTime: 0}; @@ -176,7 +176,7 @@ const converters = { 'ssIasWd', 'startWarning', {startwarninginfo: info, warningduration: values.duration}, - getOptions(meta) + getOptions(meta), ); }, }, @@ -206,14 +206,14 @@ const converters = { 'closuresWindowCovering', isPosition ? 'goToLiftPercentage' : 'goToTiltPercentage', isPosition ? {percentageliftvalue: value} : {percentagetiltvalue: value}, - getOptions(meta) + getOptions(meta), ); }, convertGet: async (entity, key, meta) => { const isPosition = (key === 'position'); await entity.read( 'closuresWindowCovering', - [isPosition ? 'currentPositionLiftPercentage' : 'currentPositionTiltPercentage'] + [isPosition ? 'currentPositionLiftPercentage' : 'currentPositionTiltPercentage'], ); }, }, @@ -291,7 +291,7 @@ const converters = { 'genLevelCtrl', 'moveToLevelWithOnOff', {level: Number(brightness), transtime: transition}, - getOptions(meta) + getOptions(meta), ); return { state: {state: brightness === 0 ? 'OFF' : 'ON', brightness: Number(brightness)}, @@ -898,7 +898,7 @@ const converters = { 'closuresDoorLock', `${value.toLowerCase()}Door`, {'pincodevalue': ''}, - getOptions(meta) + getOptions(meta), ); return {readAfterWriteTime: 200, state: {state: value.toUpperCase()}}; @@ -957,7 +957,7 @@ const converters = { } const result = await converters.light_brightness.convertSet( - meta.device.getEndpoint(15), key, value, meta + meta.device.getEndpoint(15), key, value, meta, ); return { state: {white_value: value, ...result.state, ...state}, From b5466e5c0377fe4937c63a1d0110a1c5ec545061 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 18 Dec 2019 19:45:37 -0600 Subject: [PATCH 668/676] Enhancements to ZBT-CCTSwitch-D0001 + add new device Ecosmart-ZBT-A19-CCT-Bulb --- converters/fromZigbee.js | 58 +++++++++++++++++++++++++++++----------- devices.js | 36 ++++++++++++++++--------- 2 files changed, 66 insertions(+), 28 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index bb36a91ea88ed..d33adaeba9587 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -3242,50 +3242,63 @@ const converters = { }; }, }, - ZBT_CCTSwitch_D0001_cmdOnOff: { + CCTSwitch_D0001_on_off: { cluster: 'genOnOff', type: ['commandOn', 'commandOff'], convert: (model, msg, publish, options) => { - // the remote maintains state and sends two potential commands for the power button - // map both "on" and "off" to a consistent "button_1" + const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { store[deviceID] = {lastCmd: null, last_seq: -10}; } - const cmd = 'button_1'; + const cmd = msg.type === 'commandOn' ? 'power_on' : 'power_off'; store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; store[deviceID].lastCmd = cmd; - return {action: cmd}; + return {click: cmd}; }, }, - ZBT_CCTSwitch_D0001_moveToLevel: { + CCTSwitch_D0001_move_to_level_recall: { cluster: 'genLevelCtrl', type: ['commandMoveToLevel', 'commandMoveToLevelWithOnOff'], convert: (model, msg, publish, options) => { // wrap the messages from button2 and button4 into a single function // button2 always sends "commandMoveToLevel" // button4 sends two messages, with "commandMoveToLevelWithOnOff" coming first in the sequence - // so that's the one we key off of to indicate "button4" + // so that's the one we key off of to indicate "button4". we will NOT print it in that case, + // instead it will be returned as part of the second sequence with CCTSwitch_D0001_move_to_color_temp_recall + // below. const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { - store[deviceID] = {lastCmd: null, lastSeq: -10}; + store[deviceID] = {lastCmd: null, lastSeq: -10, lastBrightness: null, lastMoveLevel: null, lastColorTemp: null}; } let cmd = null; + let payload = { click: cmd, brightness : msg.data.level, transition_time: parseFloat(msg.data.transtime/10.0)}; if ( msg.type == 'commandMoveToLevel' ) { - cmd = 'button_2'; + // pressing the brightness button increments/decrements from 13-254. + // when it reaches the end (254) it will start decrementing by a step, + // and vice versa. + const direction = msg.data.level > store[deviceID].lastBrightness ? 'up' : 'down'; + cmd = `brightness_${direction}`; + store[deviceID].lastBrightness = msg.data.level; } else if ( msg.type == 'commandMoveToLevelWithOnOff' ) { - cmd = 'button_4'; + // This is the 'start' of the 4th button sequence. + cmd = 'action_recall'; + store[deviceID].lastMoveLevel = msg.data.level; + store[deviceID].lastCmd = cmd; } + if ( cmd != 'action_recall' ) { store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; store[deviceID].lastCmd = cmd; - return {action: cmd}; + payload.click = cmd; + return payload; + } }, }, - ZBT_CCTSwitch_D0001_moveToColorTemp: { + CCTSwitch_D0001_move_to_color_temp_recall: { cluster: 'lightingColorCtrl', type: ['commandMoveToColorTemp'], convert: (model, msg, publish, options) => { @@ -3296,29 +3309,42 @@ const converters = { // and we can ignore it entirely const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { - store[deviceID] = {lastCmd: null, lastSeq: -10}; + store[deviceID] = {lastCmd: null, lastSeq: -10, lastBrightness: null, lastMoveLevel: null, lastColorTemp: null}; } const lastCmd = store[deviceID].lastCmd; const lastSeq = store[deviceID].lastSeq; const seq = msg.meta.zclTransactionSequenceNumber; - let cmd = 'button_3'; + let cmd = 'color_temp'; + let payload = { color_temp : msg.data.colortemp, transition_time: parseFloat(msg.data.transtime/10.0)}; // because the remote sends two commands for button4, we need to look at the previous command and // see if it was the recognized start command for button4 - if so, ignore this second command, // because it's not really button3, it's actually button4 - if ( lastCmd == 'button_4' ) { + if ( lastCmd == 'action_recall' ) { + payload.action = lastCmd; + payload.brightness = store[deviceID].lastMoveLevel; + // ensure the "last" message was really the message prior to this one // accounts for missed messages (gap >1) and for the remote's rollover from 127 to 0 if ( (seq == 0 && lastSeq == 127 ) || ( seq - lastSeq ) == 1 ) { cmd = null; } } + else { + // pressing the color temp button increments/decrements from 153-370K. + // when it reaches the end (370) it will start decrementing by a step, + // and vice versa. + let direction = msg.data.colortemp > store[deviceID].lastColorTemp ? 'up' : 'down'; + cmd += `_${direction}`; + payload.click = cmd; + store[deviceID].lastColorTemp = msg.data.colortemp; + } if ( cmd != null ) { store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; store[deviceID].lastCmd = cmd; - return {action: cmd}; + return payload; } }, }, diff --git a/devices.js b/devices.js index 0d07eca673242..3a25a1e4f4983 100755 --- a/devices.js +++ b/devices.js @@ -4284,6 +4284,13 @@ const devices = [ }, // EcoSmart + { + zigbeeModel: ['Ecosmart-ZBT-A19-CCT-Bulb'], + model: 'A9A19A60WESDZ02', + vendor: 'The Home Depot', + description: 'EcoSmart Tuneable White (A19)', + extend: generic.light_onoff_brightness_colortemp, + }, { zigbeeModel: ['zhaRGBW'], model: 'D1821', @@ -4314,17 +4321,6 @@ const devices = [ description: 'GU10 adjustable white bulb', extend: generic.light_onoff_brightness_colortemp, }, - { - zigbeeModel: ['ZBT-CCTSwitch-D0001'], - model: '6ARCZABZH', - vendor: 'EcoSmart', - description: 'Four button remote control (included with EcoSmart smart bulbs)', - supports: 'action', - fromZigbee: [ - fz.ZBT_CCTSwitch_D0001_cmdOnOff, fz.ZBT_CCTSwitch_D0001_moveToLevel, fz.ZBT_CCTSwitch_D0001_moveToColorTemp, - ], - toZigbee: [], - }, // Airam { @@ -5435,6 +5431,22 @@ const devices = [ description: 'LED E27 tunable white', extend: generic.light_onoff_brightness_colortemp, }, + { + zigbeeModel: ['ZBT-CCTSwitch-D0001'], + model: '6ARCZABZH', + vendor: 'Leedarson', + description: '4-Key Remote Controller', + supports: 'on/off, brightness up/down and click/hold/release, cct', + fromZigbee: [ + fz.CCTSwitch_D0001_on_off, + fz.CCTSwitch_D0001_move_to_level_recall, + fz.CCTSwitch_D0001_move_to_color_temp_recall, + fz.CTR_U_brightness_updown_hold, + fz.CTR_U_brightness_updown_release, + fz.generic_battery, + ], + toZigbee: [], + }, // GMY { @@ -6243,5 +6255,5 @@ const devices = [ ]; module.exports = devices.map((device) => - device.extend ? Object.assign({}, device.extend, device) : device + device.extend ? Object.assign({}, device.extend, device) : device, ); From 0849ea6d1a008804da0e3a54fde5048db846403d Mon Sep 17 00:00:00 2001 From: Qosmio Date: Thu, 19 Dec 2019 12:23:21 -0600 Subject: [PATCH 669/676] eslint fixes --- converters/fromZigbee.js | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index d33adaeba9587..c23e3b3c81ded 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -3246,7 +3246,6 @@ const converters = { cluster: 'genOnOff', type: ['commandOn', 'commandOff'], convert: (model, msg, publish, options) => { - const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { store[deviceID] = {lastCmd: null, last_seq: -10}; @@ -3266,16 +3265,18 @@ const converters = { // button2 always sends "commandMoveToLevel" // button4 sends two messages, with "commandMoveToLevelWithOnOff" coming first in the sequence // so that's the one we key off of to indicate "button4". we will NOT print it in that case, - // instead it will be returned as part of the second sequence with CCTSwitch_D0001_move_to_color_temp_recall - // below. + // instead it will be returned as part of the second sequence with + // CCTSwitch_D0001_move_to_color_temp_recall below. const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { - store[deviceID] = {lastCmd: null, lastSeq: -10, lastBrightness: null, lastMoveLevel: null, lastColorTemp: null}; + store[deviceID] = {lastCmd: null, lastSeq: -10, lastBrightness: null, + lastMoveLevel: null, lastColorTemp: null}; } let cmd = null; - let payload = { click: cmd, brightness : msg.data.level, transition_time: parseFloat(msg.data.transtime/10.0)}; + const payload = {click: cmd, brightness: msg.data.level, + transition_time: parseFloat(msg.data.transtime/10.0)}; if ( msg.type == 'commandMoveToLevel' ) { // pressing the brightness button increments/decrements from 13-254. // when it reaches the end (254) it will start decrementing by a step, @@ -3290,12 +3291,12 @@ const converters = { store[deviceID].lastCmd = cmd; } - if ( cmd != 'action_recall' ) { - store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; - store[deviceID].lastCmd = cmd; - payload.click = cmd; - return payload; - } + if ( cmd != 'action_recall' ) { + store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; + store[deviceID].lastCmd = cmd; + payload.click = cmd; + return payload; + } }, }, CCTSwitch_D0001_move_to_color_temp_recall: { @@ -3309,14 +3310,15 @@ const converters = { // and we can ignore it entirely const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { - store[deviceID] = {lastCmd: null, lastSeq: -10, lastBrightness: null, lastMoveLevel: null, lastColorTemp: null}; + store[deviceID] = {lastCmd: null, lastSeq: -10, lastBrightness: null, + lastMoveLevel: null, lastColorTemp: null}; } const lastCmd = store[deviceID].lastCmd; const lastSeq = store[deviceID].lastSeq; const seq = msg.meta.zclTransactionSequenceNumber; let cmd = 'color_temp'; - let payload = { color_temp : msg.data.colortemp, transition_time: parseFloat(msg.data.transtime/10.0)}; + const payload = {color_temp: msg.data.colortemp, transition_time: parseFloat(msg.data.transtime/10.0)}; // because the remote sends two commands for button4, we need to look at the previous command and // see if it was the recognized start command for button4 - if so, ignore this second command, @@ -3330,12 +3332,11 @@ const converters = { if ( (seq == 0 && lastSeq == 127 ) || ( seq - lastSeq ) == 1 ) { cmd = null; } - } - else { + } else { // pressing the color temp button increments/decrements from 153-370K. // when it reaches the end (370) it will start decrementing by a step, // and vice versa. - let direction = msg.data.colortemp > store[deviceID].lastColorTemp ? 'up' : 'down'; + const direction = msg.data.colortemp > store[deviceID].lastColorTemp ? 'up' : 'down'; cmd += `_${direction}`; payload.click = cmd; store[deviceID].lastColorTemp = msg.data.colortemp; From 1dc61b0ca775b42ff3d24139868f33e1f1db9a6f Mon Sep 17 00:00:00 2001 From: Qosmio Date: Thu, 19 Dec 2019 16:49:45 -0600 Subject: [PATCH 670/676] Add color_temp hold/release ZBT-CCTSwitch-D0001 Also updates the brightness hold/release logic. --- converters/fromZigbee.js | 52 ++++++++++++++++++++++++++++++++++++++++ devices.js | 5 ++-- 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index c23e3b3c81ded..1f41ad6be03d9 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -3349,6 +3349,58 @@ const converters = { } }, }, + CCTSwitch_D0001_brightness_updown_hold_release: { + cluster: 'genLevelCtrl', + type: ['commandMove', 'commandStop'], + convert: (model, msg, publish, options) => { + const deviceID = msg.device.ieeeAddr; + if (!store[deviceID]) { + store[deviceID] = {}; + } + const stop = msg.type === 'commandStop' ? true : false; + let button = 'brightness'; + const result = {}; + if (stop) { + button = store[deviceID].button; + const duration = Date.now() - store[deviceID].start; + result.action = `${button}_release`; + result.duration = duration; + } else { + button += msg.data.movemode === 1 ? '_down' : '_up'; + result.action = `${button}_hold`; + // store button and start moment + store[deviceID].button = button; + store[deviceID].start = Date.now(); + } + return result; + }, + }, + CCTSwitch_D0001_color_temp_updown_hold_release: { + cluster: 'lightingColorCtrl', + type: 'commandMoveColorTemp', + convert: (model, msg, publish, options) => { + const deviceID = msg.device.ieeeAddr; + if (!store[deviceID]) { + store[deviceID] = {}; + } + const stop = msg.data.movemode === 0; + let button = 'color_temp'; + const result = {}; + if (stop) { + button = store[deviceID].button; + const duration = Date.now() - store[deviceID].start; + result.action = `${button}_release`; + result.duration = duration; + } else { + button += msg.data.movemode === 3 ? '_down' : '_up'; + result.action = `${button}_hold`; + // store button and start moment + store[deviceID].button = button; + store[deviceID].start = Date.now(); + } + return result; + }, + }, // Ignore converters (these message dont need parsing). ignore_onoff_report: { diff --git a/devices.js b/devices.js index 3b699b182e1e2..87a5ec066a5a9 100755 --- a/devices.js +++ b/devices.js @@ -5448,9 +5448,8 @@ const devices = [ fz.CCTSwitch_D0001_on_off, fz.CCTSwitch_D0001_move_to_level_recall, fz.CCTSwitch_D0001_move_to_color_temp_recall, - fz.CTR_U_brightness_updown_hold, - fz.CTR_U_brightness_updown_release, - fz.generic_battery, + fz.CCTSwitch_D0001_colortemp_updown_hold_release, + fz.CCTSwitch_D0001_brightness_updown_hold_release, ], toZigbee: [], }, From 24ecf0d58814efaf484395d6057b9bd4e0198edb Mon Sep 17 00:00:00 2001 From: Qosmio Date: Thu, 19 Dec 2019 17:15:57 -0600 Subject: [PATCH 671/676] FIX devices.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following error FAIL test/index.test.js index.js ✓ Find device by model ID (6ms) ✓ Find device by model ID with strange characters 1 (1ms) ✓ Find device by model ID with strange characters 2 ✓ Find device by model ID with strange characters 3 (1ms) ✓ Find device by model ID without strange characters (1ms) ✓ Find device by model ID null (1ms) ✕ Verify devices.js definitions (132ms) ● index.js › Verify devices.js definitions TypeError: Cannot convert undefined or null to object at Function.keys () 63 | const converter = device.fromZigbee[converterKey]; 64 | > 65 | const keys = Object.keys(converter); | ^ 66 | verifyKeys(['cluster', 'type', 'convert'], keys, converterKey); 67 | 68 | if (4 != converter.convert.length) { at keys (test/index.test.js:65:37) at Array.forEach () at forEach (test/index.test.js:62:44) at Array.forEach () at Object.forEach (test/index.test.js:47:17) --- devices.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devices.js b/devices.js index 87a5ec066a5a9..5c6688dae7ef3 100755 --- a/devices.js +++ b/devices.js @@ -5448,7 +5448,7 @@ const devices = [ fz.CCTSwitch_D0001_on_off, fz.CCTSwitch_D0001_move_to_level_recall, fz.CCTSwitch_D0001_move_to_color_temp_recall, - fz.CCTSwitch_D0001_colortemp_updown_hold_release, + fz.CCTSwitch_D0001_color_temp_updown_hold_release, fz.CCTSwitch_D0001_brightness_updown_hold_release, ], toZigbee: [], From 18f800272a1763616c3210bc41e881caab3654b9 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Fri, 20 Dec 2019 03:35:51 -0600 Subject: [PATCH 672/676] Rename 'color_temp' to 'colortemp' for consistency Many automations in HA are set up to split '_' based on `attribute`, `direction`, `action`. Trying to keep the splits consistent. --- converters/fromZigbee.js | 12 ++++++------ devices.js | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 1f41ad6be03d9..108f26c6b3dde 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -3266,7 +3266,7 @@ const converters = { // button4 sends two messages, with "commandMoveToLevelWithOnOff" coming first in the sequence // so that's the one we key off of to indicate "button4". we will NOT print it in that case, // instead it will be returned as part of the second sequence with - // CCTSwitch_D0001_move_to_color_temp_recall below. + // CCTSwitch_D0001_move_to_colortemp_recall below. const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { @@ -3299,9 +3299,9 @@ const converters = { } }, }, - CCTSwitch_D0001_move_to_color_temp_recall: { + CCTSwitch_D0001_move_to_colortemp_recall: { cluster: 'lightingColorCtrl', - type: ['commandMoveToColorTemp'], + type: 'commandMoveToColorTemp', convert: (model, msg, publish, options) => { // both button3 and button4 send the command "commandMoveToColorTemp" // in order to distinguish between the buttons, use the sequence number and the previous command @@ -3317,7 +3317,7 @@ const converters = { const lastSeq = store[deviceID].lastSeq; const seq = msg.meta.zclTransactionSequenceNumber; - let cmd = 'color_temp'; + let cmd = 'colortemp'; const payload = {color_temp: msg.data.colortemp, transition_time: parseFloat(msg.data.transtime/10.0)}; // because the remote sends two commands for button4, we need to look at the previous command and @@ -3375,7 +3375,7 @@ const converters = { return result; }, }, - CCTSwitch_D0001_color_temp_updown_hold_release: { + CCTSwitch_D0001_colortemp_updown_hold_release: { cluster: 'lightingColorCtrl', type: 'commandMoveColorTemp', convert: (model, msg, publish, options) => { @@ -3384,7 +3384,7 @@ const converters = { store[deviceID] = {}; } const stop = msg.data.movemode === 0; - let button = 'color_temp'; + let button = 'colortemp'; const result = {}; if (stop) { button = store[deviceID].button; diff --git a/devices.js b/devices.js index 5c6688dae7ef3..ae8692ead99da 100755 --- a/devices.js +++ b/devices.js @@ -5447,8 +5447,8 @@ const devices = [ fromZigbee: [ fz.CCTSwitch_D0001_on_off, fz.CCTSwitch_D0001_move_to_level_recall, - fz.CCTSwitch_D0001_move_to_color_temp_recall, - fz.CCTSwitch_D0001_color_temp_updown_hold_release, + fz.CCTSwitch_D0001_move_to_colortemp_recall, + fz.CCTSwitch_D0001_colortemp_updown_hold_release, fz.CCTSwitch_D0001_brightness_updown_hold_release, ], toZigbee: [], From b27431db1d84f9b91b267a7a66745df42d25de31 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Fri, 20 Dec 2019 20:04:41 -0600 Subject: [PATCH 673/676] Tidy up code and logic for CCTSwitch --- converters/fromZigbee.js | 84 ++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 108f26c6b3dde..e579200511938 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -3246,15 +3246,8 @@ const converters = { cluster: 'genOnOff', type: ['commandOn', 'commandOff'], convert: (model, msg, publish, options) => { - const deviceID = msg.device.ieeeAddr; - if (!store[deviceID]) { - store[deviceID] = {lastCmd: null, last_seq: -10}; - } - - const cmd = msg.type === 'commandOn' ? 'power_on' : 'power_off'; - store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; - store[deviceID].lastCmd = cmd; - return {click: cmd}; + const cmd = msg.type === 'commandOn' ? 'on' : 'off'; + return {button: 'power', action: cmd}; }, }, CCTSwitch_D0001_move_to_level_recall: { @@ -3270,31 +3263,32 @@ const converters = { const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { - store[deviceID] = {lastCmd: null, lastSeq: -10, lastBrightness: null, + store[deviceID] = {lastBtn: null, lastSeq: -10, lastBrightness: null, lastMoveLevel: null, lastColorTemp: null}; } + let btn = 'brightness'; let cmd = null; - const payload = {click: cmd, brightness: msg.data.level, - transition_time: parseFloat(msg.data.transtime/10.0)}; + const payload = {brightness: msg.data.level, transition: parseFloat(msg.data.transtime/10.0)}; if ( msg.type == 'commandMoveToLevel' ) { // pressing the brightness button increments/decrements from 13-254. // when it reaches the end (254) it will start decrementing by a step, // and vice versa. const direction = msg.data.level > store[deviceID].lastBrightness ? 'up' : 'down'; - cmd = `brightness_${direction}`; + cmd = `${btn}_${direction}`; store[deviceID].lastBrightness = msg.data.level; } else if ( msg.type == 'commandMoveToLevelWithOnOff' ) { // This is the 'start' of the 4th button sequence. - cmd = 'action_recall'; + btn = 'memory'; store[deviceID].lastMoveLevel = msg.data.level; - store[deviceID].lastCmd = cmd; + store[deviceID].lastBtn = btn; } - if ( cmd != 'action_recall' ) { + if ( btn != 'memory' ) { store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; - store[deviceID].lastCmd = cmd; - payload.click = cmd; + store[deviceID].lastBtn = btn; + payload.button = btn; + payload.action = cmd; return payload; } }, @@ -3310,41 +3304,43 @@ const converters = { // and we can ignore it entirely const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { - store[deviceID] = {lastCmd: null, lastSeq: -10, lastBrightness: null, + store[deviceID] = {lastBtn: null, lastSeq: -10, lastBrightness: null, lastMoveLevel: null, lastColorTemp: null}; } - const lastCmd = store[deviceID].lastCmd; + const lastBtn = store[deviceID].lastBtn; const lastSeq = store[deviceID].lastSeq; const seq = msg.meta.zclTransactionSequenceNumber; - let cmd = 'colortemp'; - const payload = {color_temp: msg.data.colortemp, transition_time: parseFloat(msg.data.transtime/10.0)}; + let btn = 'colortemp'; + const payload = {color_temp: msg.data.colortemp, transition: parseFloat(msg.data.transtime/10.0)}; // because the remote sends two commands for button4, we need to look at the previous command and // see if it was the recognized start command for button4 - if so, ignore this second command, // because it's not really button3, it's actually button4 - if ( lastCmd == 'action_recall' ) { - payload.action = lastCmd; + if ( lastBtn == 'memory' ) { + payload.button = lastBtn; + payload.action = 'recall'; payload.brightness = store[deviceID].lastMoveLevel; // ensure the "last" message was really the message prior to this one // accounts for missed messages (gap >1) and for the remote's rollover from 127 to 0 if ( (seq == 0 && lastSeq == 127 ) || ( seq - lastSeq ) == 1 ) { - cmd = null; + btn = null; } } else { // pressing the color temp button increments/decrements from 153-370K. // when it reaches the end (370) it will start decrementing by a step, // and vice versa. const direction = msg.data.colortemp > store[deviceID].lastColorTemp ? 'up' : 'down'; - cmd += `_${direction}`; - payload.click = cmd; + const cmd = `${btn}_${direction}`; + payload.button = btn; + payload.action = cmd; store[deviceID].lastColorTemp = msg.data.colortemp; } - if ( cmd != null ) { + if ( btn != null ) { store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; - store[deviceID].lastCmd = cmd; + store[deviceID].lastBtn = btn; return payload; } }, @@ -3358,18 +3354,19 @@ const converters = { store[deviceID] = {}; } const stop = msg.type === 'commandStop' ? true : false; - let button = 'brightness'; - const result = {}; + let direction = null; + const btn = 'brightness'; + const result = {button: btn}; if (stop) { - button = store[deviceID].button; + direction = store[deviceID].direction; const duration = Date.now() - store[deviceID].start; - result.action = `${button}_release`; + result.action = `${btn}_${direction}_release`; result.duration = duration; } else { - button += msg.data.movemode === 1 ? '_down' : '_up'; - result.action = `${button}_hold`; + direction = msg.data.movemode === 1 ? 'down' : 'up'; + result.action = `${btn}_${direction}_hold`; // store button and start moment - store[deviceID].button = button; + store[deviceID].direction = direction; store[deviceID].start = Date.now(); } return result; @@ -3384,18 +3381,19 @@ const converters = { store[deviceID] = {}; } const stop = msg.data.movemode === 0; - let button = 'colortemp'; - const result = {}; + let direction = null; + const btn = 'colortemp'; + const result = {button: btn}; if (stop) { - button = store[deviceID].button; + direction = store[deviceID].direction; const duration = Date.now() - store[deviceID].start; - result.action = `${button}_release`; + result.action = `${btn}_${direction}_release`; result.duration = duration; } else { - button += msg.data.movemode === 3 ? '_down' : '_up'; - result.action = `${button}_hold`; + direction = msg.data.movemode === 3 ? 'down' : 'up'; + result.action = `${btn}_${direction}_hold`; // store button and start moment - store[deviceID].button = button; + store[deviceID].direction = direction; store[deviceID].start = Date.now(); } return result; From 252940a069b5118ba29812ce05430b4235fc6470 Mon Sep 17 00:00:00 2001 From: Qosmio Date: Sat, 21 Dec 2019 17:35:52 -0600 Subject: [PATCH 674/676] FIX: Change 'button' to 'click' for HA compatibility --- converters/fromZigbee.js | 54 ++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index e579200511938..80acbdf1badf5 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -3247,7 +3247,7 @@ const converters = { type: ['commandOn', 'commandOff'], convert: (model, msg, publish, options) => { const cmd = msg.type === 'commandOn' ? 'on' : 'off'; - return {button: 'power', action: cmd}; + return {click: 'power', action: cmd}; }, }, CCTSwitch_D0001_move_to_level_recall: { @@ -3263,11 +3263,11 @@ const converters = { const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { - store[deviceID] = {lastBtn: null, lastSeq: -10, lastBrightness: null, + store[deviceID] = {lastClk: null, lastSeq: -10, lastBrightness: null, lastMoveLevel: null, lastColorTemp: null}; } - let btn = 'brightness'; + let clk = 'brightness'; let cmd = null; const payload = {brightness: msg.data.level, transition: parseFloat(msg.data.transtime/10.0)}; if ( msg.type == 'commandMoveToLevel' ) { @@ -3275,19 +3275,19 @@ const converters = { // when it reaches the end (254) it will start decrementing by a step, // and vice versa. const direction = msg.data.level > store[deviceID].lastBrightness ? 'up' : 'down'; - cmd = `${btn}_${direction}`; + cmd = `${clk}_${direction}`; store[deviceID].lastBrightness = msg.data.level; } else if ( msg.type == 'commandMoveToLevelWithOnOff' ) { // This is the 'start' of the 4th button sequence. - btn = 'memory'; + clk = 'memory'; store[deviceID].lastMoveLevel = msg.data.level; - store[deviceID].lastBtn = btn; + store[deviceID].lastClk = clk; } - if ( btn != 'memory' ) { + if ( clk != 'memory' ) { store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; - store[deviceID].lastBtn = btn; - payload.button = btn; + store[deviceID].lastClk = clk; + payload.click = clk; payload.action = cmd; return payload; } @@ -3304,43 +3304,43 @@ const converters = { // and we can ignore it entirely const deviceID = msg.device.ieeeAddr; if (!store[deviceID]) { - store[deviceID] = {lastBtn: null, lastSeq: -10, lastBrightness: null, + store[deviceID] = {lastClk: null, lastSeq: -10, lastBrightness: null, lastMoveLevel: null, lastColorTemp: null}; } - const lastBtn = store[deviceID].lastBtn; + const lastClk = store[deviceID].lastClk; const lastSeq = store[deviceID].lastSeq; const seq = msg.meta.zclTransactionSequenceNumber; - let btn = 'colortemp'; + let clk = 'colortemp'; const payload = {color_temp: msg.data.colortemp, transition: parseFloat(msg.data.transtime/10.0)}; // because the remote sends two commands for button4, we need to look at the previous command and // see if it was the recognized start command for button4 - if so, ignore this second command, // because it's not really button3, it's actually button4 - if ( lastBtn == 'memory' ) { - payload.button = lastBtn; + if ( lastClk == 'memory' ) { + payload.click = lastClk; payload.action = 'recall'; payload.brightness = store[deviceID].lastMoveLevel; // ensure the "last" message was really the message prior to this one // accounts for missed messages (gap >1) and for the remote's rollover from 127 to 0 if ( (seq == 0 && lastSeq == 127 ) || ( seq - lastSeq ) == 1 ) { - btn = null; + clk = null; } } else { // pressing the color temp button increments/decrements from 153-370K. // when it reaches the end (370) it will start decrementing by a step, // and vice versa. const direction = msg.data.colortemp > store[deviceID].lastColorTemp ? 'up' : 'down'; - const cmd = `${btn}_${direction}`; - payload.button = btn; + const cmd = `${clk}_${direction}`; + payload.click = clk; payload.action = cmd; store[deviceID].lastColorTemp = msg.data.colortemp; } - if ( btn != null ) { + if ( clk != null ) { store[deviceID].lastSeq = msg.meta.zclTransactionSequenceNumber; - store[deviceID].lastBtn = btn; + store[deviceID].lastClk = clk; return payload; } }, @@ -3355,16 +3355,16 @@ const converters = { } const stop = msg.type === 'commandStop' ? true : false; let direction = null; - const btn = 'brightness'; - const result = {button: btn}; + const clk = 'brightness'; + const result = {click: clk}; if (stop) { direction = store[deviceID].direction; const duration = Date.now() - store[deviceID].start; - result.action = `${btn}_${direction}_release`; + result.action = `${clk}_${direction}_release`; result.duration = duration; } else { direction = msg.data.movemode === 1 ? 'down' : 'up'; - result.action = `${btn}_${direction}_hold`; + result.action = `${clk}_${direction}_hold`; // store button and start moment store[deviceID].direction = direction; store[deviceID].start = Date.now(); @@ -3382,16 +3382,16 @@ const converters = { } const stop = msg.data.movemode === 0; let direction = null; - const btn = 'colortemp'; - const result = {button: btn}; + const clk = 'colortemp'; + const result = {click: clk}; if (stop) { direction = store[deviceID].direction; const duration = Date.now() - store[deviceID].start; - result.action = `${btn}_${direction}_release`; + result.action = `${clk}_${direction}_release`; result.duration = duration; } else { direction = msg.data.movemode === 3 ? 'down' : 'up'; - result.action = `${btn}_${direction}_hold`; + result.action = `${clk}_${direction}_hold`; // store button and start moment store[deviceID].direction = direction; store[deviceID].start = Date.now(); From 3a775c3dc19ebdb1172fbad437603a47610e5385 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 23 Dec 2019 20:55:33 +0100 Subject: [PATCH 675/676] Update devices.js --- devices.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devices.js b/devices.js index 92544f440a2eb..991dddbc898c0 100755 --- a/devices.js +++ b/devices.js @@ -4340,8 +4340,8 @@ const devices = [ { zigbeeModel: ['Ecosmart-ZBT-A19-CCT-Bulb'], model: 'A9A19A60WESDZ02', - vendor: 'The Home Depot', - description: 'EcoSmart Tuneable White (A19)', + vendor: 'EcoSmart', + description: 'Tuneable white (A19)', extend: generic.light_onoff_brightness_colortemp, }, { From 1e5a45e6f1425c6b09902c31ec8ec95303e119c0 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Mon, 23 Dec 2019 20:57:55 +0100 Subject: [PATCH 676/676] Update devices.js --- devices.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/devices.js b/devices.js index 991dddbc898c0..d614bf171a765 100755 --- a/devices.js +++ b/devices.js @@ -4381,7 +4381,11 @@ const devices = [ description: 'Four button remote control (included with EcoSmart smart bulbs)', supports: 'action', fromZigbee: [ - fz.ZBT_CCTSwitch_D0001_cmdOnOff, fz.ZBT_CCTSwitch_D0001_moveToLevel, fz.ZBT_CCTSwitch_D0001_moveToColorTemp, + fz.CCTSwitch_D0001_on_off, + fz.CCTSwitch_D0001_move_to_level_recall, + fz.CCTSwitch_D0001_move_to_colortemp_recall, + fz.CCTSwitch_D0001_colortemp_updown_hold_release, + fz.CCTSwitch_D0001_brightness_updown_hold_release, ], toZigbee: [], }, @@ -5512,21 +5516,6 @@ const devices = [ description: 'LED E27 tunable white', extend: generic.light_onoff_brightness_colortemp, }, - { - zigbeeModel: ['ZBT-CCTSwitch-D0001'], - model: '6ARCZABZH', - vendor: 'Leedarson', - description: '4-Key Remote Controller', - supports: 'on/off, brightness up/down and click/hold/release, cct', - fromZigbee: [ - fz.CCTSwitch_D0001_on_off, - fz.CCTSwitch_D0001_move_to_level_recall, - fz.CCTSwitch_D0001_move_to_colortemp_recall, - fz.CCTSwitch_D0001_colortemp_updown_hold_release, - fz.CCTSwitch_D0001_brightness_updown_hold_release, - ], - toZigbee: [], - }, // GMY {