Différer une notification de température Mega blynk

Before creating the topic

  1. Search forum for similar topics
  2. Check http://docs.blynk.cc and http://help.blynk.cc/
  3. Add details :
    • Hardware model + communication type. For example: Arduino UNO with Ethernet Shield
    • Smartphone OS (iOS or Android) + version
    • Blynk server or local server
    • Blynk Library version
    • Add your sketch code. :point_up:Code should be formatted as example below.

Simply paste your code between ``` If you don’t format your code, your topic can be deleted by moderators.

#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
 
char auth[] = "XXXXXXXXXXXXXXXX";
char ssid[] = "XXXXXXXXXXXXXXXX";
char pass[] = "XXXXXXXXXXXXXXXX";
 
SimpleTimer timer;
 
#define ONE_WIRE_BUS 2 // DS18B20 on arduino pin2 corresponds to D4 on physical board "D4 pin on the ndoemcu Module"
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature DS18B20(&oneWire);
float temp;
float Fahrenheit=0;
 
int Dsensor = D2; // Refrigerator door sensor= D0 sur Wemos D1 R1
// Tracks the time since last event fired
unsigned long previousMillis=0;
unsigned long int previoussecs = 0; 
unsigned long int currentsecs = 0; 
unsigned long currentMillis = 0; 
int interval= 1; // 1 second interval
int secs = 0; // current seconds
int mints = 0;  // current minutes
 
int pmints = 0; // Le chiffre indique le nombres de minutes + 59 secodes avant alerte ouverture porte !!!
 
int tempf = 0; // temperature flag
 
int tvr = A0; // temperature variable resistor, variable resistor to set the temperature
int Ptemp; // preset temperature. 
 
void setup() 
{
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  DS18B20.begin();
  pinMode(Dsensor, INPUT_PULLUP);
  pinMode(tvr, INPUT); 
  timer.setInterval(1000L, getSendData);
  timer.setInterval(1000L, DoorSensor);
}
 
void loop() 
{
  timer.run(); // Initiates SimpleTimer
  Blynk.run();
}
 
/***************************************************
 * Send Sensor data to Blynk
 **************************************************/
void getSendData()
{
  Ptemp = analogRead(tvr); 
  Ptemp = map(Ptemp, 0, 1023, -40,40); 
  DS18B20.requestTemperatures(); 
  temp = DS18B20.getTempCByIndex(0); // Celcius
   Fahrenheit = DS18B20.toFahrenheit(temp); // Fahrenheit
  Serial.println(temp);
  Serial.println(Fahrenheit);
  Blynk.virtualWrite(V6,Ptemp);
  Blynk.virtualWrite(V2, temp); //virtual pin V3
 
  if ( (temp >= Ptemp) && (tempf == 0))
  {
    Blynk.notify("Check temperature"); 
    tempf = 1; 
  }
 
    if ( (temp < Ptemp) && (tempf == 1))
  {
    Blynk.notify("looks good"); 
    tempf = 0; 
  }
  
}
void DoorSensor()
{
 
 if(digitalRead(Dsensor) == LOW)
 {
  Blynk.virtualWrite(V4,0);
  Blynk.virtualWrite(V5,255);
 
   secs = 0; 
   mints = 0; 
 }
 
  if(digitalRead(Dsensor) == HIGH)
 {
  Blynk.virtualWrite(V4,255);
  Blynk.virtualWrite(V5,0);
        currentMillis = millis();
   currentsecs = currentMillis / 1000; 
    if ((unsigned long)(currentsecs - previoussecs) >= interval) {
      secs = secs + 1; 
   
      if (secs >59 ) 
      {
        secs = 0; 
   mints = mints + 1;  
if(mints >= pmints )
{
  secs = 0; 
  mints = 0;
  Blynk.notify("Porte ouverte depuis trop longtemps !!!");  
}
 
      }   
      previoussecs = currentsecs;
   }
 }
 
 Blynk.virtualWrite(V3, "Seconds");
Blynk.virtualWrite(V3, secs);  
 Blynk.virtualWrite(V3, "Mints");
Blynk.virtualWrite(V3, mints); 
Blynk.virtualWrite(V3,"*********");
 
}

Bonjour,je voudrais pourvoir différer l’alerte température dans le cas ou je rempli la chambre froide et que la température augment sans pour générer de dégradation des produits congelé.Je cherche mais ne trouve pas de solution à mon problème!Pour ce qui est de la porte tout fonctionne,je voudrai la même chose pour la température mais n’étant pas programmateur je pédale! Merci d’avance pour les bonnes volontés.