Skip to content

Commit a5e9834

Browse files
committed
Cap humidity correction to 100 and add icons
1 parent a6546cb commit a5e9834

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

packages/sensor_pms5003t.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ sensor:
3838
temperature:
3939
name: "Temperature"
4040
id: temp
41+
icon: "mdi:thermometer"
4142
filters:
4243
# https://forum.airgradient.com/t/outdoor-temperature-and-humidity-reading-correction/1544/19
4344
- lambda: !lambda |-
@@ -51,9 +52,14 @@ sensor:
5152
humidity:
5253
name: "Humidity"
5354
id: humidity
55+
icon: "mdi:water-percent"
5456
filters:
55-
# Compensation algorithm from AirGradient's research
56-
- lambda: return x * 1.259 + 7.34;
57+
# Compensation algorithm from AirGradient's research 2024-02-29
58+
# Ensuring max is 100% as calculation can exceed
59+
- lambda: |-
60+
float result = x * 1.259f + 7.34f;
61+
if (result > 100) return 100;
62+
return result;
5763
- sliding_window_moving_average:
5864
window_size: 30
5965
send_every: 30

packages/sensor_pms5003t_2.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ sensor:
3939
temperature:
4040
name: "Temperature (2)"
4141
id: temp_2
42+
icon: "mdi:thermometer"
4243
filters:
4344
# https://forum.airgradient.com/t/outdoor-temperature-and-humidity-reading-correction/1544/19
4445
- lambda: !lambda |-
@@ -52,9 +53,14 @@ sensor:
5253
humidity:
5354
name: "Humidity (2)"
5455
id: humidity_2
56+
icon: "mdi:water-percent"
5557
filters:
56-
# Compensation algorithm from AirGradient's research
57-
- lambda: return x * 1.259 + 7.34;
58+
# Compensation algorithm from AirGradient's research 2024-02-29
59+
# Ensuring max is 100% as calculation can exceed
60+
- lambda: |-
61+
float result = x * 1.259f + 7.34f;
62+
if (result > 100) return 100;
63+
return result;
5864
- sliding_window_moving_average:
5965
window_size: 30
6066
send_every: 30

packages/sensor_pms5003t_2_extended_life.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ sensor:
2525
temperature:
2626
name: "Temperature (2)"
2727
id: temp_2
28+
icon: "mdi:thermometer"
2829
filters:
2930
# https://forum.airgradient.com/t/outdoor-temperature-and-humidity-reading-correction/1544/19
3031
- lambda: !lambda |-
@@ -35,9 +36,14 @@ sensor:
3536
humidity:
3637
name: "Humidity (2)"
3738
id: humidity_2
39+
icon: "mdi:water-percent"
3840
filters:
39-
# Compensation algorithm from AirGradient's research
40-
- lambda: return x * 1.259 + 7.34;
41+
# Compensation algorithm from AirGradient's research 2024-02-29
42+
# Ensuring max is 100% as calculation can exceed
43+
- lambda: |-
44+
float result = x * 1.259f + 7.34f;
45+
if (result > 100) return 100;
46+
return result;
4147
update_interval: $pm_update_interval
4248

4349
# Average the readings from both sensors to return a value

packages/sensor_pms5003t_extended_life.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ sensor:
2525
temperature:
2626
name: "Temperature"
2727
id: temp
28+
icon: "mdi:thermometer"
2829
filters:
2930
# https://forum.airgradient.com/t/outdoor-temperature-and-humidity-reading-correction/1544/19
3031
- lambda: !lambda |-
@@ -35,9 +36,14 @@ sensor:
3536
humidity:
3637
name: "Humidity"
3738
id: humidity
39+
icon: "mdi:water-percent"
3840
filters:
39-
# Compensation algorithm from AirGradient's research
40-
- lambda: return x * 1.259 + 7.34;
41+
# Compensation algorithm from AirGradient's research 2024-02-29
42+
# Ensuring max is 100% as calculation can exceed
43+
- lambda: |-
44+
float result = x * 1.259f + 7.34f;
45+
if (result > 100) return 100;
46+
return result;
4147
update_interval: $pm_update_interval
4248

4349

packages/sensor_pms5003t_uncorrected.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ sensor:
3838
temperature:
3939
name: "Temperature"
4040
id: temp
41+
icon: "mdi:thermometer"
4142
filters:
4243
- sliding_window_moving_average:
4344
window_size: 30
4445
send_every: 30
4546
humidity:
4647
name: "Humidity"
4748
id: humidity
49+
icon: "mdi:water-percent"
4850
filters:
4951
- sliding_window_moving_average:
5052
window_size: 30

0 commit comments

Comments
 (0)