From 1cc46a360b7f7da5d7d05d3b577d7b4a3ddc0805 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 26 Apr 2023 08:33:12 +0200 Subject: [PATCH] fixed not watering when water is left --- esp32/src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 5a37f30..aea2784 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -1118,7 +1118,8 @@ bool isLowLight = (mSolarVoltage <= SOLAR_CHARGE_MAX_VOLTAGE); bool hasWater = true; // By default activate the pump if (waterRawSensor.getCount() > 0) { - hasWater = ( (waterLevelMax.get() - waterRawSensor.getAverage()) > waterLevelMin.get() ); + //surface of water is still nearer the sensor than required to cover the pumps + hasWater = waterRawSensor.getAverage() < waterLevelMin.get(); } // FIXME no water warning message