Blynk aleart error

it’s connected and working, but the aleart doesn’t work What’s the problem?

//#define BLYNK_TEMPLATE_ID           "TMPxxxxxx"
//#define BLYNK_TEMPLATE_NAME         "Device"
//#define BLYNK_AUTH_TOKEN   "XXXXXXX"
#include "BlynkEdgent.h"

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

#define DOOR_SENSOR 4
#define led 16
BlynkTimer timer;
char auth[] = "XXXXXXXXXXXXXXXXXX";
char ssid[] = "GXXXXX"; // WiFi 네트워크 이름
char pass[] = "12XXXXX"; // WiFi 비밀번호
int flag=0;

void notifyOnButtonPress()
{
  int isButtonPressed = digitalRead(DOOR_SENSOR);
  if (isButtonPressed==1 && flag==0) {
    Serial.println("Someone Opened the door");
    Blynk.logEvent("alert", "Someone opened the Door");
    digitalWrite(led, HIGH);
    flag=1;
  }
  else if (isButtonPressed==0)
  {
    flag=0;
    Serial.println("Door Closed");
    digitalWrite(led, LOW);
  }
}
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
pinMode(DOOR_SENSOR, INPUT_PULLUP);
pinMode(led, OUTPUT);
timer.setInterval(10000L, notifyOnButtonPress); 
}
void loop()
{
  Blynk.run();
  timer.run();
}
'''
![security event|428x500](upload://wofFlzJY1zeRjXdklHgvLl4nJKd.png)
![securityevent2|430x500](upload://ucRg1FwOSTJjXTMoUendCiBOoKC.jpeg)

Without knowing how you’ve configured your Event and the notification options for that event it’s very difficult to make a guess.

Pete.


Are you talking about this?

That’s part of it, yes.

Your event in the screenshot is called “security_alerts” yet your code is trying to log an event with the name “alert”…

In addition, your “security_alerts” event is set to “Every 100 message will trigger the alert”. This means that you’ll need to open and close your door 100 times before tge event is triggered.

Whether this would also send a notification depends on what you have in the Notificatiins tab of your event setup page.

Pete.