Help using Relays with greenhouse

but I feel like the same reading thingy is gonna happen tonight

Not if you pay attention to your brackets and your "if " "else if" linking.

void setup() {
  Serial.begin(9600);
  Serial.println("Starting demo..");
  delay(250);

}

void loop() {

  unsigned long currentdataTime = millis();
  static unsigned long startdataTime = 0;
  
  if (startdataTime == 0)
  {
    Serial.println("Starting 5 second timing interval");
    startdataTime = millis();
  }

//uncomment this to see it fail the timing
//int t = 27;
//if ( t >28)
//{
//do something
//}

  else if (currentdataTime - startdataTime > 5000)
  {
    Serial.println("ending 5 second timing interval");
    startdataTime = 0;
  }

}