Skip to content

Commit

Permalink
Update full configs and compiled .bin
Browse files Browse the repository at this point in the history
  • Loading branch information
MallocArray committed Jul 15, 2024
1 parent 1f99a6a commit 0265a2e
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 52 deletions.
Binary file modified airgradient-basic.bin
Binary file not shown.
Binary file modified airgradient-one.bin
Binary file not shown.
Binary file modified airgradient-open-air-o-1ppt.bin
Binary file not shown.
Binary file modified airgradient-open-air-o-1pst.bin
Binary file not shown.
Binary file modified airgradient-pro.bin
Binary file not shown.
22 changes: 14 additions & 8 deletions full_config/ag-basic.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
substitutions:
config_version: 4.0.0
config_version: 4.0.1
co2_offset: '0'
name: ag-basic
friendly_name: AG Basic
Expand All @@ -10,7 +10,7 @@ esphome:
name_add_mac_suffix: false
project:
name: mallocarray.airgradient
version: 4.0.0
version: 4.0.1
min_version: 2024.6.0
on_boot:
- priority: 200.0
Expand Down Expand Up @@ -134,18 +134,24 @@ sensor:
device_class: pm25
filters:
- lambda: !lambda |-
float result = 0.0;
if (x == 0.0) {
return 0.0;
result = 0.0;
} else if (x < 30.0) {
return((0.524 * x) - (0.0862 * id(humidity).state) + 5.75);
result = (0.524 * x) - (0.0862 * id(humidity).state) + 5.75;
} else if (x < 50.0) {
return((0.786 * (x / 20 - 3/2) + 0.524 * (1 - (x / 20 - 3/2))) * x - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * (x / 20 - 3/2) + 0.524 * (1 - (x / 20 - 3/2))) * x - (0.0862 * id(humidity).state) + 5.75;
} else if (x < 210.0) {
return((0.786 * x) - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * x) - (0.0862 * id(humidity).state) + 5.75;
} else if (x < 260.0) {
return((0.69 * (x / 50 - 21/5) + 0.786 * (1 - (x / 50 - 21/5))) * x - (0.0862 * id(humidity).state * (1 - (x / 50 - 21/5))) + (2.966 * (x / 50 - 21/5)) + (5.75 * (1 - (x / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(x,2) * (x / 50 - 21/5)));
result = (0.69 * (x / 50 - 21/5) + 0.786 * (1 - (x / 50 - 21/5))) * x - (0.0862 * id(humidity).state * (1 - (x / 50 - 21/5))) + (2.966 * (x / 50 - 21/5)) + (5.75 * (1 - (x / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(x,2) * (x / 50 - 21/5));
} else {
return(2.966 + (0.69 * x) + (8.84 * pow(10,-4) * pow(x,2)));
result = 2.966 + (0.69 * x) + (8.84 * pow(10,-4) * pow(x,2));
}
if (result <= 0.0) {
return 0.0;
} else {
return result;
}
disabled_by_default: false
force_update: false
Expand Down
28 changes: 17 additions & 11 deletions full_config/ag-one.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
substitutions:
config_version: 4.0.0
config_version: 4.0.1
co2_offset: '0'
voc_learning_time_offset_hours: '12'
nox_learning_time_offset_hours: '12'
Expand All @@ -16,7 +16,7 @@ esphome:
name_add_mac_suffix: false
project:
name: mallocarray.airgradient
version: 4.0.0
version: 4.0.1
min_version: 2024.6.0
on_boot:
- priority: 200.0
Expand Down Expand Up @@ -146,18 +146,24 @@ sensor:
device_class: pm25
filters:
- lambda: !lambda |-
float result = 0.0;
if (x == 0.0) {
return 0.0;
result = 0.0;
} else if (x < 30.0) {
return((0.524 * x) - (0.0862 * id(humidity).state) + 5.75);
result = (0.524 * x) - (0.0862 * id(humidity).state) + 5.75;
} else if (x < 50.0) {
return((0.786 * (x / 20 - 3/2) + 0.524 * (1 - (x / 20 - 3/2))) * x - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * (x / 20 - 3/2) + 0.524 * (1 - (x / 20 - 3/2))) * x - (0.0862 * id(humidity).state) + 5.75;
} else if (x < 210.0) {
return((0.786 * x) - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * x) - (0.0862 * id(humidity).state) + 5.75;
} else if (x < 260.0) {
return((0.69 * (x / 50 - 21/5) + 0.786 * (1 - (x / 50 - 21/5))) * x - (0.0862 * id(humidity).state * (1 - (x / 50 - 21/5))) + (2.966 * (x / 50 - 21/5)) + (5.75 * (1 - (x / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(x,2) * (x / 50 - 21/5)));
result = (0.69 * (x / 50 - 21/5) + 0.786 * (1 - (x / 50 - 21/5))) * x - (0.0862 * id(humidity).state * (1 - (x / 50 - 21/5))) + (2.966 * (x / 50 - 21/5)) + (5.75 * (1 - (x / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(x,2) * (x / 50 - 21/5));
} else {
return(2.966 + (0.69 * x) + (8.84 * pow(10,-4) * pow(x,2)));
result = 2.966 + (0.69 * x) + (8.84 * pow(10,-4) * pow(x,2));
}
if (result <= 0.0) {
return 0.0;
} else {
return result;
}
disabled_by_default: false
force_update: false
Expand Down Expand Up @@ -799,7 +805,7 @@ display:
lambda: !lambda |-
it.printf(0, 0, id(open_sans_14), "ID:");
it.printf(128, 0, id(open_sans_14), TextAlign::TOP_RIGHT, "%s", get_mac_address().c_str());
it.printf(0, 21, id(open_sans_14), "Config Ver: 4.0.0");
it.printf(0, 21, id(open_sans_14), "Config Ver: 4.0.1");
it.printf(0, 42, id(open_sans_14), "AG One");
- id: summary1
lambda: !lambda |-
Expand Down Expand Up @@ -1259,9 +1265,9 @@ binary_sensor:
then:
- logger.log:
format: Toggling display betwen C and F
tag: main
args: []
level: DEBUG
tag: main
- switch.toggle:
id: display_in_f
invalid_cooldown: 1s
Expand All @@ -1274,9 +1280,9 @@ binary_sensor:
then:
- logger.log:
format: Starting manual CO2 calibration
tag: main
args: []
level: DEBUG
tag: main
- senseair.background_calibration:
id: senseair_s8
- delay: 70s
Expand Down
40 changes: 26 additions & 14 deletions full_config/ag-open-air-o-1ppt.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
substitutions:
config_version: 4.0.0
config_version: 4.0.1
voc_learning_time_offset_hours: '12'
nox_learning_time_offset_hours: '12'
name: ag-open-air-o-1ppt
Expand All @@ -11,7 +11,7 @@ esphome:
name_add_mac_suffix: false
project:
name: mallocarray.airgradient
version: 4.0.0
version: 4.0.1
min_version: 2024.6.0
on_boot:
- priority: 200.0
Expand Down Expand Up @@ -236,18 +236,24 @@ sensor:
accuracy_decimals: 0
state_class: measurement
lambda: !lambda |-
float result = 0.0;
if (id(pm_2_5_raw).state == 0.0) {
return 0.0;
result = 0.0;
} else if (id(pm_2_5_raw).state < 30.0) {
return((0.524 * id(pm_2_5_raw).state) - (0.0862 * id(humidity).state) + 5.75);
result = (0.524 * id(pm_2_5_raw).state) - (0.0862 * id(humidity).state) + 5.75;
} else if (id(pm_2_5_raw).state < 50.0) {
return((0.786 * (id(pm_2_5_raw).state / 20 - 3/2) + 0.524 * (1 - (id(pm_2_5_raw).state / 20 - 3/2))) * id(pm_2_5_raw).state - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * (id(pm_2_5_raw).state / 20 - 3/2) + 0.524 * (1 - (id(pm_2_5_raw).state / 20 - 3/2))) * id(pm_2_5_raw).state - (0.0862 * id(humidity).state) + 5.75;
} else if (id(pm_2_5_raw).state < 210.0) {
return((0.786 * id(pm_2_5_raw).state) - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * id(pm_2_5_raw).state) - (0.0862 * id(humidity).state) + 5.75;
} else if (id(pm_2_5_raw).state < 260.0) {
return((0.69 * (id(pm_2_5_raw).state / 50 - 21/5) + 0.786 * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) * id(pm_2_5_raw).state - (0.0862 * id(humidity).state * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) + (2.966 * (id(pm_2_5_raw).state / 50 - 21/5)) + (5.75 * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(id(pm_2_5_raw).state,2) * (id(pm_2_5_raw).state / 50 - 21/5)));
result = (0.69 * (id(pm_2_5_raw).state / 50 - 21/5) + 0.786 * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) * id(pm_2_5_raw).state - (0.0862 * id(humidity).state * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) + (2.966 * (id(pm_2_5_raw).state / 50 - 21/5)) + (5.75 * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(id(pm_2_5_raw).state,2) * (id(pm_2_5_raw).state / 50 - 21/5));
} else {
return(2.966 + (0.69 * id(pm_2_5_raw).state) + (8.84 * pow(10,-4) * pow(id(pm_2_5_raw).state,2)));
result = 2.966 + (0.69 * id(pm_2_5_raw).state) + (8.84 * pow(10,-4) * pow(id(pm_2_5_raw).state,2));
}
if (result <= 0.0) {
return 0.0;
} else {
return result;
}
disabled_by_default: false
force_update: false
Expand Down Expand Up @@ -394,18 +400,24 @@ sensor:
accuracy_decimals: 0
state_class: measurement
lambda: !lambda |-
float result = 0.0;
if (id(pm_2_5_2_raw).state == 0.0) {
return 0.0;
result = 0.0;
} else if (id(pm_2_5_2_raw).state < 30.0) {
return((0.524 * id(pm_2_5_2_raw).state) - (0.0862 * id(humidity).state) + 5.75);
result = (0.524 * id(pm_2_5_2_raw).state) - (0.0862 * id(humidity).state) + 5.75;
} else if (id(pm_2_5_2_raw).state < 50.0) {
return((0.786 * (id(pm_2_5_2_raw).state / 20 - 3/2) + 0.524 * (1 - (id(pm_2_5_2_raw).state / 20 - 3/2))) * id(pm_2_5_2_raw).state - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * (id(pm_2_5_2_raw).state / 20 - 3/2) + 0.524 * (1 - (id(pm_2_5_2_raw).state / 20 - 3/2))) * id(pm_2_5_2_raw).state - (0.0862 * id(humidity).state) + 5.75;
} else if (id(pm_2_5_2_raw).state < 210.0) {
return((0.786 * id(pm_2_5_2_raw).state) - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * id(pm_2_5_2_raw).state) - (0.0862 * id(humidity).state) + 5.75;
} else if (id(pm_2_5_2_raw).state < 260.0) {
return((0.69 * (id(pm_2_5_2_raw).state / 50 - 21/5) + 0.786 * (1 - (id(pm_2_5_2_raw).state / 50 - 21/5))) * id(pm_2_5_2_raw).state - (0.0862 * id(humidity).state * (1 - (id(pm_2_5_2_raw).state / 50 - 21/5))) + (2.966 * (id(pm_2_5_2_raw).state / 50 - 21/5)) + (5.75 * (1 - (id(pm_2_5_2_raw).state / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(id(pm_2_5_2_raw).state,2) * (id(pm_2_5_2_raw).state / 50 - 21/5)));
result = (0.69 * (id(pm_2_5_2_raw).state / 50 - 21/5) + 0.786 * (1 - (id(pm_2_5_2_raw).state / 50 - 21/5))) * id(pm_2_5_2_raw).state - (0.0862 * id(humidity).state * (1 - (id(pm_2_5_2_raw).state / 50 - 21/5))) + (2.966 * (id(pm_2_5_2_raw).state / 50 - 21/5)) + (5.75 * (1 - (id(pm_2_5_2_raw).state / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(id(pm_2_5_2_raw).state,2) * (id(pm_2_5_2_raw).state / 50 - 21/5));
} else {
return(2.966 + (0.69 * id(pm_2_5_2_raw).state) + (8.84 * pow(10,-4) * pow(id(pm_2_5_2_raw).state,2)));
result = 2.966 + (0.69 * id(pm_2_5_2_raw).state) + (8.84 * pow(10,-4) * pow(id(pm_2_5_2_raw).state,2));
}
if (result <= 0.0) {
return 0.0;
} else {
return result;
}
disabled_by_default: false
force_update: false
Expand Down
22 changes: 14 additions & 8 deletions full_config/ag-open-air-o-1pst.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
substitutions:
config_version: 4.0.0
config_version: 4.0.1
co2_offset: '0'
voc_learning_time_offset_hours: '12'
nox_learning_time_offset_hours: '12'
Expand All @@ -12,7 +12,7 @@ esphome:
name_add_mac_suffix: false
project:
name: mallocarray.airgradient
version: 4.0.0
version: 4.0.1
min_version: 2024.6.0
on_boot:
- priority: 200.0
Expand Down Expand Up @@ -237,18 +237,24 @@ sensor:
accuracy_decimals: 0
state_class: measurement
lambda: !lambda |-
float result = 0.0;
if (id(pm_2_5_raw).state == 0.0) {
return 0.0;
result = 0.0;
} else if (id(pm_2_5_raw).state < 30.0) {
return((0.524 * id(pm_2_5_raw).state) - (0.0862 * id(humidity).state) + 5.75);
result = (0.524 * id(pm_2_5_raw).state) - (0.0862 * id(humidity).state) + 5.75;
} else if (id(pm_2_5_raw).state < 50.0) {
return((0.786 * (id(pm_2_5_raw).state / 20 - 3/2) + 0.524 * (1 - (id(pm_2_5_raw).state / 20 - 3/2))) * id(pm_2_5_raw).state - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * (id(pm_2_5_raw).state / 20 - 3/2) + 0.524 * (1 - (id(pm_2_5_raw).state / 20 - 3/2))) * id(pm_2_5_raw).state - (0.0862 * id(humidity).state) + 5.75;
} else if (id(pm_2_5_raw).state < 210.0) {
return((0.786 * id(pm_2_5_raw).state) - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * id(pm_2_5_raw).state) - (0.0862 * id(humidity).state) + 5.75;
} else if (id(pm_2_5_raw).state < 260.0) {
return((0.69 * (id(pm_2_5_raw).state / 50 - 21/5) + 0.786 * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) * id(pm_2_5_raw).state - (0.0862 * id(humidity).state * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) + (2.966 * (id(pm_2_5_raw).state / 50 - 21/5)) + (5.75 * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(id(pm_2_5_raw).state,2) * (id(pm_2_5_raw).state / 50 - 21/5)));
result = (0.69 * (id(pm_2_5_raw).state / 50 - 21/5) + 0.786 * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) * id(pm_2_5_raw).state - (0.0862 * id(humidity).state * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) + (2.966 * (id(pm_2_5_raw).state / 50 - 21/5)) + (5.75 * (1 - (id(pm_2_5_raw).state / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(id(pm_2_5_raw).state,2) * (id(pm_2_5_raw).state / 50 - 21/5));
} else {
return(2.966 + (0.69 * id(pm_2_5_raw).state) + (8.84 * pow(10,-4) * pow(id(pm_2_5_raw).state,2)));
result = 2.966 + (0.69 * id(pm_2_5_raw).state) + (8.84 * pow(10,-4) * pow(id(pm_2_5_raw).state,2));
}
if (result <= 0.0) {
return 0.0;
} else {
return result;
}
disabled_by_default: false
force_update: false
Expand Down
28 changes: 17 additions & 11 deletions full_config/ag-pro.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
substitutions:
config_version: 4.0.0
config_version: 4.0.1
co2_offset: '0'
voc_learning_time_offset_hours: '12'
nox_learning_time_offset_hours: '12'
Expand All @@ -12,7 +12,7 @@ esphome:
name_add_mac_suffix: false
project:
name: mallocarray.airgradient
version: 4.0.0
version: 4.0.1
min_version: 2024.6.0
on_boot:
- priority: 200.0
Expand Down Expand Up @@ -136,18 +136,24 @@ sensor:
device_class: pm25
filters:
- lambda: !lambda |-
float result = 0.0;
if (x == 0.0) {
return 0.0;
result = 0.0;
} else if (x < 30.0) {
return((0.524 * x) - (0.0862 * id(humidity).state) + 5.75);
result = (0.524 * x) - (0.0862 * id(humidity).state) + 5.75;
} else if (x < 50.0) {
return((0.786 * (x / 20 - 3/2) + 0.524 * (1 - (x / 20 - 3/2))) * x - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * (x / 20 - 3/2) + 0.524 * (1 - (x / 20 - 3/2))) * x - (0.0862 * id(humidity).state) + 5.75;
} else if (x < 210.0) {
return((0.786 * x) - (0.0862 * id(humidity).state) + 5.75);
result = (0.786 * x) - (0.0862 * id(humidity).state) + 5.75;
} else if (x < 260.0) {
return((0.69 * (x / 50 - 21/5) + 0.786 * (1 - (x / 50 - 21/5))) * x - (0.0862 * id(humidity).state * (1 - (x / 50 - 21/5))) + (2.966 * (x / 50 - 21/5)) + (5.75 * (1 - (x / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(x,2) * (x / 50 - 21/5)));
result = (0.69 * (x / 50 - 21/5) + 0.786 * (1 - (x / 50 - 21/5))) * x - (0.0862 * id(humidity).state * (1 - (x / 50 - 21/5))) + (2.966 * (x / 50 - 21/5)) + (5.75 * (1 - (x / 50 - 21/5))) + (8.84 * pow(10,-4) * pow(x,2) * (x / 50 - 21/5));
} else {
return(2.966 + (0.69 * x) + (8.84 * pow(10,-4) * pow(x,2)));
result = 2.966 + (0.69 * x) + (8.84 * pow(10,-4) * pow(x,2));
}
if (result <= 0.0) {
return 0.0;
} else {
return result;
}
disabled_by_default: false
force_update: false
Expand Down Expand Up @@ -744,7 +750,7 @@ display:
lambda: !lambda |-
it.printf(0, 0, id(open_sans_14), "ID:");
it.printf(128, 0, id(open_sans_14), TextAlign::TOP_RIGHT, "%s", get_mac_address().c_str());
it.printf(0, 21, id(open_sans_14), "Config Ver: 4.0.0");
it.printf(0, 21, id(open_sans_14), "Config Ver: 4.0.1");
it.printf(0, 42, id(open_sans_14), "AG Pro");
- id: blank
lambda: !lambda |-
Expand Down Expand Up @@ -914,8 +920,8 @@ binary_sensor:
- logger.log:
format: Toggling display betwen C and F
level: DEBUG
tag: main
args: []
tag: main
- switch.toggle:
id: display_in_f
invalid_cooldown: 1s
Expand All @@ -929,8 +935,8 @@ binary_sensor:
- logger.log:
format: Starting manual CO2 calibration
level: DEBUG
tag: main
args: []
tag: main
- senseair.background_calibration:
id: senseair_s8
- delay: 70s
Expand Down

0 comments on commit 0265a2e

Please sign in to comment.