 
   unsigned long now = millis();
 
-  if ((now - lastRelayActionmillis) >= 30000) {
+  if ((now - lastRelayActionmillis) >= BETWEEN_RELAY_ACTIVE ) {
     if ( receivedpayload == "{\"LIGHT\":1}") {
-      relaystatus = 1 ;
-    }
-    else if ( receivedpayload == "{\"LIGHT\":0}") {
-      relaystatus = 0 ;
+      relaystatus = HIGH ;
+    }
+    if ( receivedpayload == "{\"LIGHT\":0}") {
+      relaystatus = LOW ;
     }
   }
 

  }

  client.loop();

}

void runTimerDoLightOff()
{
  if (( relaystatus == 1 ) && ( hour() == 6 ) && ( minute() == 00 ) && ( second() < 5 ))
  {
    relaystatus = 0;
  }
}



  if ( relaystatus != oldrelaystatus ) {

    if (DEBUG_PRINT) {
      Serial.print("call changelight  => relaystatus => ");
      Serial.println(relaystatus);
    }

    changelight();

    if (DEBUG_PRINT) {
      Serial.print("after changelight  => relaystatus => ");
      Serial.println(relaystatus);
    }

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