From 7623a5855922893e9d47cbad755fc3236fccd794 Mon Sep 17 00:00:00 2001 From: Alex X <511909+AlexxIT@users.noreply.github.com> Date: Thu, 17 Dec 2020 19:59:29 +0300 Subject: [PATCH] Add motion to illuminance data on Aqara Motion Sensor RTCGQ11LM #1925 (#1926) --- converters/fromZigbee.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index f5aed91e12b1a..1a56a8739cfc5 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -3175,12 +3175,15 @@ const converters = { cluster: 'msIlluminanceMeasurement', type: ['attributeReport', 'readResponse'], convert: (model, msg, publish, options, meta) => { + // also trigger movement, because there is no illuminance without movement + // https://github.com/Koenkk/zigbee-herdsman-converters/issues/1925 + msg.data.occupancy = 1; + const payload = converters.occupancy_with_timeout.convert(model, msg, publish, options, meta); // DEPRECATED: only return lux here (change illuminance_lux -> illuminance) const illuminance = msg.data['measuredValue']; - return { - illuminance: calibrateAndPrecisionRoundOptions(illuminance, options, 'illuminance'), - illuminance_lux: calibrateAndPrecisionRoundOptions(illuminance, options, 'illuminance_lux'), - }; + payload.illuminance = calibrateAndPrecisionRoundOptions(illuminance, options, 'illuminance'); + payload.illuminance_lux = calibrateAndPrecisionRoundOptions(illuminance, options, 'illuminance_lux'); + return payload; }, }, xiaomi_WXKG01LM_action: {