Notification problem blynk 2

I applied all the instructions to achieve the notifications, but I did not succeed. It seems that there is a problem related to the notifications and the way to activate the notifications is somewhat tedious if it was as in blynk v1 it was much easier and there is no complexity

Are you using automations or events ?

Thank you dear @John93 , I tried what is in the following link, but I didn’t get any result, unfortunately

What link ?

@John93

It’s really weird, everything looks fine.

You can use the automation instead, it’s definitely gonna work and it’s easier to use, no code required.

I need you to try something.

Add int maxtemp = 15; in the beginning of your sketch, below the included sketches.

Then use if ( t > maxtemp ) instead of ( t > 15 ).

1 Like

Dear @John93 , I did not mean that I tried the code in the link, but I made the settings for activating notifications. As for the code, I put the notification in void and called it in the timer every 4 seconds, but I never received notifications. It seems that there is a glitch in the blynk 2 system

I suspect that the “glitch” is more to do with your code and your console/app configuration.

Pete.

Remember that there’s a limitations when you send email or notification. Maybe if you increase the timer to 10 or 15 seconds that will fix you problem.

It works normally with blynk legacy, it’s not related to the code, I don’t know what the exact error is, but I’m sure there is nothing wrong with my end @PeteKnight

I don’t think it’s a logical reason, my dear @John93

Have you tried to increase the timer ?

Notifications work totally differently in Blynk IoT, as has already been explained.

Pete.

1 Like

#define BLYNK_TEMPLATE_ID "TMPLJdwoGQJZ"
#define BLYNK_DEVICE_NAME "ULTRA TECH"
#define BLYNK_FIRMWARE_VERSION        "0.3.0"
#define BLYNK_PRINT Serial
#define APP_DEBUG
#include <ModbusMaster.h>
#include <SoftwareSerial.h>
#include "BlynkEdgent.h"
#define vPIN_LogTerminal12            V1 // terminal


void Test (){

  Blynk.virtualWrite(vPIN_LogTerminal12,"Test terminal");
  Blynk.notify("Test Notify");
  digitalWrite(D0,LOW);
  Serial.println("0");
  delay(200);
  digitalWrite(D0,HIGH);
  Serial.println("1");
  delay(200);
}

void setup()
{
  BlynkEdgent.begin();
  Serial.begin(115200);
  
  pinMode(D0,OUTPUT);
  digitalWrite(D0,HIGH);
  timerTest.setInterval(4000L, Test);

}


void loop()
{

  BlynkEdgent.run();
  
} ```