From ee6d31ebe88057ddc24705380416d2f2ec9bc688 Mon Sep 17 00:00:00 2001 From: Alex X <511909+AlexxIT@users.noreply.github.com> Date: Thu, 17 Dec 2020 11:05:53 +0300 Subject: [PATCH] Add motion to illuminance data on Aqara Motion Sensor RTCGQ11LM #1925 --- converters/fromZigbee.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/converters/fromZigbee.js b/converters/fromZigbee.js index 6affa5f9d3c00..d4ebd22a11935 100644 --- a/converters/fromZigbee.js +++ b/converters/fromZigbee.js @@ -3169,12 +3169,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: {