I'm sorry but I'm not sure what you are doing here. Without comments or explaining the name of the elements, I don't know what each is. Plus the first line has a syntax error and the value 'fermentation' has no value assigned. There is no time delay so this will execute rapidly and 'daycounter' will be in the 10's of thousands within seconds. Have you actually run this?
The syntax error in first line is due to me not fully deleting the comments or notes section of script...and FV-1 CONTROL has since been renamed to FV-1, a bit of beer last night and I forget to rename a portion of this script. See revised
The time delay is three seconds per day, this allows me to test it without having to wait days. This will be modified when testing is complete.
I am unsure at this time if the value fermentation is redundant or not. My goal here was to allow user to change fermentation temperature with the script running and have it add to the target as the days progress. If I had used "FV-1" Target = 65, as the original script suggests, I no longer had this option. Perhaps there is a better way to achieve this? I do recall trying to use a Target + option but couldnt get it to work.
"FV-1 TEMP" Enabled = true // Enables FV INPUT Temp Sensor
"FV-1" Enabled = true // Enables FV Hysteresis
new value daycounter // Creates a new variable named daycounter
daycounter precision = 0 // Decimal places in FV DAY Inspector
reset "FV-1 TIMER" // Reset the timer (to its default of 0:00:00)
start "FV-1 TIMER" // Start the timer running
daycounter = 1 // Set the variable daycounter to one
new value fermentation // Create new value fermentation, needed to preserve auto control in the event of manually changing fermentation temperature
[Loop]
wait "FV-1 TIMER" Value >= 00:00:3 // Wait for a day to elapse
reset "FV-1 TIMER" // Reset the timer (to default of 0:00:00)
daycounter += 1 // Increase the variable daycounter by 1
if daycounter == 3
fermentation = "FV-1" target + 2 // Xth day, change the fermentation temp
"FV-1" Target = fermentation // Increase temperature
endif
if daycounter == 4
fermentation = "FV-1" target + 4 // Xth day, change the fermentation temp
"FV-1" Target = fermentation // Increase temperature for Diacetyl Rest
endif
if daycounter == 5
fermentation = "FV-1" target + 6 // Xth day, change the fermentation temp
"FV-1" Target = fermentation // Increase temperature for Diacetyl Rest
endif
if daycounter == 5 // Xth day, change the fermentation temp
"FV-1" Target = 33 // Decrease temperature for Cold Crash
endif
goto "Loop" // Go back to loop and wait again
FV-1 INPUT = SPI INPUT
FV-1 = HYSTERESIS
FV-1 TIMER = TIMER