Skip to content

Commit

Permalink
Add motion to illuminance data on Aqara Motion Sensor RTCGQ11LM #1925 (
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT authored Dec 17, 2020
1 parent 60f8a28 commit 7623a58
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 7623a58

Please sign in to comment.