I want help in fetching data from blynk to my microcontroller

I want to fetch Value of V9 and V10 from blynk widget to microcontroller.

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>
#include <DHT.h>

BlynkTimer timer;

#define DEBUG_SW 1

#define BLYNK_TEMPLATE_ID "TMPL6YwdlToQy"
#define BLYNK_TEMPLATE_NAME "PowerGo"
#define BLYNK_AUTH_TOKEN "rtaR76YOEirD8qSjEgQ4OyTIQdkjZk3-"
// Pins of Switches
#define S5 13
#define S6 12
#define S7 14
#define S8 27

// Pins of Relay (Appliances Control)
#define R5 19
#define R6 18
#define R7 21
#define R8 5
#define wifi 2

#define DHTPIN 4
#define SMOKE_SENSOR_PIN 23 // Analog pin to connect the smoke sensor
#define SMOKE_THRESHOLD 630
#define DHTTYPE DHT11
//#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);

// By default the mode is with_internet
int MODE = 0;
int Authorize;
int person;
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "rtaR76YOEirD8qSjEgQ4OyTIQdkjZk3-";

char ssid[] = "Allah"; // username or SSID of your Wi-Fi
char pass[] = "love110786"; // password of your Wi-Fi

WiFiServer server(80);
int switch_ON_Flag1_previous_I = 0;
int switch_ON_Flag2_previous_I = 0;
int switch_ON_Flag3_previous_I = 0;
int switch_ON_Flag4_previous_I = 0;

int sensorData;
bool isHumanPresent = false; // New variable to track presence
const int sensorPin = 26; // Replace X with the actual pin number for the presence sensor
void checkBlynk();
void without_internet();
BLYNK_WRITE(V1)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  digitalWrite(R5, pinValue);
  // process received value
}

BLYNK_WRITE(V2)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V2 to a variable
  digitalWrite(R6, pinValue);
  // process received value
}

BLYNK_WRITE(V3)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V3 to a variable
  digitalWrite(R7, pinValue);
  // process received value
}

BLYNK_WRITE(V4)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V4 to a variable
  digitalWrite(R8, pinValue);
  // process received value
}
BLYNK_WRITE(V10) {
    int pinValue = param.asInt();
    Authorize = pinValue;
    Serial.print("Authorization Status:");
    Serial.println(Authorize);
}

BLYNK_WRITE(V9) {
    int pinValue = param.asInt();
    person = pinValue;
    Serial.print("People Count");
    Serial.println(person);
}
void setup()
{
  

  pinMode(S5, INPUT);
  pinMode(S6, INPUT);
  pinMode(S7, INPUT);
  pinMode(S8, INPUT);

  pinMode(R5, OUTPUT);
  pinMode(R6, OUTPUT);
  pinMode(R7, OUTPUT);
  pinMode(R8, OUTPUT);
  pinMode(wifi, OUTPUT);
  pinMode(sensorPin, INPUT); // Set the sensor pin as an INPUT
  pinMode(SMOKE_SENSOR_PIN, INPUT);
  Serial.begin(9600);
  WiFi.begin(ssid, pass);

  timer.setInterval(3000L, checkBlynk); // check if connected to Blynk server every 3 seconds
  Blynk.config(auth);
}

void loop()
{
  if (WiFi.status() != WL_CONNECTED)
  {
    if (DEBUG_SW) Serial.println("Not Connected");
    digitalWrite(wifi, LOW);
  }
  else
  {
    if (DEBUG_SW) Serial.println("Connected");
    digitalWrite(wifi, HIGH);
    Blynk.run();
  }
    Serial.print("Authorization Status:");
    Serial.println(Authorize);
    Serial.print("People Count");
    Serial.println(person);
    timer.run(); // Initiates SimpleTimer
  
  if (MODE == 0)
    with_internet();
  else
    without_internet();

// Check the presence sensor state
  if (isHumanPresent && digitalRead(sensorPin) == LOW)
  {
    // No one is present and the sensor signal is low, turn off all relays
    digitalWrite(R5, HIGH);
    digitalWrite(R6, HIGH);
    digitalWrite(R7, HIGH);
    digitalWrite(R8, HIGH);
    Blynk.virtualWrite(V1, 1);
    Blynk.virtualWrite(V2, 1);
    Blynk.virtualWrite(V3, 1);
    Blynk.virtualWrite(V4, 1);

    // Update the state to indicate that no one is present
    isHumanPresent = false;
    Blynk.virtualWrite(V7, "Room Empty");
  }
  else if (!isHumanPresent && digitalRead(sensorPin) == HIGH)
  {
    // Someone is present, update the state
    isHumanPresent = true;
    Blynk.virtualWrite(V7, "Human Present");
  }
  sendSensor();
  int smokeValue = analogRead(SMOKE_SENSOR_PIN);

  /*Serial.print("Smoke Value: ");
  Serial.println(smokeValue);*/

  if (smokeValue < SMOKE_THRESHOLD) {
    Serial.print("Smoke Value: ");
    Serial.println(smokeValue);
    Serial.println("Smoke detected!");
    // Add your smoke detection actions here
  }

  delay(100);  // You can adjust the delay as needed
}

void sendSensor()
{
  float h = dht.readHumidity();
  float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit

  if (isnan(h) || isnan(t)) {
  Serial.println("Failed to read from DHT sensor!");
    return;
  }
  // You can send any value at any time.
  // Please don't send more that 10 values per second.
  Blynk.virtualWrite(V5, h);
  Serial.println("Humidity:");
  Serial.print(h);
  Blynk.virtualWrite(V6, t);
  Serial.println("Temp:");
  Serial.print(t);
}

void with_internet()
{
   // FOR SWITCH
   if (Authorize == 1){
  if (digitalRead(S5) == LOW)
  {
    if (switch_ON_Flag1_previous_I == 0 )
    {
      digitalWrite(R5, HIGH);
      if (DEBUG_SW) Serial.println("Relay1- ON");
      Blynk.virtualWrite(V1, 1);
      switch_ON_Flag1_previous_I = 1;
    }
    if (DEBUG_SW) Serial.println("Switch1 -ON");

  }
  if (digitalRead(S5) == HIGH )
  {
    if (switch_ON_Flag1_previous_I == 1)
    {
      digitalWrite(R5, LOW);
      if (DEBUG_SW) Serial.println("Relay1 OFF");
      Blynk.virtualWrite(V1, 0);
      switch_ON_Flag1_previous_I = 0;
    }
    if (DEBUG_SW)Serial.println("Switch1 OFF");
  }


  if (digitalRead(S6) == LOW)
  {
    if (switch_ON_Flag2_previous_I == 0 )
    {
      digitalWrite(R6, HIGH);
      if (DEBUG_SW)  Serial.println("Relay2- ON");
      Blynk.virtualWrite(V2, 1);
      switch_ON_Flag2_previous_I = 1;
    }
    if (DEBUG_SW) Serial.println("Switch2 -ON");

  }
  if (digitalRead(S6) == HIGH )
  {
    if (switch_ON_Flag2_previous_I == 1)
    {
      digitalWrite(R6, LOW);
      if (DEBUG_SW) Serial.println("Relay2 OFF");
      Blynk.virtualWrite(V2, 0);
      switch_ON_Flag2_previous_I = 0;
    }
    if (DEBUG_SW)Serial.println("Switch2 OFF");
    //delay(200);
  }

  if (digitalRead(S7) == LOW)
  {
    if (switch_ON_Flag3_previous_I == 0 )
    {
      digitalWrite(R7, HIGH);
      if (DEBUG_SW) Serial.println("Relay3- ON");
      Blynk.virtualWrite(V3, 1);
      switch_ON_Flag3_previous_I = 1;
    }
    if (DEBUG_SW) Serial.println("Switch3 -ON");

  }
  if (digitalRead(S7) == HIGH )
  {
    if (switch_ON_Flag3_previous_I == 1)
    {
      digitalWrite(R7, LOW);
      if (DEBUG_SW) Serial.println("Relay3 OFF");
      Blynk.virtualWrite(V3, 0);
      switch_ON_Flag3_previous_I = 0;
    }
    if (DEBUG_SW)Serial.println("Switch3 OFF");
    //delay(200);
  }

  if (digitalRead(S8) == LOW)
  {
    if (switch_ON_Flag4_previous_I == 0 )
    {
      digitalWrite(R8, HIGH);
      if (DEBUG_SW) Serial.println("Relay4- ON");
      Blynk.virtualWrite(V4, 1);
      switch_ON_Flag4_previous_I = 1;
    }
    if (DEBUG_SW) Serial.println("Switch4 -ON");

  }
  if (digitalRead(S8) == HIGH )
  {
    if (switch_ON_Flag4_previous_I == 1)
    {
      digitalWrite(R8, LOW);
      if (DEBUG_SW) Serial.println("Relay4 OFF");
      Blynk.virtualWrite(V4, 0);
      switch_ON_Flag4_previous_I = 0;
    }
    if (DEBUG_SW) Serial.println("Switch4 OFF");
    //delay(200);
  }
   }
}
void without_internet()
{
  // FOR SWITCH
  if (Authorize == 1){
  digitalWrite(R5, !digitalRead(S5));
  digitalWrite(R6, !digitalRead(S6));
  digitalWrite(R7, !digitalRead(S7));
  digitalWrite(R8, !digitalRead(S8));}
}

// Check Blynk Connectivity every 3 seconds
void checkBlynk()
{
  bool isconnected = Blynk.connected();
  if (isconnected == false)
  {
    MODE = 1;
  }
  if (isconnected == true)
  {
    MODE = 0;
  }
}

You’ll need to explain more about the results you’re getting with the code you’ve posted, the types of widgets you’re using, the details of the datastreams you’ve defined etc.

You have far too much code in your void loop, and you appear to be using an old library version if this code compiles without errors.

Pete.

All my code is working fine.
I’m just facing issue while receiving data from blynk datastream to my microcontroller its not showing on serial monitor.
These are steps of data transfer.

You’ve dismissed most of what I’ve said, and provided only partial details of your project, so I’ll take a step back and either wait until you make some changes or others want to step-in with their opinions.

Good luck with your project.

Pete.