Trouble adding "Time Delay Relay" Function to my Project!

Hello, Blynkers !

I am sorry if I may sound like a noob , As I am new to blynk and programming and I am sorry if this topic is already discussed somewhere else in some other topic , but I did not find anything that I am looking for that will work with my project (I have already tested to many libraries and methods) but none seems to work !

I have made a Blynk Powerd Smart Home Controller with Arduino Mega and Ethernet Sheild , Everything is working fine as expected !

But there is only one thing that I am unable to accomplish at the moment , i.e Adding a Delayed Turn Off Timer to my 3 Lights , 2 of them are required to turn off after I pressed a button on the wall or from the Blynk App after a preset Time Delay and one is required to Turn on For a preset time and turn off Automatically.

I am Including my Code (Full Code Yes )
Just tell me if you guys need to see the project pictures !

    //#define BLYNK_DEBUG
    #define BLYNK_PRINT Serial
    #include <LiquidCrystal_I2C.h>
    #include <dht11.h>
    #include <Wire.h>
    #include <Ethernet.h>
    #include <BlynkSimpleEthernet.h>
    #include <SimpleTimer.h>
    #include <SPI.h>
    #include <TimeLib.h>
    #include <WidgetRTC.h>
    #include <math.h>
    /// fader code starts
    #include <LEDFader.h> 
    #define LED_PIN 7
    #define FADE_TIME 1000
    #define DIR_UP 1
    #define DIR_DOWN -1
    LEDFader led;
    int direction = DIR_UP;
    /// fader code ends

    /// TIMER CODE STARTS HERE
    SimpleTimer timer;
    WidgetRTC rtc;
    SimpleTimer fantemptriggering;

    SimpleTimer button1;
    SimpleTimer button2;
    SimpleTimer button3;
    SimpleTimer button4;
    SimpleTimer button5;
    SimpleTimer button6;
    SimpleTimer button7;

    void checkPhysicalButton1();
    void checkPhysicalButton2();
    void checkPhysicalButton3();
    void checkPhysicalButton4();
    void checkPhysicalButton5();
    void checkPhysicalButton6();
    void checkPhysicalButton7();

    SimpleTimer tempreading;
    SimpleTimer tempreading2;
    SimpleTimer tempreading3;
    SimpleTimer fantemptriggerting;
    SimpleTimer current;
    SimpleTimer SENSOR;
    /// TIMER CODE ENDS HERE

    LiquidCrystal_I2C lcd(0x3F, 16, 2);

    dht11 DHT11;
    #define DHT11PIN 2

    dht11 DHT112;
    #define DHT11PIN2 4

    dht11 DHT113;
    #define DHT11PIN3 5


    char auth[] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";


    ///////////////////////////STATIC IP CODE STARTS/////////////////
    // Mac address should be different for each device in your LAN
    byte arduino_mac[] = { 0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xEE };
    IPAddress arduino_ip ( 10,   10,   10,  254);
    //IPAddress arduino_ip ( 192,   168,   1,  254);
    IPAddress dns_ip     (  8,   8,   8,   8);
    IPAddress gateway_ip ( 10,   10,   10,  1);
    //IPAddress gateway_ip ( 192,   168,   1,  1);
    IPAddress subnet_mask(255, 255, 255,   0);
    ///////////////////////////STATIC IP CODE ENDS/////////////////

    // RELAY VARIABLES START
    const int relay1 = 22;  //AUTO INTERNAL FANs
    const int relay2 = 24;  //EMTY
    const int relay3 = 26;  //EMTY
    const int relay4 = 28;  //EMTY
    const int relay5 = 30;  //EMTY
    const int relay6 = 32;  //EMTY
    const int relay7 = 34;  //EMTY
    const int relay8 = 36;  //EMTY

    // RELAY VARIABLES END

    // SYSTEM WIDE VARIABLES START
    int trigger = 30 ; ////////////SET auto fan temperature here<<<<<<<<<<
    int manual = 0 ;
    int lightmanual = 0;

    // Set your LED and physical button pins here
    const int btnPin = 38;
    const int btnPin2 = 40;
    const int btnPin3 = 42;
    const int btnPin4 = 44;
    const int btnPin5 = 46;
    const int btnPin6 = 48;
    const int btnPin7 = 49;

    int RelayState = LOW;
    int RelayState2 = LOW;
    int RelayState3 = LOW;
    int RelayState4 = LOW;
    int RelayState5 = LOW;
    int RelayState6 = LOW;
    int RelayState7 = LOW;


    int btnState = HIGH;
    int btnState2 = HIGH;
    int btnState3 = HIGH;
    int btnState4 = HIGH;
    int btnState5 = HIGH;
    int btnState6 = HIGH;
    int btnState7 = HIGH;

    //////////////////////Current Monitor Section Starts////////
    const int currentPin = A15;
    const unsigned long sampleTime = 100000UL;
    const unsigned long numSamples = 250UL;
    const unsigned long sampleInterval = sampleTime / numSamples;
    const int adc_zero = 510;
    //////////////////////Current Monitor Section Ends////////

    int inputPin = 3;               // choose the input pin (for PIR sensor)
    int pirState = LOW;             // we start, assuming no motion detected
    int val = 0;

    // SYSTEM WIDE VARIABLES END

    // VIRTUAL PIN ASSIGNMENT STARTS
    BLYNK_ATTACH_WIDGET(rtc, V0);
    WidgetLED ledR1(V1); //register to virtual pin 1
    WidgetLED ledR2(V2); //register to virtual pin 2
    WidgetLED ledR3(V3); //register to virtual pin 3
    WidgetLED ledR4(V4); //register to virtual pin 4
    WidgetLED ledR5(V5); //register to virtual pin 5
    WidgetLED ledR6(V6); //register to virtual pin 6
    WidgetLED ledR7(V7); //register to virtual pin 7
    WidgetLED ledR8(V8); //register to virtual pin 8
    WidgetLED ledPower(V9); //register to virtual pin 9
    WidgetLED ledBKLIT(V10); //register to virtual pin 9
    /*
      VIRTUAL PIN ASSIGMENT CHART
      V11 ==   Relay 1 OR Fan Manual\Auto Controll Button INPUT
      V12 ==  Relay 2 Button INPUT
      V13 ==  Relay 3 Button INPUT
      V14 ==  Relay 4 Button INPUT
      V15 ==  Relay 5 Button INPUT
      V16 ==  Relay 6 Button INPUT
      V17 ==  Relay 7 Button INPUT
      V18 ==  Relay 8 Button INPUT
      V19 ==  LCD Backlit ON\OFF Button INPUT
      V20 ==  INTERNAT Temperature PRINT In degrees C Output PIN
      V21 ==  INTERNAL Realative Humidity Level PRINT in % Output PIN
      V22 ==  FAN Auto Trigger Current Variable Value Output PIN
      V23 ==  TIME OUTPUT PIN
      V24 ==  DATE OUTPUT PIN
      V25 ==  FAN Auto Trigger Temperature Settings Menu(Dropdown) INPUT PIN
      V26 ==  All Relay Force OFF Button INPUT PIN
      V27 ==  All Relay Force ON Button INPUT PIN
      V28 ==  AMPS Value PRINT PIN
      V29 ==  INDOOR Temperature PRINT In degrees C Output PIN
      V30 ==  INDOOR Realative Humidity Level PRINT in % Output PIN
      V31 ==  OUTDOOR Temperature PRINT In degrees C Output PIN
      V32 ==  OUTDOOR Realative Humidity Level PRINT in % Output PIN
      v33 == auto/manual light with pir button
      v34 == button panel breathing led speed 
      /*

    */
    // VIRTUAL PIN ASSIGMENT ENDS


    int TEMPERATURE; /// temp TEMPERATUREer reading point



    ///// breath led code ////
    #define backlitled 7 
    int i=0;
    int breathe_delay1 = 10;   // delay between loops
    unsigned long breathe_time1 = millis();
    //////breath led code/////
    void setup()
    {
      rtc.begin();
      Serial.begin(9600); //(Remove all 'Serial' commands if not needed)
      lcd.init();
      lcd.setBacklight(HIGH);
      lcd.setCursor(0, 0);
      lcd.print("AUTOBOX SHSTD-00");
      lcd.setCursor(0, 1);
      delay(1000);
    //  lcd.print("V.1DC 0558943243");
    //  delay(1000);
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print("CONNECTING USING");
      lcd.setCursor(0, 1);
      lcd.print(arduino_ip);
      delay(2000);
      lcd.clear();
      //  lcd.setCursor(0, 1);
      //  lcd.print("SYS STATUS:");
      lcd.setCursor(7, 1);
      lcd.print("CONECTING");
      lcd.setCursor(11, 0);
      lcd.print("UNCFR");
      lcd.clear();
      // RELAY VARIABLES START

      pinMode(relay1, OUTPUT);
      pinMode(relay2, OUTPUT);
      pinMode(relay3, OUTPUT);
      pinMode(relay4, OUTPUT);
      pinMode(relay5, OUTPUT);
      pinMode(relay6, OUTPUT);
      pinMode(relay7, OUTPUT);
      pinMode(relay8, OUTPUT);

      digitalWrite(relay1, LOW);
      digitalWrite(relay2, HIGH);
      digitalWrite(relay3, HIGH);
      digitalWrite(relay4, HIGH);
      digitalWrite(relay5, HIGH);
      digitalWrite(relay6, HIGH);
      digitalWrite(relay7, LOW);
      digitalWrite(relay8, HIGH);

      pinMode(btnPin, INPUT_PULLUP);
      pinMode(btnPin2, INPUT_PULLUP);
      pinMode(btnPin3, INPUT_PULLUP);
      pinMode(btnPin4, INPUT_PULLUP);
      pinMode(btnPin5, INPUT_PULLUP);
      pinMode(btnPin6, INPUT_PULLUP);
      pinMode(btnPin7, INPUT_PULLUP);

      // RELAY VARIABLES END

      //FUNCTION TIMERS DELAY DECLERATION CODE STARTS//////

      tempreading.setInterval(1000L, temp);
       tempreading2.setInterval(1000L, temp2);
        tempreading3.setInterval(1000L, temp3);
      timer.setInterval(1000L, clockDisplay);
      fantemptriggering.setInterval(30000L, tempset);
      current.setInterval(1000L, amps);
      SENSOR.setInterval(1000L, PIR);

      button1.setInterval(150L, checkPhysicalButton1);
      button2.setInterval(150L, checkPhysicalButton2);
      button3.setInterval(150L, checkPhysicalButton3);
      button4.setInterval(150L, checkPhysicalButton4);
      button5.setInterval(150L, checkPhysicalButton5);
      button6.setInterval(150L, checkPhysicalButton6);
      button7.setInterval(150L, checkPhysicalButton7);

      //FUNCTION TIMERS DELAY DECLERATION CODE ENDS////////

      Blynk.begin(auth, "blynk-cloud.com", 8442, arduino_ip, dns_ip, gateway_ip, subnet_mask, arduino_mac);
      // Blynk.begin(auth);

      ///Button LED backlit fade variables starts
     led = LEDFader(LED_PIN);
      led.fade(255, FADE_TIME);
    ///Button LED backlit fade variables ends
    }

    bool isFirstConnect = true;

    BLYNK_CONNECTED() {
      if (isFirstConnect) {
        lcd.clear();

        isFirstConnect = false;
        lcd.setCursor(9, 1);
        lcd.print(" ONLINE") ;
      }

      ledPower.off();
      //  ledR1.off();
      //  ledR2.off();
      //  ledR3.off();
      //  ledR4.off();
      //  ledR5.off();
      //  ledR6.off();
      //  ledR7.off();
      //  ledR8.off();
      ledBKLIT.on();

      // Request the latest state from the server
      //Blynk.syncVirtual(V12);
      // Alternatively, you could override server state using:
      Blynk.virtualWrite(V12, !RelayState);
      Blynk.virtualWrite(V13, !RelayState2);
      Blynk.virtualWrite(V14, !RelayState3);
      Blynk.virtualWrite(V15, !RelayState4);
      Blynk.virtualWrite(V16, !RelayState5);
      Blynk.virtualWrite(V17, !RelayState6);
      Blynk.virtualWrite(V18, !RelayState7);
      //
      Blynk.virtualWrite(V2, !RelayState);
      Blynk.virtualWrite(V3, !RelayState2);
      Blynk.virtualWrite(V4, !RelayState3);
      Blynk.virtualWrite(V5, !RelayState4);
      Blynk.virtualWrite(V6, !RelayState5);
      Blynk.virtualWrite(V7, !RelayState6);
      Blynk.virtualWrite(V8, !RelayState7);
      Blynk.syncAll();
    }



    void loop()
    {
    //  backlitledprocess();  // Run Breathing Botton Panle LED Backlit
      button1.run(); // Run Simplebutton1
      button2.run(); // Run Simplebutton2
      button3.run(); // Run Simplebutton3
      button4.run(); // Run Simplebutton4
      button5.run(); // Run Simplebutton5
      button6.run(); // Run Simplebutton6
      button7.run(); // Run Simplebutton7

      tempreading.run();
       tempreading2.run();
        tempreading3.run();
        
      timer.run();
      current.run();

      //  lcd.setCursor(9, 1);
      //  lcd.print(trigger);

    { if (manual == 1) {
        }
        else {
          fantemptriggering.run();
        }
      }

      {
        if (lightmanual == 1)
        {
          lcd.setCursor(7, 1);
          lcd.print("M");
        }
        else {
          SENSOR.run();
          lcd.setCursor(7, 1);
          lcd.print("A");
        }
      }
      {
        bool isconnected = Blynk.connected();
        if (isconnected == false) {
          lcd.setCursor(9, 1);
          lcd.print("OFFLINE") ;
    //offline indicator   
      digitalWrite(relay7, LOW);
        led.update();

      // LED no longer fading, switch direction
      if (!led.is_fading()) {

        // Fade down
        if (direction == DIR_UP) {
          led.fade(0, FADE_TIME);
          direction = DIR_DOWN;
        }
        // Fade up
        else {
          led.fade(255, FADE_TIME);
          direction = DIR_UP;
        }
      }
        
        }
        else {
          lcd.setCursor(9, 1);
          lcd.print(" ONLINE") ;
          backlitledprocess();  // Run Breathing Botton Panle LED Backlit
        }
      }
      Blynk.run();
    }

    void temp()
    {
      int chk = DHT11.read(DHT11PIN);

      lcd.setCursor(0, 0);
      lcd.print("C=");
      lcd.print((float)DHT11.temperature, 0);
      TEMPERATURE = (float)DHT11.temperature, 0;
    //  lcd.print(" H=");
    //  lcd.print((float)DHT11.humidity, 0);
    //  lcd.print("% ");

      int temp1 ;

      int newtemp = ((float)DHT11.temperature);

      temp1 = (newtemp / 10.0);

      Blynk.virtualWrite(V20, newtemp);

      int humid ;

      int newhumid = ((float)DHT11.humidity);
      humid = (newhumid );

      Blynk.virtualWrite(V21, humid);
      Blynk.virtualWrite(V22, trigger);
        Blynk.virtualWrite(V35, breathe_delay1);

    //  ///INDOOR TEMP SENSOR READING PUSH
    //  Blynk.virtualWrite(V29, newtemp);
    //  Blynk.virtualWrite(V30, humid);
    //
    //  ///OUTDOOR TEMP SENSOR READING PUSH
    //  Blynk.virtualWrite(V31, newtemp);
    //  Blynk.virtualWrite(V32, humid);

      if (TEMPERATURE > 40) {
        Blynk.notify("Hey, The Internal Temp of the AUTOBOX Just Exceded 40°C Please Check FANs and AC !");
      }
    }


    void temp2()
    {
      int chk = DHT112.read(DHT11PIN2);

    //  lcd.setCursor(0, 0);
    //  lcd.print("C=");
    //  lcd.print((float)DHT112.temperature, 0);
    //  TEMPERATURE = (float)DHT112.temperature, 0;
    ////  lcd.print(" H=");
    ////  lcd.print((float)DHT11.humidity, 0);
    ////  lcd.print("% ");

      int ttemp1 ;

      int newtemp2 = ((float)DHT112.temperature);

      ttemp1 = (newtemp2 / 10.0);


      int humid2 ;

      int newhumid2 = ((float)DHT112.humidity);
      humid2 = (newhumid2 );

      ///INDOOR TEMP SENSOR READING PUSH
      Blynk.virtualWrite(V29, newtemp2);
      Blynk.virtualWrite(V30, humid2);
         lcd.setCursor(4, 0);
       lcd.print("-");
            lcd.setCursor(5, 0);
       lcd.print(newtemp2);
    }


    void temp3()
    {
      int chk = DHT113.read(DHT11PIN3);

    //  lcd.setCursor(0, 0);
    //  lcd.print("C=");
    //  lcd.print((float)DHT11.temperature, 0);
    //  TEMPERATURE = (float)DHT11.temperature, 0;
    ////  lcd.print(" H=");
    ////  lcd.print((float)DHT11.humidity, 0);
    ////  lcd.print("% ");

      int tttemp1 ;

      int newtemp3 = ((float)DHT113.temperature);

      tttemp1 = (newtemp3 / 10.0);

      int humid3 ;

      int newhumid3 = ((float)DHT113.humidity);
      humid3 = (newhumid3 );

      Blynk.virtualWrite(V31, newtemp3);
      Blynk.virtualWrite(V32, humid3);
         lcd.setCursor(7, 0);
       lcd.print("-");
            lcd.setCursor(8, 0);
       lcd.print(newtemp3);

    }
    ////////////////////////////////////////////INVERTED BUTTON CODE ENDS/////////////////////////////////////////////////////////////////////////////

    BLYNK_WRITE(V11)
    {
      int i = param.asInt();
      if (i == 0) {
        manual = 0;
        /////TEMP CONTORLED FAN CODE STARTS HERE
        if (TEMPERATURE > trigger)
        {
          digitalWrite(relay1, LOW);
          lcd.setCursor(11, 0);
          lcd.print("AT-ON");
          ledR1.on();
        }
        else
        {
          digitalWrite(relay1, HIGH);
          lcd.setCursor(11, 0);
          lcd.print("AT-OF");
          ledR1.off();
        }
      }
      else {
        manual = 1;
        digitalWrite(relay1, LOW);
        ledR1.on();
        lcd.setCursor(11, 0);
        lcd.print("ML-ON");
      }
    }

    ////TEMP CONTORLL FAN CODE ENDS HERE

    ////////////////////////////////////////////INVERTED BUTTON CODE ENDS/



    BLYNK_WRITE(V19)
    {
      int i = param.asInt();
      if (i == 1) {
        lcd.setBacklight(HIGH);
        ledBKLIT.on();
        //Blynk.email("ahsan@alahsan.xyz", "LCA UNIT's LCS (AUTO TURNED ON) STATUS UPDATE", "LCA UNIT's LCD JUST TURNED ON !");
      }
      else {
        lcd.setBacklight(LOW);
        ledBKLIT.off();
        // Blynk.email("ahsan@alahsan.xyz", "LCA UNIT's LCS (AUTO TURNED OFF) STATUS UPDATE", "LCA UNIT's LCD JUST TURNED OFF !");

      }
    }
    ////////////////////rtc code starts here
    void printDigits(int digits)
    {
      Serial.print(":");
      if (digits < 10) {
        Serial.print('0');
      }
      Serial.print(digits);
    }

    // Digital clock display of the time
    void clockDisplay()
    {
      // You can call hour(), minute(), ... at any time
      // Please see Time library examples for details

      String currentTime = String(hour()) + ":" + minute() + ":" + second();
      String currentDate = String(day()) + "/" + month() + "/" + year();
      String shortDate = String(day()) + "/" + month();
      //  //  Serial.print("Current time: ");
      //  //  Serial.print(currentTime);
      //  //  Serial.print(" ");
      //  //  Serial.print(currentDate);
      //  //  Serial.println();
      //
      //  // Send time to the App
      Blynk.virtualWrite(V23, currentTime);
      //  // Send date to the App
      Blynk.virtualWrite(V24, currentDate);
    }
    //  lcd.print(currentTime) ;

    ////////rtc code ends here///////////////

    BLYNK_WRITE(V26)
    {
      int i = param.asInt();
      if (i == 0) {
      }
      else {
        digitalWrite(relay2, HIGH);
        digitalWrite(relay3, HIGH);
        digitalWrite(relay4, HIGH);
        digitalWrite(relay5, HIGH);
        digitalWrite(relay6, HIGH);
        digitalWrite(relay7, HIGH);
        digitalWrite(relay8, HIGH);
        ledR2.off();
        ledR3.off();
        ledR4.off();
        ledR5.off();
        ledR6.off();
        ledR7.off();
        ledR8.off();
        Blynk.virtualWrite(V12, LOW);
        Blynk.virtualWrite(V13, LOW);
        Blynk.virtualWrite(V14, LOW);
        Blynk.virtualWrite(V15, LOW);
        Blynk.virtualWrite(V16, LOW);
        Blynk.virtualWrite(V17, LOW);
        Blynk.virtualWrite(V18, LOW);
      }
    }

    BLYNK_WRITE(V27)
    {
      int i = param.asInt();
      if (i == 0) {}
      else {
        digitalWrite(relay2, LOW);
        digitalWrite(relay3, LOW);
        digitalWrite(relay4, LOW);
        digitalWrite(relay5, LOW);
        digitalWrite(relay6, LOW);
        digitalWrite(relay7, LOW);
        digitalWrite(relay8, LOW);
        ledR2.on();
        ledR3.on();
        ledR4.on();
        ledR5.on();
        ledR6.on();
        ledR7.on();
        ledR8.on();
        Blynk.virtualWrite(V12, HIGH);
        Blynk.virtualWrite(V13, HIGH);
        Blynk.virtualWrite(V14, HIGH);
        Blynk.virtualWrite(V15, HIGH);
        Blynk.virtualWrite(V16, HIGH);
        Blynk.virtualWrite(V17, HIGH);
        Blynk.virtualWrite(V18, HIGH);
      }
    }

    BLYNK_WRITE(V25) {
      switch (param.asInt())
      {
        case 1: { // Item 1
            trigger = 25;
            break;
          }
        case 2: { // Item 2
            trigger = 26;
            break;
          }
        case 3: { // Item 3
            trigger = 27;
            break;
          }
        case 4: { // Item 3
            trigger = 28;
            break;
          }
        case 5: { // Item 3
            trigger = 29;
            break;
          }
        case 6: { // Item 3
            trigger = 30;
            break;
          }
        default: {
            trigger = 29;
          }
      }
    }

    void tempset()
    {
      /////TEMP CONTORLED FAN CODE STARTS HERE
      //  Blynk.virtualWrite(V22, trigger);
      if (TEMPERATURE > trigger)
      {
        digitalWrite(relay1, LOW);
        lcd.setCursor(11, 0);
        lcd.print("AT-ON");
        ledR1.on();
      }
      else
      {
        digitalWrite(relay1, HIGH);
        lcd.setCursor(11, 0);
        lcd.print("AT-OF");
        ledR1.off();
      }
      ////TEMP CONTORLL FAN CODE ENDS HERE

    }

    BLYNK_WRITE(V12) {

      RelayState = !param.asInt();
      int i = param.asInt();
      if (i == 0) {
        if (lightmanual == 1) {
          digitalWrite(relay2, HIGH);
          ledR2.off();
          Blynk.virtualWrite(V12, LOW);
        }
      }
      else {
        if (lightmanual == 1) {
          digitalWrite(relay2, LOW);
          ledR2.on();
          Blynk.virtualWrite(V12, HIGH);
        }
      }
    }

    void checkPhysicalButton1()
    {
      if (digitalRead(btnPin) == HIGH) {
        // btnState is used to avoid sequential toggles
        if (btnState != LOW) {

          // Toggle LED state
          RelayState = !RelayState;
          digitalWrite(relay2, RelayState);
          if (RelayState == HIGH) {
            Blynk.virtualWrite(V12, LOW);
            ledR2.off();
          }
          else {
            Blynk.virtualWrite(V12, HIGH);
            ledR2.on();
          }
          // Update Button Widget
        }
        btnState = LOW;
      } else {
        btnState = HIGH;

      }
    }
    BLYNK_WRITE(V13) {
      RelayState2 = !param.asInt();

      int i = param.asInt();
      if (i == 0) {
        digitalWrite(relay3, HIGH);
        ledR3.off();
      }
      else {
        digitalWrite(relay3, LOW);
        ledR3.on();
      }

    }

    void checkPhysicalButton2()
    {
      if (digitalRead(btnPin2) == HIGH) {
        // btnState is used to avoid sequential toggles
        if (btnState2 != LOW) {
          // Toggle LED state
          RelayState2 = !RelayState2;
          digitalWrite(relay3, RelayState2);
          if (RelayState2 == HIGH) {
            Blynk.virtualWrite(V13, LOW);
            ledR3.off();

          }
          else {
            Blynk.virtualWrite(V13, HIGH);
            ledR3.on();
          }
          // Update Button Widget
        }
        btnState2 = LOW;
      } else {
        btnState2 = HIGH;
      }
    }

    BLYNK_WRITE(V14) {
      RelayState3 = !param.asInt();

      int i = param.asInt();
      if (i == 0) {
        digitalWrite(relay4, HIGH);
        ledR4.off();
      }
      else {
        digitalWrite(relay4, LOW);
        ledR4.on();
      }

    }

    void checkPhysicalButton3()
    {
      if (digitalRead(btnPin3) == HIGH) {
        // btnState is used to avoid sequential toggles
        if (btnState3 != LOW) {

          // Toggle LED state
          RelayState3 = !RelayState3;
          digitalWrite(relay4, RelayState3);
          if (RelayState3 == HIGH) {
            Blynk.virtualWrite(V14, LOW);
            ledR4.off();
          }
          else {
            Blynk.virtualWrite(V14, HIGH);
            ledR4.on();
          }
          // Update Button Widget
        }
        btnState3 = LOW;
      } else {
        btnState3 = HIGH;

      }
    }

    BLYNK_WRITE(V15) {
      RelayState4 = !param.asInt();

      int i = param.asInt();
      if (i == 0) {
        digitalWrite(relay5, HIGH);
        ledR5.off();
      }
      else {
        digitalWrite(relay5, LOW);
        ledR5.on();
      }

    }

    void checkPhysicalButton4()
    {
      if (digitalRead(btnPin4) == HIGH) {
        // btnState is used to avoid sequential toggles
        if (btnState4 != LOW) {

          // Toggle LED state
          RelayState4 = !RelayState4;
          digitalWrite(relay5, RelayState4);
          if (RelayState4 == HIGH) {
            Blynk.virtualWrite(V15, LOW);
            ledR5.off();
          }
          else {
            Blynk.virtualWrite(V15, HIGH);
            ledR5.on();
          }
          // Update Button Widget
        }
        btnState4 = LOW;
      } else {
        btnState4 = HIGH;

      }
    }
    BLYNK_WRITE(V16) {
      RelayState5 = !param.asInt();

      int i = param.asInt();
      if (i == 0) {
        digitalWrite(relay6, HIGH);
        ledR6.off();
      }
      else {
        digitalWrite(relay6, LOW);
        ledR6.on();
      }

    }

    void checkPhysicalButton5()
    {
      if (digitalRead(btnPin5) == HIGH) {
        // btnState is used to avoid sequential toggles
        if (btnState5 != LOW) {

          // Toggle LED state
          RelayState5 = !RelayState5;
          digitalWrite(relay6, RelayState5);
          if (RelayState5 == HIGH) {
            Blynk.virtualWrite(V16, LOW);
            ledR6.off();
          }
          else {
            Blynk.virtualWrite(V16, HIGH);
            ledR6.on();
          }
          // Update Button Widget
        }
        btnState5 = LOW;
      } else {
        btnState5 = HIGH;

      }
    }
    BLYNK_WRITE(V17) {
      RelayState6 = !param.asInt();

      int i = param.asInt();
      if (i == 0) {
        digitalWrite(relay7, HIGH);
        ledR7.off();
      }
      else {
        digitalWrite(relay7, LOW);
        ledR7.on();
      }

    }

    void checkPhysicalButton6()
    {
      if (digitalRead(btnPin6) == HIGH) {
        // btnState is used to avoid sequential toggles
        if (btnState6 != LOW) {

          // Toggle LED state
          RelayState6 = !RelayState6;
          digitalWrite(relay7, RelayState6);
          if (RelayState6 == HIGH) {
            Blynk.virtualWrite(V17, LOW);
            ledR7.off();
          }
          else {
            Blynk.virtualWrite(V17, HIGH);
            ledR7.on();
          }
          // Update Button Widget
        }
        btnState6 = LOW;
      } else {
        btnState6 = HIGH;

      }
    }

    BLYNK_WRITE(V18) {
      RelayState7 = !param.asInt();

      int i = param.asInt();
      if (i == 0) {
        digitalWrite(relay8, HIGH);
        ledR8.off();
      }
      else {
        digitalWrite(relay8, LOW);
        ledR8.on();
      }

    }

    void checkPhysicalButton7()
    {
      if (digitalRead(btnPin7) == HIGH) {
        // btnState is used to avoid sequential toggles
        if (btnState7 != LOW) {

          // Toggle LED state
          RelayState7 = !RelayState7;
          digitalWrite(relay8, RelayState7);
          if (RelayState7 == HIGH) {
            ledR8.off();
            Blynk.virtualWrite(V18, LOW);
          }
          else {
            ledR8.on();
            Blynk.virtualWrite(V18, HIGH);
          }
          // Update Button Widget
        }
        btnState7 = LOW;
      } else {
        btnState7 = HIGH;
      }
    }

    void amps()
    {
      unsigned long currentAcc = 0;
      unsigned int count = 0;
      unsigned long prevMicros = micros() - sampleInterval ;
      while (count < numSamples)
      {
        if (micros() - prevMicros >= sampleInterval)
        {
          int adc_raw = analogRead(currentPin) - adc_zero;
          currentAcc += (unsigned long)(adc_raw * adc_raw);
          ++count;
          prevMicros += sampleInterval;
        }
      }

      float rms = sqrt((float)currentAcc / (float)numSamples) * (75.7576 / 1024.0);
      //Serial.println(rms);
      Blynk.virtualWrite(V28, rms);

      lcd.setCursor (0, 1);
      lcd.print("A=");
      lcd.print(rms);
    }

    BLYNK_WRITE(V33)
    {
      int i = param.asInt();
      if (i == 0) {
        lightmanual = 0;
      }
      else {
        lightmanual = 1;
      }
    }

    void PIR()
    {
    // if (digitalRead(inputPin) == HIGH) {
    //    // btnState is used to avoid sequential toggles
    //    if (inputPin != LOW) {
    //
    //      // Toggle LED state
    //      RelayState = !RelayState;
    //      digitalWrite(relay2, RelayState);
    //      if (RelayState == HIGH) {
    //         Blynk.virtualWrite(V12, LOW);
    //    ledPower.off();
    //    ledR2.off();
    //      }
    //      else {
    //     Blynk.virtualWrite(V12, HIGH);
    //    ledR2.on();
    //    ledPower.on();
    //      }
    //      // Update Button Widget
    //    }
    //    inputPin = LOW;
    //  } else {
    //    inputPin = HIGH;
    //  }
    }

    void backlitledprocess()
    {
      if( (breathe_time1 + breathe_delay1) < millis() ){
        breathe_time1 = millis();
        float val = (exp(sin(i/2000.0*PI*10)) - 0.36787944)*108.0; 
        // this is the math function recreating the effect
        analogWrite(backlitled, val);  // PWM
        i=i+1;
      }
    }

    BLYNK_WRITE(V34) {
      switch (param.asInt())
      {
        case 1: { // Item 1
            breathe_delay1 = 5;
            break;
          }
        case 2: { // Item 2
            breathe_delay1 = 7;
            break;
          }
        case 3: { // Item 3
            breathe_delay1 = 10;
            break;
          }
        case 4: { // Item 3
            breathe_delay1 = 13;
            break;
          }
        case 5: { // Item 3
            breathe_delay1 = 15;
            break;
          }
        case 6: { // Item 3
            breathe_delay1 = 20;
            break;
          }
              case 7: { // Item 3
            breathe_delay1 = 25;
            break;
          }
        default: {
            breathe_delay1 = 10;
          }
      }
    }

You might want to read up on the SimpleTimer library, because you are overdoing it. Each SimpleTimer instance (Simpletimer button1Timer) can run 10 individual timers (int timer1 = button1Timer.setInterval(1000, button1) ). You can use timer.setTimeout to run a function once after a certain period. You may wanna try that.

ok going to try it once at my Ground Zero !
Thank you @Lichtsignaal !

Let us know how you fare with this info and if anything is unclear, don’t hesitate to post here :slight_smile: