diff --git a/esp32/Readme.md b/esp32/Readme.md index 3d408c7..56581be 100644 --- a/esp32/Readme.md +++ b/esp32/Readme.md @@ -76,7 +76,5 @@ DS18B20 one wire temp sensor ## Masterplan 2.0 * Partitionslayout - * OW-search address in topic nutzen - * Wifi bei timout deaktivieren (damit wir entweder wlan spielen oder fallback: nur pflanzen giessen) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 02d97c6..44803eb 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -242,7 +242,7 @@ void readSensors() { mPlants[i].addSenseValue(); } - delay(10); + delay(2); } /* Read the distance and give the temperature sensors some time */ @@ -559,9 +559,12 @@ void plantcontrol() if (lastPumpRunning != -1) { - //long waterDiff = waterRawSensor.getAverage() - lastWaterValue; - //TODO attribute used water in ml to plantid + long waterDiff = waterRawSensor.getAverage() - lastWaterValue; + mPlants[lastPumpRunning].setProperty("waterusage").send(String(waterDiff)); + /* TODO convert diff into volume (milli liter) */ + Serial << "Plant" << lastPumpRunning << ": Water diff " << waterDiff << " mm" << endl; } + for (int i = 0; i < MAX_PLANTS; i++) { long raw = mPlants[i].getCurrentMoisture();