From 48e5383106e8a8a0b813474c76e6a413fb2e092f Mon Sep 17 00:00:00 2001 From: Ollo Date: Mon, 1 Apr 2024 13:02:26 +0200 Subject: [PATCH] Print Moisture measurement debugging in MQTT --- esp32/src/main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index f9d7d5a..9f3165e 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -433,12 +433,21 @@ int determineNextPump(bool isLowLight) int pumpToUse = -1; for (int i = 0; i < MAX_PLANTS; i++) { + Plant plant = mPlants[i]; + switch (plant.getSensorMode()) + { + case FREQUENCY_MOD_RESISTANCE_PROBE: + log(LOG_LEVEL_DEBUG, + String("Plant " + String(i) + " measurement: " + String(plant.getCurrentMoistureRaw()) + " hz " + String(plant.getCurrentMoisturePCT()) + "%"), + LOG_DEBUG_CODE); + break; + } + bool wateralarm = consecutiveWateringPlant[i] >= pumpIneffectiveWarning.get(); if (wateralarm) { log(LOG_LEVEL_ERROR, String(String(i) + " Plant still dry after " + String(consecutiveWateringPlant[i]) + " watering attempts"), LOG_PUMP_INEFFECTIVE); } - Plant plant = mPlants[i]; if (!plant.isPumpTriggerActive()) { plant.publishState(PLANTSTATE_NUM_DEACTIVATED, PLANTSTATE_STR_DEACTIVATED);