I am using version mega-20190305
This is a home brew beer fermentation chamber controller.
I need a 15 minute timeout after the fridge compressor turns off before it gets turned on again.
The rules below work once after boot when the temp rises above 18 degrees but once the temperature drops below 18 degrees the fridge turns off and never turns on again when temperature rises.
Code: Select all
On System#Boot do //Not sure if this needed ? - Used to set timer expired flag 10 seconds after boot
timerSet,1,10
endon
On Fermenter_Temp#Fermenter_Temperature<17 do // turn on heater
gpio,12,0
gpio,14,1
Publish /FermoStat/gpio/14,1
endon
On Fermenter_Temp#Fermenter_Temperature do
if [Fermenter_Temp#Fermenter_Temperature]>18 and [Rules#Timer]=1 //=1 checks if timer has expired then turn on fridge
gpio,14,0
gpio,12,1
Publish /FermoStat/gpio/12,1
endif
endon
On Fermenter_Temp#Fermenter_Temperature>17 do // turn off heater
gpio,14,0
Publish /FermoStat/gpio/14,0
endon
On Fermenter_Temp#Fermenter_Temperature<18 do // turn off fridge
gpio,12,0
Publish /FermoStat/gpio/12,0
timerSet,1,900 //set timer 1 for 900 seconds (15 minutes)
endon