I have problem about Notification delay.
I want to make notification delay every 1 minute
This is my event setting:
This is my whole code :
#define BLYNK_TEMPLATE_ID "TMPL1ZBP7FMf"
#define BLYNK_DEVICE_NAME "MUSHROOM"
#define BLYNK_AUTH_TOKEN "************"
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <DHT.h>
#include <DHT_U.h>
#include <SimpleTimer.h>
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "******";
char pass[] = "******";
#define DHTPIN D2
#define DHTTYPE DHT11
#define relay D1
DHT dht(DHTPIN, DHTTYPE);
SimpleTimer timer;
void sendSensor()
{
float h = dht.readHumidity();
float t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
Blynk.virtualWrite(V5, h);
Blynk.virtualWrite(V6, t);
Serial.println(dht.readHumidity());;
if (V5 < 70){
Blynk.logEvent("moisalert", "Humidity Low");
Serial.println("Humidity Low");
}
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
dht.begin();
timer.setInterval(1000L, sendSensor);
pinMode(relay, OUTPUT);
}
void loop()
{
Blynk.run();
timer.run();
}
BLYNK_WRITE(V1)
{
int button = param.asInt();
if (button == 1){
digitalWrite(relay, HIGH);
Serial.println(button);
}
else if (button == 0){
digitalWrite(relay, LOW);
Serial.println(button);
}
}
This is notify code :
if (V5 < 70){
Blynk.logEvent("moisalert", "Humidity Low");
Serial.println("Humidity Low");
}