Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add temp/humidity compensation algorithms #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions air-gradient-open-air.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,23 @@ sensor:
id: pm1_temperature
name: "${upper_devicename} Temperature (1)"
disabled_by_default: true
filters:
# https://forum.airgradient.com/t/outdoor-temperature-and-humidity-reading-correction/1544/19
- lambda: !lambda |-
// Remove line with (x > 6000) once the negative number issue fix is merged in https://github.com/esphome/issues/issues/3814
if (x > 6000) return ((x - 6553.6) * 1.327) - 6.738;
if (x < 10.0) return (x * 1.327) - 6.738;
return (x * 1.181) - 5.113;
humidity:
id: pm1_humidity
accuracy_decimals: 1
name: "${upper_devicename} Relative Humidity (1)"
disabled_by_default: true
filters:
# https://www.airgradient.com/blog/linear-regression-improves-sensor-accuracy/
# - lambda: return x * 1.500574 - 4.76;
# https://forum.airgradient.com/t/open-air-outdoor-air-quality-monitor-humidity-readings-are-off/1171/2
- lambda: return x * 1.3921 - 1.0245;

- platform: pmsx003
type: PMS5003T
Expand Down Expand Up @@ -583,11 +595,23 @@ sensor:
id: pm2_temperature
name: "${upper_devicename} Temperature (2)"
disabled_by_default: true
filters:
# https://forum.airgradient.com/t/outdoor-temperature-and-humidity-reading-correction/1544/19
- lambda: !lambda |-
// Remove line with (x > 6000) once the negative number issue fix is merged in https://github.com/esphome/issues/issues/3814
if (x > 6000) return ((x - 6553.6) * 1.327) - 6.738;
if (x < 10.0) return (x * 1.327) - 6.738;
return (x * 1.181) - 5.113;
humidity:
id: pm2_humidity
accuracy_decimals: 1
name: "${upper_devicename} Relative Humidity (2)"
disabled_by_default: true
filters:
# https://www.airgradient.com/blog/linear-regression-improves-sensor-accuracy/
# - lambda: return x * 1.500574 - 4.76;
# https://forum.airgradient.com/t/open-air-outdoor-air-quality-monitor-humidity-readings-are-off/1171/2
- lambda: return x * 1.3921 - 1.0245;

# Calculate the average values across both PMS5003T sensors
- platform: template
Expand Down