How to turn ON/OFF PIR Sensor in Blynk using NodeMcu Esp8266?

details :
• NodeMCU Esp8266, PIR Sensor, Buzzer
• Android, Windows 10


#define BLYNK_TEMPLATE_ID           "xxxxxxxxxxxxxxxxxxx"
#define BLYNK_DEVICE_NAME           "xxxxxxxxxxx"
#define BLYNK_AUTH_TOKEN            "xxxxxxxxxxxxxxxxxxxxxxxxxxx"



// Comment this out to disable prints and save space
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

char auth[] = BLYNK_AUTH_TOKEN;


#include <Wire.h>
#include <ESP8266WiFi.h>
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>


char ssid[] = "xxxxx";
char pass[] = "xxxxxxx";

BLYNK_WRITE();


#define BOTtoken "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
#define CHAT_ID "xxxxxxxxxxxxxxxxxxx"

#define Sensor D0
#define LEDR D3
#define LEDG D4
#define Buzzer D5

X509List cert(TELEGRAM_CERTIFICATE_ROOT);
WiFiClientSecure client;
UniversalTelegramBot bot(BOTtoken, client);


void setup() {
  Serial.begin(115200);
  //lcd.init();
  //lcd.backlight();
  Blynk.begin(auth, ssid, pass);  
  Wire.begin(D2, D1);
  configTime(0, 0, "pool.ntp.org");      // get UTC time via NTP
  client.setTrustAnchors(&cert); // Add root certificate for api.telegram.org

  pinMode(Sensor, INPUT);
  pinMode(LEDR, OUTPUT);
  pinMode(LEDG, OUTPUT);
  pinMode(Buzzer, OUTPUT);



  int a = 0;
  while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    //lcd.setCursor(a, 0);
   //lcd.print(".");
    delay(500);
    a++;
  }


  Serial.println("");
  //lcd.clear();
  //lcd.setCursor(0, 0);
  //lcd.print("WiFi connected");
  Serial.println("WiFi connected");
  Serial.print("IP address: ");
  //lcd.setCursor(0, 1);
  //lcd.print(WiFi.localIP());
  Serial.println(WiFi.localIP());
  delay(500);

  bot.sendMessage(CHAT_ID, "System started", "");
  //lcd.clear();
  //lcd.setCursor(0, 0);
  //lcd.print("System started");
  delay(1000);
  //lcd.clear();
}

void loop() {
  bool value = digitalRead(Sensor);
  Serial.println(value);
  if (value == 1) {
    Serial.println("Motion Detected");
    digitalWrite(LEDR, HIGH);
    digitalWrite(Buzzer, HIGH);
    digitalWrite(LEDG, LOW);
    //lcd.setCursor(0, 0);
    //lcd.print("Motion Detected");
    bot.sendMessage(CHAT_ID, "MALING !!", "");
  } else if (value == 0) {
    digitalWrite(LEDR, LOW);
    digitalWrite(Buzzer, LOW);
    digitalWrite(LEDG, HIGH);
    //lcd.setCursor(0, 0);
    //lcd.print("No Motion      ");
  } 
   Blynk.run(V1);
  
}

[quote=“Dans, post:1, topic:64051”]
Blynk.run(V1);
[/quote

What is this meant to do?

You should probably start by reading this…

https://docs.blynk.io/en/legacy-platform/legacy-articles/keep-your-void-loop-clean

It would also help if you explained more about what you are trying to achieve.
Are you attempting to use a Blynk widget to have PIR triggers ignored?

Pete.