I'm so stuck, been at this for hours. I've added a float as that's what i did with the temp/humidity. I've tried so many variations even the one you gave kenwood. Tried without 'else if p', tried without float, even gave an hour each side so i didn't get the hysteresis thing going on.
float p = now.hour();
if (p > 0 && p < 15)
{
if (t > 32 || h > 72)
{
digitalWrite(Relay1, LOW);
} else if (p < 23 && p > 16)
if (t < 28 || h < 68 )
digitalWrite(Relay1, HIGH);
}
}