main/automation.c

changeset 126
e133a292ad21
parent 121
30aca5888d2b
--- a/main/automation.c	Sun Jan 14 11:19:19 2024 +0100
+++ b/main/automation.c	Tue Jan 16 09:51:55 2024 +0100
@@ -656,7 +656,8 @@
                 if (MashState == MASH_NONE) {
 		    if (runtime.MashStep == 0 && ! runtime.MaltAdded && recipe.MashStep[0].Infuse_temp) {
 			stageTemp = recipe.MashStep[0].Infuse_temp;
-		    } else {
+		    } else if (recipe.MashStep[runtime.MashStep].Type != MASHTYPE_DECOCTION) {
+			/* Only change temperature if not doing decoction */
                     	stageTemp = recipe.MashStep[runtime.MashStep].Step_temp;
 		    }
                     stageTime = recipe.MashStep[runtime.MashStep].Step_time;
@@ -671,7 +672,7 @@
                     ws_server_send_text_clients((char *)"/ws", msg, strlen(msg));
                     log_msg(TAG, "Mash step %d type: %s time: %d sp: %6.4f-%6.4f sv: %6.4f",
 				    runtime.MashStep, mashTypes[recipe.MashStep[runtime.MashStep].Type],
-                                    stageTime, stageTemp, recipe.MashStep[runtime.MashStep].End_temp, temp_MLT);
+                                    stageTime, recipe.MashStep[runtime.MashStep].Step_temp, recipe.MashStep[runtime.MashStep].End_temp, temp_MLT);
 
 		    if (runtime.MashStep) {
 			// Do not annotate before the log is open.
@@ -969,13 +970,17 @@
 			case 1:
 #ifdef CONFIG_TEMP_SENSORS_SIMULATOR
 				    if (MashState == MASH_DECOCT) {
-					Fake_MLT = recipe.MashStep[runtime.MashStep].Step_temp - 0.72; // Fake the decoction amt.
+					temp_MLT = Fake_MLT = recipe.MashStep[runtime.MashStep].Step_temp - 0.72; // Fake the decoction amt.
 					if (xSemaphoreTake(xSemaphoreDS18B20, 10) == pdTRUE) {
 					    ds18b20_state->mlt_temperature = ((int)(Fake_MLT * 16)) / 16.0;
 					    xSemaphoreGive(xSemaphoreDS18B20);
 					}
 				    }
 #endif
+				    if (MashState == MASH_DECOCT) {
+					/* After decoction set the desired step temperature */
+				    	stageTemp = recipe.MashStep[runtime.MashStep].Step_temp;
+				    }
 				    if (xSemaphoreTake(xSemaphoreDriver, 10) == pdTRUE) {
 					// Start PID again.
 					driver_state->mlt_sp = stageTemp;
@@ -989,10 +994,11 @@
 				    Buttons_Show();
 				    TFT_fillRect(65, 120, 190, 40, TFT_BLACK);
 				    if (MashState == MASH_INFUSE) {
-					log_msg(TAG, "Eind infusie");
+					log_msg(TAG, "End infusion");
 				    	log_annotation(ANNOTATION_EVENT, (char *)"Eind infusie");
 				    } else {
-					log_msg(TAG, "Eind decoctie");
+					log_msg(TAG, "End decoction, sp: %6.4f-%6.4f sv: %6.4f",
+                                                recipe.MashStep[runtime.MashStep].Step_temp, recipe.MashStep[runtime.MashStep].End_temp, temp_MLT);
 					log_annotation(ANNOTATION_EVENT, (char *)"Eind decoctie");
 				    }
 				    MashState = Sub_Screen = MASH_WAITTEMP;

mercurial