Need help for notification pop up

Before creating the topic

  1. Search forum for similar topics
  2. Check http://docs.blynk.cc and http://help.blynk.cc/
  3. Add details :
    • ESP8266 with WiFi
    • Smartphone Android version 10
    •local server
    • Blynk version 1.10.5
    • Add your sketch code. :point_up:Code should be formatted as example below.

Simply paste your code between

BlynkTimer timer;
int flag=0;
void notifyOnFire()
{
  int isButtonPressed = digitalRead(D1);
  if (isButtonPressed==0 && flag==0) {
    Serial.println("Its Raining");
    Blynk.logEvent("rain_alert","Its Raining");
    flag=1;
  }
  else if (isButtonPressed==1)
  {
    flag=0;
  }
}
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
pinMode(D1,INPUT);
timer.setInterval(1000L,notifyOnFire); 
}
void loop()
{
  Blynk.run();
  timer.run();
}

i already did my notification setup and can be upload on the board but there is no notification pop up on my laptop or phone

Does “Its Raining” appear in your serial monitor when you press the button attached to pin D1 for at least 5 seconds?

Some screenshots would be useful.

The notifications will appear on your phone, provided you’ve granted the Blynk app the necessary permissions, and your phone isn’t in “do not disturb” mode.

More info on notifications here…

Pete.

Thank you for the reply sir Pete

I’m not using any button I directly using rain sensor connect to esp8266 board and my phone already allow the notification and it is not in “do not disturb” mode. My reference making this project as in the link Youtube “Rain Alarm Notification in Mobile | IOT Projects - YouTube” and “Rain Notification Using Blynk IOT | Blynk 2.0 Notification | ESP 32 | IOT Projects - YouTube”.

In that case you really ought to sort-out your naming conventions…

You haven’t answered the most important question, do you see the message in the serial monitor?

Pete.

it does say its raining but no pop up notification appear

When you post serial monitor output, please copy the text from the serial monitor and paste it between triple backticks, the same way that you would with code.

What do you see in the Device Timeline screen of the web console, and what does the white “Notification Settings” button show when you click it?

Pete.

Sir Pete

Thank you for your reply and your time. I already solve the problem the notification did pop up. I resend the code and reconnect the board with my mobile hotspot. It works thank you sir I appreciate it.

Johny

Ok sir ill keep the triple backtick in mind.

Thank you for your time