Print Moisture measurement debugging in MQTT
This commit is contained in:
		| @@ -433,12 +433,21 @@ int determineNextPump(bool isLowLight) | |||||||
|   int pumpToUse = -1; |   int pumpToUse = -1; | ||||||
|   for (int i = 0; i < MAX_PLANTS; i++) |   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(); |     bool wateralarm = consecutiveWateringPlant[i] >= pumpIneffectiveWarning.get(); | ||||||
|     if (wateralarm) |     if (wateralarm) | ||||||
|     { |     { | ||||||
|       log(LOG_LEVEL_ERROR, String(String(i) + " Plant still dry after " + String(consecutiveWateringPlant[i]) + " watering attempts"), LOG_PUMP_INEFFECTIVE); |       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()) |     if (!plant.isPumpTriggerActive()) | ||||||
|     { |     { | ||||||
|       plant.publishState(PLANTSTATE_NUM_DEACTIVATED, PLANTSTATE_STR_DEACTIVATED); |       plant.publishState(PLANTSTATE_NUM_DEACTIVATED, PLANTSTATE_STR_DEACTIVATED); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user