Skip to content

Commit

Permalink
fix(ignore): Try to fix unrealistic pressure readings from WSDCGQ12LM. (
Browse files Browse the repository at this point in the history
  • Loading branch information
rotdrop committed Mar 25, 2024
1 parent 275f06f commit 2b1dd8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/devices/lumi.ts
Expand Up @@ -1202,7 +1202,7 @@ const definitions: Definition[] = [
vendor: 'Aqara',
description: 'Temperature and humidity sensor T1',
whiteLabel: [{vendor: 'Aqara', model: 'TH-S02D'}],
fromZigbee: [lumi.fromZigbee.lumi_specific, fz.temperature, fz.humidity, fz.pressure, fz.battery],
fromZigbee: [lumi.fromZigbee.lumi_specific, fz.temperature, fz.humidity, lumi.fromZigbee.lumi_pressure, fz.battery],
toZigbee: [],
exposes: [e.temperature(), e.humidity(), e.pressure(), e.device_temperature(), e.battery(), e.battery_voltage(),
e.power_outage_count(false)],
Expand Down
10 changes: 10 additions & 0 deletions src/lib/lumi.ts
Expand Up @@ -2022,6 +2022,16 @@ export const fromZigbee = {
}
},
} satisfies Fz.Converter,
lumi_pressure: {
cluster: 'msPressureMeasurement',
type: ['attributeReport', 'readResponse'],
convert: async (model, msg, publish, options, meta) => {
const result = await fz.pressure.convert(model, msg, publish, options, meta);
if (result && result.pressure > 500 && result.pressure < 2000) {
return result;
}
},
} satisfies Fz.Converter,

// lumi class specific
lumi_feeder: {
Expand Down

0 comments on commit 2b1dd8a

Please sign in to comment.