Kindly help plz..PZemt 004 relay switch

#include <SoftwareSerial.h> // Arduino IDE <1.6.6

#include <PZEM004T.h>

#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

PZEM004T pzem(2,3); // (RX,TX) connect to TX,RX of PZEM

IPAddress ip(192,168,1,1);

void setup() {

Serial.begin(9600);

pzem.setAddress(ip);
lcd.begin(16, 2); // lcd rows and columns

}

void loop() {

float v = pzem.voltage(ip);

if (v < 0.0) v = 0.0;

Serial.print(v);Serial.print("V; ");
lcd.setCursor(0,0);
lcd.print("V= ");
lcd.setCursor(2,0);
lcd.print(v);

float i = pzem.current(ip);

if (i < 0.0) i = 0.0;

Serial.print(i);Serial.print("A; ");

lcd.setCursor(9,0);
lcd.print("A= ");
lcd.setCursor(11,0);
lcd.print(i);

float p = pzem.power(ip);

if (p < 0.0) p = 0.0;

Serial.print(p);Serial.print("W; ");
lcd.setCursor(9,1);
lcd.print("W= ");
lcd.setCursor(11,1);
lcd.print(p);

float e = pzem.energy(ip);

Serial.print("PF= ");Serial.print((p)/(v*i));

lcd.setCursor(0,1);
lcd.print("PF=");
lcd.setCursor(3,1);
lcd.print((p)/(v*i));

Serial.println();

delay(100);
}

I want if P (watt) value increase 50 than it ON an output pin after that when the value of P increased 50 the relay pin should be low.
For example.
If p= 230 watt after addition 50 on 280 it will be HIGH relay pin and after p= 280 increased 330 than it should off the relay.
P value should b changed at every cycle.
P increasing Continuosly as it is the value of Electricty

I want if P (watt) value increase 50 than it ON an output pin

Suppose I show you ONE number. Can you tell if that number is an increase (of any amount) or a decrease (of any amount)? Of course not.

What DO you need to know to know if the current value is equal to, less than, or more than some other value? Obviously, you need to know the previous value.

Nowhere in your code do you have a place to sore the current value so that next time you have a previous value to compare to.

Kindly forward me the suggested code

NearThedeath:
Kindly forward me the suggested code

I told you what you need in your code. YOU write it.

Kindly STOP POSTING THE SAME QUESTION IN DIFFERENT PARTS OF THE FORUM