 
   }
 
-  if ((( millis() - lastRelayActionmillis) > 30000 ) && ( relayIsReady == LOW ) && ( relaystatus == oldrelaystatus ))
+  if ((( millis() - lastRelayActionmillis) > BETWEEN_RELAY_ACTIVE ) && ( relayIsReady == LOW ) && ( relaystatus == oldrelaystatus ))
   {
+
+    if (DEBUG_PRINT) {
+      Serial.print("after BETWEEN_RELAY_ACTIVE => relaystatus => ");
+      Serial.println(relaystatus);
+    }
 
     String lightpayload = "{\"LIGHT\":";
     lightpayload += relaystatus;


  if ( relaystatus != oldrelaystatus ) {

    changelight();

    String lightpayload = "{\"LIGHT\":";
    lightpayload += relaystatus;


  if (DEBUG_PRINT) {
    Serial.print(" => ");
    Serial.print("checking relay status changelight --> ");
    Serial.println(relaystatus);
  }

  digitalWrite(RELAYPIN, relaystatus);
  delay(50);

  if (DEBUG_PRINT) {
    Serial.print(" => ");
    Serial.print("changing relay status --> ");
    Serial.println(relaystatus);
  }

  lastRelayActionmillis = millis();
  oldrelaystatus = relaystatus ;
  relayIsReady = LOW;
}

void getdht22temp()
