Compilation error: 'class BlynkWifi' has no member named 'notification'

I am doing a simple gas detection project using MQ-2 sensor and Blynk IoT. I have already installed all the libraries related to Blynk, i2c for lcd, and also for esp8266.
The only error I am getting is, Compilation error: ‘class BlynkWifi’ has no member named ‘notification’.
pls help me with this.

#define BLYNK_TEMPLATE_NAME "Gas leakage detection"
#define BLYNK_AUTH_TOKEN "Z9GvhsW8uAyahjUr35G67wC3r22OcKoo"
#include <LiquidCrystal_I2C.h>
#include <Blynk.h>
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
char auth[] = "Z9GvhsW8uAyahjUr35G67wC3r22OcKoo";// Enter your Auth token
char ssid[] = "POCO M2 PRO";//Enter your WIFI SSIS
char pass[] = "yokesh007";//Enter your WIFI password
BlynkTimer timer;
int pinValue = 0;
#define Buzzer D5
#define Green D6
#define Red D7
#define Sensor A0
void setup() {
Wire.begin();
Serial.begin(115200);
Serial.println("ESP32 scanning for I2C devices");
  Serial.begin(9600);
  lcd.backlight();
  lcd.init();
  pinMode(Green, OUTPUT);
  pinMode(Red, OUTPUT);
  pinMode(Buzzer, OUTPUT);
  pinMode(Sensor, INPUT);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(100L, notification);
}
BLYNK_WRITE(V0) {
  pinValue = param.asInt();
}
void notification() {
  int sensor = analogRead(Sensor);
  Serial.println(sensor);
  sensor = map(sensor, 0, 1024, 0, 100);
  if (pinValue == 1) {
    if (sensor <= 50) {
      digitalWrite(Green, HIGH);
      digitalWrite(Red, LOW);
      digitalWrite(Buzzer, LOW);
      lcd.setCursor(0, 1);
      lcd.print("Gas value:Normal");
    } else if (sensor > 50) {
      Blynk.notification("Warning! Gas leak detected");
      digitalWrite(Green, LOW);
      digitalWrite(Red, HIGH);
      digitalWrite(Buzzer, HIGH);
      lcd.setCursor(0, 1);
      lcd.print("Gas value:High  ");
    }
    lcd.setCursor(0, 0);
    lcd.print("Value : ");
    lcd.print(sensor);
    Blynk.virtualWrite(V1, sensor);
  } else {
    digitalWrite(Red, LOW);
    digitalWrite(Buzzer, LOW);
    digitalWrite(Green, LOW);
    lcd.clear();
  }
}
void loop() {
  byte error_i2c, address_i2c;
int I2C_Devices;
Serial.println("Scanning started");
I2C_Devices = 0;
for(address_i2c = 1; address_i2c < 127; address_i2c++ )
{
Wire.beginTransmission(address_i2c);
error_i2c = Wire.endTransmission();
if (error_i2c == 0) {
Serial.print("I2C device found at address_i2c 0x");
if (address_i2c<16)
{
Serial.print("0");
}
Serial.println(address_i2c,HEX);
I2C_Devices++;
}
else if (error_i2c==4)
{
Serial.print("Unknow error_i2c at address_i2c 0x");
if (address_i2c<16)
{
Serial.print("0");
}
Serial.println(address_i2c,HEX);
}
}
if (I2C_Devices == 0)
{
Serial.println("No I2C device connected \n");
}
else {
Serial.println("done I2C device searching\n")
}
delay(2000);
  Blynk.run();
   timer.run();
}```


the error while compiling is: 
WARNING: library LiquidCrystal I2C claims to run on avr architecture(s) and may be incompatible with your current board which runs on esp8266 architecture(s).
C:\Users\91978\Desktop\LPG_detection\LPG_detection.ino: In function 'void notification()':
C:\Users\91978\Desktop\LPG_detection\LPG_detection.ino:54:13: error: 'class BlynkWifi' has no member named 'notification'
   54 |       Blynk.notification("Warning! Gas leak detected");
      |             ^~~~~~~~~~~~
Multiple libraries were found for "LiquidCrystal_I2C.h"
  Used: C:\Users\91978\Documents\Arduino\libraries\LiquidCrystal_I2C
  Not used: C:\Users\91978\Documents\Arduino\libraries\LiquidCrystal_I2C-master
exit status 1

Compilation error: 'class BlynkWifi' has no member named 'notification'

Blynk.notification() was never a valid Blynk command as far as I know.
Blynk.notify() was a valid Legacy command, but this has now been replaced with different method which uses Events.

This is the Blynk documentation…

and you might find this helpful…

When you fix that you also need to take care of all that garbage in your void loop. You should read this…

Pete.

As you mentioned earlier I removed “all the garbage in my void loop”. This is a simpler code as I removed all th codes for the lcd and buzzer. this is just for the blynk app notification. and I get an error that,

#define BLYNK_TEMPLATE_NAME "x"
#define BLYNK_AUTH_TOKEN "x"

#define Blynk_email
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;

char ssid[] = "";  // Enter your wifi name
char pass[] = "";  // Enter your wifi password
int smokeA0 = A0;
int data = 0;
int sensorThres = 100;


BlynkTimer timer;

void sendSensor(){
 
 int data = analogRead(smokeA0);
 Blynk.virtualWrite(V0, data);
  Serial.print("Pin A0: ");
  Serial.println(data);


  if(data > 50)     // Change the Trashold value
  {
    Blynk.email("test@gmail.com", "Alert", "Gas Leakage Detected!");
    Blynk.logEvent("gas_alert","Gas Leakage Detected");
  }
}

void setup(){
  pinMode(smokeA0, INPUT);
   Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  //dht.begin();
  timer.setInterval(2500L, sendSensor);
}

void loop(){
  Blynk.run();
  timer.run();
}```

And I still get the error as:

C:\Users\91978\Desktop\LPG_detection\Blynk20_GAS_Leakage_MQ2\Blynk20_GAS_Leakage_MQ2.ino: In function 'void sendSensor()':
C:\Users\91978\Desktop\LPG_detection\Blynk20_GAS_Leakage_MQ2\Blynk20_GAS_Leakage_MQ2.ino:33:11: error: 'class BlynkWifi' has no member named 'email'
   33 |     Blynk.email("test.com", "Alert", "Gas Leakage Detected!");
      |           ^~~~~

exit status 1

Compilation error: 'class BlynkWifi' has no member named 'email'

I added a blynk library from manage libraries in Arduino ide itself. I also manually installed a blynk library to my sketch. Now, What can I do to rectify this?

That’s because Blynk.email() is also a Legacy command which is nor recognised in Blynk IoT.

Emails are also sent via Events in Blynk IoT.

However, the way that you have written the logEvent code you will exceed your daily allowance of events in just over 4 minutes of data > 50 and in that time you’ll only receive around 4 notifications.
You need to use a variable as a flag to avoid this happening.

Pete.

Can You Help With This Code Please.
My Code:

#include "esp_camera.h"
#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
//
// WARNING!!! Make sure that you have either selected ESP32 Wrover Module,
//            or another board which has PSRAM enabled
//

// Select camera model
//#define CAMERA_MODEL_WROVER_KIT
//#define CAMERA_MODEL_ESP_EYE
//#define CAMERA_MODEL_M5STACK_PSRAM
//#define CAMERA_MODEL_M5STACK_WIDE
#define CAMERA_MODEL_AI_THINKER

#include "camera_pins.h"


#define LED 21
#define BUTTON 15

const char* ssid = "Kubra iPhone'u";
const char* password = "Kubra2123";
char auth[] = "hRfEs49KeGQOEwu0yyw3mTPDV33BkVOQ";

String my_Local_IP;

void startCameraServer();


void capture()
{
  digitalWrite(LED,HIGH);
  uint32_t number = random(40000000);
  Blynk.notify("Someone is at the door..");
  Serial.println("http://"+my_Local_IP+"/capture?_cb="+ (String)number);
  Blynk.setProperty(V1, "urls", "http://"+my_Local_IP+"/capture?_cb="+(String)number);
  delay(1000);
  digitalWrite(LED,LOW);
  
}
void setup() {
  Serial.begin(115200);
  pinMode(LED,OUTPUT);
  Serial.setDebugOutput(true);
  Serial.println();

  camera_config_t config;
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sscb_sda = SIOD_GPIO_NUM;
  config.pin_sscb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG;
  //init with high specs to pre-allocate larger buffers
  if (psramFound()) {
    config.frame_size = FRAMESIZE_UXGA;
    config.jpeg_quality = 10;
    config.fb_count = 2;
  } else {
    config.frame_size = FRAMESIZE_SVGA;
    config.jpeg_quality = 12;
    config.fb_count = 1;
  }

#if defined(CAMERA_MODEL_ESP_EYE)
  pinMode(13, INPUT_PULLUP);
  pinMode(14, INPUT_PULLUP);
#endif

  // camera init
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  }

  sensor_t * s = esp_camera_sensor_get();
  //initial sensors are flipped vertically and colors are a bit saturated
  if (s->id.PID == OV3660_PID) {
    s->set_vflip(s, 1);//flip it back
    s->set_brightness(s, 1);//up the blightness just a bit
    s->set_saturation(s, -2);//lower the saturation
  }
  //drop down frame size for higher initial frame rate
  s->set_framesize(s, FRAMESIZE_QVGA);

#if defined(CAMERA_MODEL_M5STACK_WIDE)
  s->set_vflip(s, 1);
  s->set_hmirror(s, 1);
#endif

  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.println(F("WiFi connected"));

  startCameraServer();

  Serial.print("Camera Ready! Use 'http://");
  Serial.print(WiFi.localIP());
  my_Local_IP = WiFi.localIP().toString();
  Serial.println("' to connect");
  Blynk.begin(auth, ssid, password);
}

void loop() {
  // put your main code here, to run repeatedly:
  Blynk.run();
  if(digitalRead(BUTTON) == LOW)
  capture();
}

Errors:
C:\Users\win\OneDrive\Masaüstü\Smart_Door_Bell_using_Blynk_ESPEYE\Smart_Door_Bell_using_Blynk_ESPEYE.ino: In function ‘void capture()’:
Smart_Door_Bell_using_Blynk_ESPEYE:37:9: error: ‘class BlynkWifi’ has no member named ‘notify’
There are more than one libraries for “WiFi.h”
Using: C:\Users\win\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi
Not Using: C:\Users\win\OneDrive\Documents\Arduino\libraries\WiFi-1.2.7
Not Using: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1

@Kubra Please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```

Copy and paste these if you can’t find the correct symbol on your keyboard.

Pete.

İ Tried using Blynk.logEvent instead of Blynk.notify but now it says that it takes too much space

Exact error message please, plus details of your board type, board settings in the IDE etc.

Pete.

My Error:
C:\Users\win\OneDrive\Masaüstü\Smart_Door_Bell_using_Blynk_ESPEYE\Smart_Door_Bell_using_Blynk_ESPEYE.ino: In function ‘void capture()’:
Smart_Door_Bell_using_Blynk_ESPEYE:37:9: error: ‘class BlynkWifi’ has no member named ‘notify’
There are more than one libraries for “WiFi.h”
Using: C:\Users\win\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\WiFi
Not Using: C:\Users\win\OneDrive\Documents\Arduino\libraries\WiFi-1.2.7
Not Using: C:\Program Files (x86)\Arduino\libraries\WiFi
exit status 1

My Board:
Esp 32 Wrorer Module

etc

That’s the error message before you…

What about the error message that…

Also, you appear to be using ESP32 core version 1.0.6….

rather than version 2.0.9 available here…

Pete.