Skip to content
Snippets Groups Projects
Commit d53292d6 authored by Jan Grewe's avatar Jan Grewe
Browse files

allow EC calibration with extreme sensor readings

parent 05cd3053
No related branches found
No related tags found
No related merge requests found
......@@ -45,10 +45,12 @@ button:
- then:
- lambda: |-
float buffer_solution = -1;
if (id(ec).state > 0.9 && id(ec).state < 1.9) { // recognize 1.413us/cm buffer solution
// if (id(ec).state > 0.9 && id(ec).state < 1.9) { // recognize 1.413us/cm buffer solution
if (id(ec).state < 1.9) { // recognize 1.413us/cm buffer solution
ESP_LOGI("ec", "Calibrating EC with 1.413 mS/cm solution");
buffer_solution = 1.413 * (1.0 + 0.0185 * (id(water_temperature).state - 25.0));
} else if (id(ec).state > 9 && id(ec).state < 16.8) { // recognize 12.88ms/cm buffer solution
// } else if (id(ec).state > 9 && id(ec).state < 16.8) { // recognize 12.88ms/cm buffer solution
} else if (id(ec).state > 9) { // recognize 12.88ms/cm buffer solution
buffer_solution = 12.88 * (1.0 + 0.0185 * (id(water_temperature).state - 25.0));
ESP_LOGI("ec", "Calibrating EC with 12.88 mS/cm solution");
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment