Skip to content

Commit

Permalink
Filter non-realistic WSDCGQ11LM and WSDCGQ01LM temperature reports. K…
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk authored and qosmio committed Dec 25, 2019
1 parent e2d6444 commit 9bdebcd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,20 @@ const converters = {
}
},
},
xiaomi_temperature: {
cid: 'msTemperatureMeasurement',
type: 'attReport',
convert: (model, msg, publish, options) => {
const temperature = parseFloat(msg.data.data['measuredValue']) / 100.0;

// https://github.com/Koenkk/zigbee2mqtt/issues/798
// Sometimes the sensor publishes non-realistic vales, as the sensor only works from
// -20 till +60, don't produce messages beyond these values.
if (temperature > -25 && temperature < 65) {
return {temperature: precisionRoundOptions(temperature, options, 'temperature')};
}
},
},
MFKZQ01LM_action_multistate: {
cluster: 'genMultistateInput',
type: ['attributeReport', 'readResponse'],
Expand Down

0 comments on commit 9bdebcd

Please sign in to comment.