One last post, then I'll leave you alone.
Why are you reading the temperature so many times?
float h = dht.readHumidity();
float t = dht.readTemperature();
if (dht.readTemperature() >= 20)
{
digitalWrite(Relay_1, RELAY_OFF);
}
else if (dht.readTemperature() < 18)
{
digitalWrite(Relay_1, RELAY_ON);
}
//Window fan (Relay_2) on-off temperature
if (dht.readTemperature() >= 25)
{
digitalWrite(Relay_2, RELAY_OFF);
}
else if (dht.readTemperature() < 23)
{
digitalWrite(Relay_2, RELAY_ON);
}
Where are the serial print statements to show whether the relay is to be turned on or off? What actually happens?
I know that it is frustrating when code doesn't work as you want, but, you need to remember that we can't see what you are seeing. If you don't show serial output, we can't see it. If you don't say what the relays are actually doing, we don't know.
Anyway, I wish you luck in solving your problem.