- Platform information:
Hardware: Raspberry Pi 4 4GB
OS: Openhabian 3.2_
So I created a rule, included below, to turn on a grain bin fan when several parameters are within a certain range and turn it back of when those parameters move outside their set ranges. That all appears to be working fine, so now I would like to add a “delay” after the fan turns on for 20 minutes so it either A- doesn’t check to see if it needs to turn off for 20 minutes, or B - the parameters have to be outside their ranges for 20 minutes before the fan will turn off. That way when the parameters are right on the edge, the fan doesn’t turn off and on repeatedly in a short amount of time. Either one works for me, although I prefer method B if possible. I accomplished this previously with an esp32 and Arduino IDE before transitioned to openhab, and I got it to work there, but the code is obviously a little different and I am having trouble wrapping my head around what I need to do… Thank you in advance!
rule "EMC Moisture Control" when Item EMCCornDrying received update then var Number temp = BigChief_SHT3XTemperature.state as Number var emc = EMCCornDrying.state if (emc > 14.5 && emc < 15 && temp > 0 && temp <32) //check to see if the fan needs to turn on ESP32Temp_TestSwitch.sendCommand(ON)//Turn fan on else ESP32Temp_TestSwitch.sendCommand(OFF)//turn fan off end