   pinMode(RELAY_PIN, OUTPUT);
   pinMode(BUTTON_PIN, INPUT_PULLUP);
 
-  lastRelayActionmillis = millis();
+  startMills = lastRelayActionmillis = millis();
 
   attachInterrupt(BUTTON_PIN, run_lightcmd_isr, RISING);
 

    }
    else
    {
      client.loop();
    }
    ArduinoOTA.handle();

volatile bool bRelayReady = false; 
String clientName;
unsigned long lastRelayActionmillis;
unsigned long startMills;

void ICACHE_RAM_ATTR callback(char* intopic, byte* inpayload, unsigned int length);

