       }
 
       long now = millis();
-      if (now - lastReconnectAttempt > 1000) {
+      if (now - lastReconnectAttempt > 500) {
         lastReconnectAttempt = now;
         if (reconnect()) {
           lastReconnectAttempt = 0;


  unsigned long now = millis();

  if ((now - lastRelayActionmillis) >= 30000) {
    if ( receivedpayload == "{\"LIGHT\":1}") {
      relaystatus = 1 ;
    }
    else if ( receivedpayload == "{\"LIGHT\":0}") {
      relaystatus = 0 ;
    }
  }


  }

  client.loop();
  yield();

}

void runTimerDoLightOff()
{
  if (( relaystatus == HIGH ) && ( hour() == 6 ) && ( minute() == 00 ) && ( second() < 5 ))
  {
    if (DEBUG_PRINT) {
      Serial.print(" => ");
      Serial.print("checking relay status runTimerDoLightOff --> ");
      Serial.println(relaystatus);
    }
    relaystatus = LOW;
  }
}

