From 2c059b4eba32958be0da1d85c9f8bf5bdcee260d Mon Sep 17 00:00:00 2001 From: Zhou Jun Nan Date: Wed, 10 Jun 2020 00:57:12 +0800 Subject: [PATCH] add 3 new lumi sensors (#1272) * add 4 devices add feibit smart light switch 2 gang without neutral wire and TUYATEC smart switchs without neutral wire (1 gang , 2 gang , 3 gang) * fix feibit 2 gang switch model name fix feibit 2 gang smart switch device model name * fix format error & passed npm run eslint * Update devices.js fix tuya smart switch model name * Update devices.js * add 3 sensors support lumi.sensor_ht.agl02, lumi.flood.agl02, lumi.vibration.agl01, WSDCGQ12LM is still experimental and may not work property * fix lint error * replace SJCGQ12LM_water_leak_iaszone with ias_water_leak_alarm_1 * change DJT12LM genOnOff to action: 'vibration' * fix lint error * remove some properties of djt12lm and wsdcgq12lm * Update devices.js Co-authored-by: Koen Kanters --- .gitignore | 4 +++- converters/fromZigbee.js | 7 +++++++ devices.js | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 40b878db5b1c9..b0a4bec7f8595 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -node_modules/ \ No newline at end of file +node_modules/ +.vs/slnx.sqlite +.vs/ProjectSettings.json diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 122fd9b65c6ba..841d7b4425109 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -2075,6 +2075,13 @@ const converters = { return result; }, }, + DJT12LM_vibration: { + cluster: 'genOnOff', + type: 'commandOn', + convert: (model, msg, publish, options, meta) => { + return {action: 'vibration'}; + }, + }, CC2530ROUTER_led: { cluster: 'genOnOff', type: ['attributeReport', 'readResponse'], diff --git a/devices.js b/devices.js index 920154a0115d0..227e21600c61d 100755 --- a/devices.js +++ b/devices.js @@ -800,6 +800,21 @@ const devices = [ ], toZigbee: [], }, + { + zigbeeModel: ['lumi.sensor_ht.agl02'], + model: 'WSDCGQ12LM', + vendor: 'Xiaomi', + description: 'Aqara temperature, humidity and pressure sensor', + supports: 'temperature, humidity and pressure', + fromZigbee: [fz.xiaomi_battery_3v, fz.temperature, fz.humidity, fz.pressure], + toZigbee: [], + meta: {configureKey: 1}, + configure: async (device, coordinatorEndpoint) => { + const endpoint = device.getEndpoint(1); + const binds = ['msTemperatureMeasurement', 'msRelativeHumidity', 'msPressureMeasurement']; + await bind(endpoint, coordinatorEndpoint, binds); + }, + }, { zigbeeModel: ['lumi.sensor_motion'], model: 'RTCGQ01LM', @@ -854,6 +869,15 @@ const devices = [ fromZigbee: [fz.xiaomi_battery_3v, fz.SJCGQ11LM_water_leak_iaszone], toZigbee: [], }, + { + zigbeeModel: ['lumi.flood.agl02'], + model: 'SJCGQ12LM', + vendor: 'Xiaomi', + description: 'Aqara water leak sensor', + supports: 'water leak true/false', + fromZigbee: [fz.xiaomi_battery_3v, fz.ias_water_leak_alarm_1], + toZigbee: [], + }, { zigbeeModel: ['lumi.sensor_cube', 'lumi.sensor_cube.aqgl01'], model: 'MFKZQ01LM', @@ -982,6 +1006,15 @@ const devices = [ fromZigbee: [fz.xiaomi_battery_3v, fz.DJT11LM_vibration], toZigbee: [tz.DJT11LM_vibration_sensitivity], }, + { + zigbeeModel: ['lumi.vibration.agl01'], + model: 'DJT12LM', + vendor: 'Xiaomi', + description: 'Aqara vibration sensor', + supports: 'action', + fromZigbee: [fz.DJT12LM_vibration], + toZigbee: [], + }, { zigbeeModel: ['lumi.curtain', 'lumi.curtain.aq2'], model: 'ZNCLDJ11LM',