From f757f99636279854b5cd21bc7fdee77ab9a4d45d Mon Sep 17 00:00:00 2001 From: Alexandre Trovato <1839717+atrovato@users.noreply.github.com> Date: Mon, 3 Jan 2022 10:08:30 +0100 Subject: [PATCH 1/2] Zigbee2mqtt: Keep only illuminance_lux for light sensors (#1400) --- server/services/zigbee2mqtt/exposes/numericType.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/server/services/zigbee2mqtt/exposes/numericType.js b/server/services/zigbee2mqtt/exposes/numericType.js index 05e133a2e1..e65cbc0c2e 100644 --- a/server/services/zigbee2mqtt/exposes/numericType.js +++ b/server/services/zigbee2mqtt/exposes/numericType.js @@ -115,14 +115,6 @@ module.exports = { max: 100, }, }, - illuminance: { - feature: { - category: DEVICE_FEATURE_CATEGORIES.LIGHT_SENSOR, - type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL, - min: 0, - max: 100000, - }, - }, illuminance_lux: { feature: { category: DEVICE_FEATURE_CATEGORIES.LIGHT_SENSOR, From a0b8831f1893c666cd21151ce4d44a3d3ed27d44 Mon Sep 17 00:00:00 2001 From: Geissel Nicolas Date: Mon, 3 Jan 2022 10:36:55 +0100 Subject: [PATCH 2/2] Xiaomi: Add support for sensor_switch.aq2 (switch button) (#1391) Co-authored-by: Nicolas Geissel Co-authored-by: Pierre-Gilles Leymarie --- server/services/xiaomi/lib/event/xiaomi.onMessage.js | 1 + server/test/services/xiaomi/messagesToTest.test.js | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/server/services/xiaomi/lib/event/xiaomi.onMessage.js b/server/services/xiaomi/lib/event/xiaomi.onMessage.js index edd6ca3094..621e7932b8 100644 --- a/server/services/xiaomi/lib/event/xiaomi.onMessage.js +++ b/server/services/xiaomi/lib/event/xiaomi.onMessage.js @@ -36,6 +36,7 @@ function onMessage(msg, rsinfo) { case 'sensor_cube.aqgl01': this.newValueCube(message, data); break; + case 'sensor_switch.aq2': case 'switch': this.newValueSwitch(message, data); break; diff --git a/server/test/services/xiaomi/messagesToTest.test.js b/server/test/services/xiaomi/messagesToTest.test.js index 75e7bf3545..79b1d3df7f 100644 --- a/server/test/services/xiaomi/messagesToTest.test.js +++ b/server/test/services/xiaomi/messagesToTest.test.js @@ -1,4 +1,4 @@ -/* +/* case '86sw2': this.newValueDuplexWirelessSwitch(message, data); break; @@ -88,6 +88,14 @@ const MESSAGES = [ }), }, // SWITCH + { + sid: `1245${(counter += 1)}`, + model: 'sensor_switch.aq2', + data: JSON.stringify({ + status: 'click', + voltage: 3000, + }), + }, { sid: `1245${(counter += 1)}`, model: 'switch',