ESLE IF ISSUE Trigger Assistance

Setup
I have arduino UNO attached to a 1 channel relay module which sensor reading amps from a lamp .

Goal
I can turn on and off the lamp via the relay however i want to have 3 different type of triggers time when the lamp if off meaning.

If the sensor first notices that greater than set value then trigger RelayDelayA If after RelayDelayA has passed recheck sensor value if its less than set value then turn off relay, however if its notices on the 2nd check that the sensor is greater than set value then trigger and use RelayDelayB If after RelayDelayB time has passed recheck sensor value if its less than set value then turn off relay however if it notices on the 3rd check that the sensor is greater than set value then trigger RelayDelayC if after RelayDelayC time has passed recheck sensor value if its less than set value then turn off relay however if its greater than set value then start over to RelayDelayA

Below my code however i cant get it to jump from RelayDelayA to RelayDelayB on the 2nd check and RelayDelayC on the 3 check

Thanks in advance for you help

#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance

//***************LookUp Table Current Draw*************
float LightSensorA = .10;
float LightSensorB = .55;
float LightSensorC = .60;

//***************LookUp Table RelayDelay*********

int RelayDelay = 1000;
int RelayDelayA = 5000;
int RelayDelayB = 15000;
int RelayDelayC = 20000;

//*****************Relay *******************
const int relay = 4;
 
void setup()
{  
  Serial.begin(9600);
  pinMode(relay, OUTPUT);
  emon1.current(1, 111.1);             // Current: input pin, calibration.
}
void loop()
{
  double Irms = emon1.calcIrms(1480);  // Calculate Irms only
   
   Serial.print(Irms);                // serial print Current Irms
   Serial.println("  * amps\t");
     Serial.print("");
 
 if (Irms < LightSensorA) 
  {
 digitalWrite(relay, LOW); //  Switch Off relay (turn On Lights)  
 Serial.println("LOW debug test");// debugging 
 delay(RelayDelay);                   
  }
 else if (Irms > LightSensorB)
  {
  digitalWrite(relay, HIGH);     // switch ON relay (turns off lights)
  Serial.println("high 1 debug test");// debugging 
  delay(RelayDelayA);                      // 1st delay time option
  }
else if (Irms < LightSensorA) 
  {
  digitalWrite(relay, LOW);     // Switch Off relay (turn On Lights)
  Serial.println("LOW debug test"); // debugging 
  delay(RelayDelay);                     
  }
 else if(Irms > LightSensorB) 
  {
  digitalWrite(relay, HIGH);     // switch ON relay (turns off lights)
  Serial.println("high 2 debug test");// debugging 
    delay(RelayDelayB);                      // 2nd delay time option
   }
 else if (Irms < LightSensorA)//l 
  {
  digitalWrite(relay, LOW);     //  Switch Off relay (turn On Lights)
  Serial.println("LOW debug test");// debugging 
    delay(RelayDelay);                      
  }
else if (Irms > LightSensorB)// Switch ON relay (turn off Lights)
  {
  digitalWrite(relay, HIGH);     // switch ON relay (turns off lights)
  Serial.println("High 3 debug test");// debugging 
    delay(RelayDelayC);                      // 3rd delay time option
} 
}

i want to have 3 different type of triggers time when the lamp if off meaning.

Say what?

If the sensor first notices that greater than set value

Sensors don't notice things like that. They observe the real world. The Arduino needs to notice that the sensor value is, or is not, above some value.

then trigger RelayDelayA If after RelayDelayA has passed recheck sensor value

Some punctuation is clearly in order here. It seems unlikely that "RelayDelayA" and "recheck sensor value" are even in the same unit of measure.

Nice to see some comments, however, why don't you comment the functions of the sensors also. That way we could follow the logic better. I personal]y prefer commented "skeleton" instead of spaghetti code as you have.

/* if( motor on ) .... else if ( relay off) ... */ I suspect PaulS is correct, and he is is seldom wrong, Check you flow first.

I have a sensor attached to the arduino uno which i read the input value on pin A1 and if its greater than a set value then it triggers a HIGH using RelayDelayA time. If after RelayDelayA time has passed then the relay will go back to LOW. however when it go back to LOW it reads the input value on pin A1 again and if its greater than a set value then it triggers a HIGH using RelayDelayB time. If after RelayDelayB time has passed then the relay will go back to LOW. However when it goes back to LOW its reads the input value on pin A1 agin and if its greater than a set value then triggers a HIGH using RelayDelayC time. If after RelayDelayC time has passed then the relay will go back to LOW. Then it starts over

its like turning on a light manually for 10 sec then turn it off then turn it on for 20 sec then turn it off then turn it on for 40 sec .the trigger to turning it on is the sensor reading and the time its off off is done by the delay

I hope this is better English you

I put more comments in the code to make clear

Really need help here

#include "EmonLib.h"                   // Include Emon Library
EnergyMonitor emon1;                   // Create an instance

/* **************LookUp Table Current Draw*************/
float LightSensorA = .10; /* Trigger Value */
float LightSensorB = .55;  /* Trigger Value */
float LightSensorC = .60;  /* Trigger Value */

/***************LookUp Table RelayDelay*********/

unsigned long RelayDelay = 1000; /* 1 sec */
unsigned long RelayDelayA = 5000; /* 5 sec */
unsigned long RelayDelayB = 15000; /* 15 sec */
unsigned long RelayDelayC = 20000;/* 20 sec */

/*****************Relay *******************/
unsigned long relay = 4;
 
void setup()
{  
  Serial.begin(9600);
  pinMode(relay, OUTPUT); /* make Relay Pin a outpin*/
  emon1.current(1, 111.1);             /*Current: input pin, calibration.*/
}
void loop()
{
  double Irms = emon1.calcIrms(1480);  /*Calculate Irms only*/
   
   Serial.print(Irms);      /*serial print Current Irms*/
   Serial.println("  * amps\t"); /*print in serial monitors amps*/
     Serial.print("");
 
 if (Irms < LightSensorA) /* Reads Pin A1*/
  {
 digitalWrite(relay, LOW); /*Switch Off relay (turn On Lights)*/  
 Serial.println("LOW debug test");// for debugging 
 delay(RelayDelay);                   
  }
 else if (Irms > LightSensorB)/* Reads Pin A1*/
  {
  digitalWrite(relay, HIGH);  // switch ON relay (turns off lights)
  Serial.println("high 1 debug test");// for debugging 
  delay(RelayDelayA);                      // 1st delay time option
  }
else if (Irms < LightSensorA) /* Reads Pin A1*/
  {
  digitalWrite(relay, LOW);     // Switch Off relay (turn On Lights)
  Serial.println("LOW debug test"); // for debugging 
  delay(RelayDelay);                     
  }
 else if(Irms > LightSensorB) /* Reads Pin A1*/
  {
  digitalWrite(relay, HIGH);   // switch ON relay (turns off lights)
  Serial.println("high 2 debug test");// for debugging 
    delay(RelayDelayB);                      // 2nd delay time option
   }
 else if (Irms < LightSensorA) /* Reads Pin A1*/
  {
  digitalWrite(relay, LOW);     //  Switch Off relay (turn On Lights)
  Serial.println("LOW debug test");// for debugging 
    delay(RelayDelay);                      
  }
else if (Irms > LightSensorB) /* Reads Pin A1*/
  {
  digitalWrite(relay, HIGH);     // switch ON relay (turns off lights)
  Serial.println("High 3 debug test");// for debugging 
    delay(RelayDelayC);                      // 3rd delay time option
} 
}

How about this way ?? In sequence.

if(A1 > value ) { turn on relay A delay turn off relay A }

if(A1> value)

{ turn on relay b delay turn off relayb }

if(A1> value)

{ turn on relay C delay turn off relayC }

 if (Irms < LightSensorA) /* Reads Pin A1*/
 else if (Irms > LightSensorB)/* Reads Pin A1*/
else if (Irms < LightSensorA) /* Reads Pin A1*/
 else if(Irms > LightSensorB) /* Reads Pin A1*/

You seem to think that each if statement will be evaluated here. The first one that is true will cause all the rest to be skipped.

And, the comments are flat out wrong. There is no reading going on.