DHT22 Refrigerator "range", with code, need help!

Hi all, I'm having an issue with my refrigerator I've made with Arduino. Basically it does work perfectly but I would like to add a "delay" to one of its functions. The RELAY1 (see code) does work when Temp is 25* and it's ok, but as soon as it goes down to 24 the refrigerator stop. It is actually doing what the code says but I want it this way:

temp goes 25 - refr. on - temp goes down to max 20 deg - refr. off - temp goes up again to 25 in a couple of hour - repeat

what should I change in my code?

note: all the other function must work while the first one is still "delaying" itself

 if(t >= 25)
  {
    digitalWrite(RELAY1, LOW);}
  else
  {
    digitalWrite(RELAY1, HIGH); }
    static boolean running = false;
    
    if(t >=  25 && running == false)
    {
        digitalWrite(RELAY1, HIGH);
        running = true;
    }
    else if(t <= 20 && running == true)
    {
        digitalWrite(RELAY1, LOW);
        running = false;
    }

Does this code help?

I’ll try ands let you know in a couple of hours

EDIT: It works! Thank you very very much!

groundfungus: Does this code help?

Kinda scary, that your code was a complex idea.

Chuck.

chucktodd: Kinda scary, that your code was a complex idea.

Chuck.

what do you mean?