espeasy

https://www.letscontrolit.com/wiki/index.php/Tutorial_Rules#IF.2FELSE

https://espeasy.readthedocs.io/en/latest/Reference/Command.html

On System#Boot do    //When the ESP boots, do
 Publish %sysname%/IP,%ip%
 gpio,2,1                       //pump / relay off
endon

On pumpon do                    //pump on
 gpio,2,0
Endon

On pumpoff do                   //pump off
 gpio,2,1
Endon

On Sensor1#Analog1 do 
// ((sensorValue > 570) && (SLEEP < 2))
//if [test#a]=0 or [test#b]=0 or [test#c]=0 
//if [test#a]=1 and [test#b]=1 and [test#c]=1
 If [Sensor1#Analog1] < 500
   event pumpon
   timerSet,1,5  //Set Timer 1 for the next event in 5 seconds
 ELSE
   //event pumpoff
   timerSet,2,5  //Set Timer 2 for the next event in 5 seconds
 Endif
//If %systime% < 23:59:00
// event,pumpoff // close valve
// timerSet,1,10  //timer 1 set for 10 seconds
//Endif */
Endon

On Rules#Timer=1 do                                  //When Timer1 expires, do
   //gpio,2,1
   event pumpoff                                   // close valve
   timerSet,1,60                                    //Set Timer 2 for the next event in 1 second
Endon

On Rules#Timer=2 do
  event pumpoff // close valve
Endon