I think this would work:
As
@BrunDog said, you cannot use on/off with a hysteresis device. They have no state property, only the enabled property for On/Off.
[start]
Beer_Temp" Enabled = true
"Set_Temp" Enabled = true // enables temperature setting global element
new value High_Temp // creates a new variable named High_Temp
new value Low_Temp // creates a new variable named Low_Temp
[loop]
High_Temp = "Set_Temp" Value + 1 // sets high temp trigger as setpoint + 1 deg
Low_Temp = "Set_Temp" Value - 1 // sets low temp trigger as setpoint - 1 deg
if "Beer_Temp" Value > High_Temp
"Fridge" Enabled = true
"Heat" Enabled = false
else
"Fridge" Enabled = false
endif
if "Beer_Temp" Value < Low_Temp
"Fridge" Enabled = false
"Heat" Enabled = true
else
"Heat" Enabled = false
endif
goto "loop"
I had this in it as well but I do not think you need it:
if "Beer_Temp" Value < High_Temp
if "Beer_Temp" Value > Low_Temp
"Heat" Enabled = false
"Fridge" Enabled = false
endif
endif
Generally, your compressor device (Fridge) should not cycle less than 12 minutes apart as a general rule of thumb for short cycling. It is hard to find a good definition of "short cycle" in terms of minutes as to what a short cycle is, but 5 times in an hour (60/5=12) is the lowest number I have seen. Some suggest 4 times for a 15 minutes period between cycles. You should time your cycles and add some delay if needed. The time for a short cycle may be in the manual for the fridge.