BLYNK
BLYNK.IO       📲 GETTING STARTED       đź“— DOCS       âť“HELP CENTER       👉 SKETCH BUILDER

Secure connection failed Error Message

Hello Pete
Can you help me? I have same problem.
The ESP32 unit freeze does not connect to cloud or
if yes few hours later drops.
What can I do?

Connecting to TP-Link_93EA_EXT
…
WiFi connected.
IP address:
192.168.0.131
[17028]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v1.0.1 on ESP32

[17032] --------------------------
[17035] Product: Heat Pump
[17037] Hardware: 1.0.0
[17039] Firmware: 0.1.0 (build Sep 25 2021 10:02:32)
[17044] Token: …xU9O
[17046] Device: ESP32 @ 240MHz
[17049] MAC: 24:0A:C4:C5:66:40
[17053] Flash: 4096K
[17055] ESP sdk: v3.3.5-1-g85c43024c
[17058] Chip rev: 1
[17060] Free mem: 271004
[17062] --------------------------
[17065] INIT => CONNECTING_NET
[17607] Connecting to WiFi: TP-Link_93EA
[17630] Using Dynamic IP: 192.168.0.131
[17630] CONNECTING_NET => CONNECTING_CLOUD
TimeToEnergyCollection=0
[17641] Connecting to blynk.cloud:443
[23925] Secure connection failed
[23935] Connecting to blynk.cloud:443

I’ve moved your post to a new topic, as the old topic was about Blynk Legacy and you are using Blynk IoT.

Please post your sketch, correctly formatted using triple backticks, which look like this:
```

Note that the characters you used in your post above are not triple backticks, which is why the Blynk logo doesn’t display correctly.

Pete.

There is a serial output of debug.
The full sketch is more than 1000 lines.
If the sketch can connect to WiFi network correctly, why cannot connect to cloud?
Thank you
Steve

You’ve said that sometimes it does connect to the Blynk cloud server, then disconnects after several hours.
This is usually caused by the use of delays in the code, or not keeping your void loop clean.
Without seeing your sketch, it’s impossible to say if any of these issues are the cause.

Pete.

Hello Pete,
I cannot go forward in my project. I need your support.
The code is so long more than 32000 characters therefore I cannot upload one.
I will divide to two section.
Thank you for your effort.
Pucz

#define BLYNK_TEMPLATE_ID "TMPxxxxxxxxxxx"
#define BLYNK_DEVICE_NAME "Heat Pump"

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#include "DHT.h"
#include <arduino.h>
#include <WiFi.h>
#include <EEPROM.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include "HardwareSerial.h"
#include "Nextion.h"

#include <NTPClient.h>
#include <WiFiUdp.h>

WiFiUDP ntpUDP;

const char* ssid     = "TP-Link_93EA_EXT";
const char* password = "xxxxxxxxxx";

NTPClient timeClient(ntpUDP);

#define BLYNK_PRINT Serial

#define APP_DEBUG
#define nexSerial Serial2

#include "BlynkEdgent.h"

#define RX1_pin  14 (csatlakozó 6-os láb)
#define TX1_pin  26

#define RX2_pin  16
#define TX2_pin  17

#define LED1 32  // WIFI Yellow
//#define LED2 33  // WIFI Blue

#define EEPROM_SIZE 100
#define ONE_WIRE_BUS 25
#define TEMPERATURE_PRECISION 8
#define BAUD_RATE 115200

#define Relay2   2
#define Relay3   4
#define Relay4   15

#define WaterCleaner  5

#define RoomSensor  14

DHT dht(27, DHT11);
DHT dht1(18, DHT11);

HardwareSerial DebugDisplay(1);
HardwareSerial Display(2);
unsigned long previousMillis = 0;
unsigned long previousMillis1 = 0;
unsigned long previousMillis2 = 0;        
unsigned long previousMillis3 = 0;
unsigned int HeaterPumpHyst=5000; 

bool debug = 0;
bool heaterbit = 1;
bool mudbit = 1;
bool bubbit = 1;
bool exchangerbit=1;
bool BufferHeating=0;
bool BufferUseable=0;
bool trigger1=1;
bool togglebit=0;
bool OP1pic=0;
bool OP2pic=0;
bool OP3pic=0;
bool OP4pic=0;
bool OP5pic=0;
bool OP6pic=0;
bool OP7pic=0;
bool OP8pic=0;
bool manubit=0;
bool manuTherm=0;
bool TimeToEnergyCollection=0;
byte TankTempMin=26;
byte Days=0; 
byte DaysCnt=0;
byte BubbleCtrl=0;
float HeatPumpOut = 0;
float HeatPumpIn = 0;
float HeatExchangerOut = 0;
float HeatExchangerIn = 0;
float TankTemp = 70;
float WaterForward = 0; 
float WaterReturn = 0;  

byte ErrorCnt=0;
byte SensorCounter=0;
String formattedDate;
String dayStamp;
String dayStampMemo;

String timeStamp;
String Hour1;
String Minute1;

byte Hour=0;
byte Min=0;
byte JIT_val=0;
int HourMin;

int TM1_Begin_Hour_min;
int TM1_End_Hour_min;
int TM2_Begin_Hour_min;
int TM2_End_Hour_min;
int TM3_Begin_Hour_min;
int TM3_End_Hour_min;
int TM4_Begin_Hour_min;
int TM4_End_Hour_min;
int TM5_Begin_Hour_min;
int TM5_End_Hour_min;

String RtcTime="Time:";
String RtcDate="Date:";

  byte i,n;
  byte actualForm=4;
  byte present = 0;
  byte data[13];
  
  int temp;
  int temp3;
  byte slider_value = 0;
  byte Button0;
  byte Button1;

float internalTemp[10];
float internalHumi[10];
byte intCnt=0;
float intTemp=0;
float intHumi=0;

float externalTemp[10];
float externalHumi[10];
byte extCnt=0;
float extTemp=0;
float extHumi=0;

char puffer[10] = {0};
byte cntr; //Loop counter.
bool Toggle;
bool AutoManual=1;
bool HEPump=0;
bool FHPump=0;

byte TM1_Begin_Hour;
byte TM1_Begin_Min;
byte TM1_End_Hour;
byte TM1_End_Min;
int TM2_Begin_Hour;
int TM2_Begin_Min;
int TM2_End_Hour;
int TM2_End_Min;
int TM3_Begin_Hour;
int TM3_Begin_Min;
int TM3_End_Hour;
int TM3_End_Min;
int TM4_Begin_Hour;
int TM4_Begin_Min;
int TM4_End_Hour;
int TM4_End_Min;
int TM5_Begin_Hour;
int TM5_Begin_Min;
int TM5_End_Hour;
int TM5_End_Min;


int SliderValue[13] = {0};


OneWire oneWire(ONE_WIRE_BUS);

DallasTemperature sensors(&oneWire);

DeviceAddress devices[10];
int devicesFound = 0;
NexPicture p0 = NexPicture(1, 1 , "p0");
NexPicture p5 = NexPicture(1, 30, "p5");
NexProgressBar jx0 = NexProgressBar(0, 1, "j0");
NexProgressBar jx1 = NexProgressBar(0, 2, "j1");
NexProgressBar jx2 = NexProgressBar(0, 3, "j2");
NexProgressBar jy1 = NexProgressBar(1, 33, "j0");


NexPage page0    = NexPage(0, 0, "page0");
NexPage page1    = NexPage(1, 0, "page1");
NexPage page2    = NexPage(2, 0, "page2");
NexPage page3    = NexPage(3, 0, "page3");
NexText t0 = NexText(1, 3, "t0");   // TankTemp
NexText t1 = NexText(1, 2, "t1");   // HeatExchangerOut
NexText t2 = NexText(1, 4, "t2");   // WaterForward
NexText t3 = NexText(1, 5, "t3");   // WaterReturn

NexText t8 = NexText(1, 16, "t8");   // Date
NexText t9 = NexText(1, 17, "t9");   // Time

NexText t10 = NexText(1, 24, "t10"); // HeatPumpOut
NexText t11 = NexText(1, 25, "t11"); // HeatExchangerIn
NexText t12 = NexText(1, 26, "t12"); // HeatPumpIn


NexText OT = NexText(1, 27, "OT");   
NexText IT = NexText(1, 28, "IT");   
NexDSButton thermo = NexDSButton(1, 28, "thermo");
NexDSButton FHSW = NexDSButton(1, 8, "FHSW");
NexDSButton AM = NexDSButton(1, 28, "AM"); 

NexButton BS = NexButton(1, 21, "BS"); 
NexButton BW = NexButton(1, 22, "BW");
NexWaveform s0 = NexWaveform(1, 15, "s0");
NexSlider h0 = NexSlider(2, 1, "h0");
NexSlider h1 = NexSlider(2, 3, "h1");
NexSlider h2 = NexSlider(2, 5, "h2");
NexSlider h3 = NexSlider(2, 6, "h3");
NexSlider h4 = NexSlider(2, 7, "h4");
NexSlider h5 = NexSlider(2, 8, "h5");
NexSlider h6 = NexSlider(2, 9, "h6");
NexSlider h7 = NexSlider(2, 10, "h7");
NexSlider h8 = NexSlider(2, 11, "h8");
NexSlider h9 = NexSlider(2, 12, "h9");
NexSlider h10 = NexSlider(2, 22, "h10");
NexSlider h11 = NexSlider(2, 27, "h11");
NexSlider h12 = NexSlider(2, 28, "h12");
NexSlider h13 = NexSlider(2, 46, "h13");

NexSlider NAP = NexSlider(4, 31, "NAP");

NexNumber n0=NexNumber(2, 2, "n0");

NexText t0_2 = NexText(2, 26, "KH");   
NexText t1_2 = NexText(2, 27, "TH");   
NexText t2_2 = NexText(2, 23, "EG");
NexText t3_2 = NexText(2, 25, "PI");

//-------------------Page 3 --------------------------------------------
NexRadio CB1 = NexRadio(3, 15, "CB1");
NexCheckbox CX = NexCheckbox(3, 11, "CX");
NexProgressBar JB2 = NexProgressBar(3, 9, "JB2");
NexProgressBar JB1 = NexProgressBar(3, 5, "JB1");
NexProgressBar JIT = NexProgressBar(3, 1, "JIT");

//-------------------Page 4 --------------------------------------------
NexHotspot ENT = NexHotspot(4, 29, "ENT");
NexNumber RBT = NexNumber(4, 30, "RBT");
NexText TM1 = NexText(4, 9, "TM1");   
NexText TM2 = NexText(4, 10, "TM2");
NexText TM3 = NexText(4, 12, "TM3");
NexText TM4 = NexText(4, 13, "TM4");
NexText TM5 = NexText(4, 16, "TM5");
NexTouch *nex_listen_list[] = 
{
    &h0,
    &h1,
    &h2,
    &h3,
    &h4,
    &h5,
    &h6,
    &h7,
    &h8,
    &h9,
    &h10,
    &h11,
    &h12,
    &h13,
    &NAP,
    &BS,
    &BW,
    &AM,
    &FHSW,
    &CB1,
    &CX,
    &ENT,
    &thermo,
    NULL
};
//-----------------------------------------------------------------------------
void Read_Sensor()
{
  SensorCounter++;
  if(debug){Serial.print(" Requesting temperatures...");}
  sensors.requestTemperatures(); // Send the command to get temperatures
  if(debug){Serial.println("DONE");}
  if(devicesFound<6)
    {
      if(debug){Serial.println("Some sensor didn't found");}  
    }

  switch (SensorCounter) {
      case 1:
        HeatPumpOut=sensors.getTempCByIndex(0);Blynk.virtualWrite(V108, HeatPumpOut);
        DHT_Internal();Blynk.virtualWrite(V113, intTemp);
        if(debug){Serial.print("HeatPumpOut=");Serial.println(HeatPumpOut);}
        itoa(HeatPumpOut, puffer, 10);
        t10.setText(puffer);
        s0.addValue(0, 20 + HeatPumpOut * 5 );
      break;
      case 2:
        HeatPumpIn=sensors.getTempCByIndex(1);Blynk.virtualWrite(V109, HeatPumpIn);
        if(debug){Serial.print("HeatPumpIn=");Serial.println(HeatPumpIn);}
        itoa(HeatPumpIn, puffer, 10);
        t12.setText(puffer);
      break;
      case 3:
        HeatExchangerOut=sensors.getTempCByIndex(2);Blynk.virtualWrite(V110, HeatExchangerOut);
        if(debug){Serial.print("HeatExchangerOut=");Serial.println(HeatExchangerOut);}
        itoa(HeatExchangerOut, puffer, 10);
        t1.setText(puffer);  
        DHT_External();Blynk.virtualWrite(V114, extTemp);
      break;
      case 4: 
        HeatExchangerIn=sensors.getTempCByIndex(3);Blynk.virtualWrite(V111, HeatExchangerIn);
        if(debug){Serial.print("HeatExchangerIn=");Serial.println(HeatExchangerIn);}
        itoa(HeatExchangerIn, puffer, 10);
        t11.setText(puffer);  
      break;
      case 5:
        TankTemp=sensors.getTempCByIndex(4);Blynk.virtualWrite(V112, TankTemp);
        if(debug){Serial.print("TankTemp=");Serial.println(TankTemp);}
        itoa(TankTemp, puffer, 10);
        t0.setText(puffer);  
      break;
      case 6:  
        WaterForward=sensors.getTempCByIndex(5);Blynk.virtualWrite(V101,WaterForward);
        if(debug){Serial.print("WaterForward=");Serial.println(WaterForward);}
        itoa(WaterForward, puffer, 10);
        t2.setText(puffer);   
      break;
      case 7:  
        WaterReturn=sensors.getTempCByIndex(6);Blynk.virtualWrite(V102,WaterReturn);
        if(debug){Serial.print("WaterReturn=");Serial.println(WaterReturn);}
        itoa(WaterReturn, puffer, 10);
        t3.setText(puffer);SensorCounter=0;
      break;  
  }
}
void printAddress(DeviceAddress deviceAddress)
{
  for (uint8_t i = 0; i < 8; i++)
  {
    // zero pad the address if necessary
    if (deviceAddress[i] < 16) Serial.print("0");
    Serial.print(deviceAddress[i], HEX);
  }
}

String printTemperature(DeviceAddress deviceAddress)
{
  float tempC = sensors.getTempC(deviceAddress);
  if (tempC < 10)
    return "0" + (String)tempC;
  else
    return (String)tempC;
}

void printResolution(DeviceAddress deviceAddress)
{
  Serial.print("Resolution: ");
  Serial.print(sensors.getResolution(deviceAddress));
  Serial.println();    
}

void printData(DeviceAddress deviceAddress)
{
  Serial.print("Device Address: ");
  printAddress(deviceAddress);
  Serial.print(" ");
  printTemperature(deviceAddress);
  Serial.println();
}

void DHT_External()
{
   float h = dht.readHumidity();
   // Read temperature as Celsius (the default)
   float t = dht.readTemperature();
  if(t>-20 && t<50){extTemp=t;extHumi=h;}
  if(debug)
    {
     if(debug){
      Serial.print("External Temperature = ");
      Serial.println(extTemp);
      Serial.print("External Humidity = ");
      Serial.println(extHumi);}
    }
}

void DHT_Internal()
{
   float h = dht1.readHumidity();
   // Read temperature as Celsius (the default)
   float t = dht1.readTemperature();
  if(t>-20 && t<50){intTemp=t;intHumi=h;}
  if(debug)
    {
     Serial.print("Internal Temperature = ");
     Serial.println(intTemp);
     Serial.print("Internal Humidity = ");
     Serial.println(intHumi);
    }
}

// ----- Sliders position memorize ------
void h0PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h0PopCallback");
    h0.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H1 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[0]=slider_value;
    EEPROM.write( 0 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h1PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h1PopCallback");
    h1.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H1 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[1]=slider_value;
    EEPROM.write( 1 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h2PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h2PopCallback");
    h2.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H2 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[2]=slider_value;
    EEPROM.write( 2 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h3PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h3PopCallback");
    h3.getValue(&number);
    if(debug){Serial.print("H3 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[3]=slider_value;
    EEPROM.write( 3 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h4PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h4PopCallback");
    h4.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H4 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[4]=slider_value;
    EEPROM.write( 4 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h5PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h5PopCallback");
    h5.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H5 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[5]=slider_value;
    EEPROM.write( 5 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h6PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h6PopCallback");
    h6.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H6 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[6]=slider_value;
    EEPROM.write( 6 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h7PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h7PopCallback");
    h7.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H7 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[7]=slider_value;
    EEPROM.write( 7 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h8PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h8PopCallback");
    h8.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H8 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[8]=slider_value;
    EEPROM.write( 8 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h9PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h9PopCallback");
    h9.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H9 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[9]=slider_value;
    EEPROM.write( 9 , slider_value );
    EEPROM.commit();exchangerbit=1;
}

void h10PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h10PopCallback");
    h10.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H10 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[10]=slider_value;
    EEPROM.write( 10 , slider_value );
    EEPROM.commit();
}

void h11PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h11PopCallback");
    h11.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H11 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[11]=slider_value;
    EEPROM.write( 11 , slider_value );
    EEPROM.commit();
}

void h12PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h12PopCallback");
    h12.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H12 Slider value is: ");}
    if(debug){Serial.println(slider_value + 11);}
    SliderValue[12]=slider_value;
    EEPROM.write( 12 , slider_value);
    EEPROM.commit();
}

void h13PopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("h13PopCallback");
    h13.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H13 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[13]=slider_value;
    EEPROM.write( 14 , slider_value);
    EEPROM.commit();
}

void NAPPopCallback(void *ptr)
{
    char temp[10] = {0};
    uint32_t number = 0;    
    dbSerialPrintln("NAPPopCallback");
    NAP.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("NAP Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    Days=slider_value;
    EEPROM.write( 13 , slider_value );
    EEPROM.commit();
}

void FHSWPopCallback(void *ptr)
{
    uint16_t len;
    uint32_t number = 0;
    FHSW.getValue(&number);
    Button0=number;
    dbSerialPrintln(Button0); 
    if(Button0!=0)
     {
       FHPump=1;
       digitalWrite(Relay2, HIGH);
     }
    else
     {
       FHPump=0;
       digitalWrite(Relay2, LOW);
     }
}

void BSPopCallback(void *ptr)
{
    Serial.println("------- Display Setup Screen ------"); 
    if(OP6pic){sendCommand("OP6.pic=39");Serial.println("Eljött az energia gyűjtés ideje");}else{sendCommand("OP6.pic=40");Serial.println("Energia gyűjtés ciklus vége");}
    exchangerbit=1;
}

void BWPopCallback(void *ptr)
{
    if(debug){Serial.println("------- Display Water cleaner ------");}
    if(digitalRead(Relay4)){sendCommand("CB1.val=1");}else{sendCommand("CB1.val=0");}
    if(digitalRead(WaterCleaner)){sendCommand("CX.val=1");}else{sendCommand("CX.val=0");}
}


void AMPopCallback(void *ptr)
{
    uint16_t len;
    uint32_t number = 0;
    Serial.println("---------------------------------------------------------");
    AM.getValue(&number);
    dbSerialPrintln(number); 
    if(number>0)
     {
      Serial.println("----  AUTOMANUAL = 1  ----------------------------------");
       AutoManual=1;
     }
    else
     {
       AutoManual=0;
       Serial.println("----  AUTOMANUAL = 0  ----------------------------------");
     }
}

void CB1PopCallback(void *ptr)
{
    uint32_t number = 0;   
    dbSerialPrintln("Kompresszort bekapcsolása/kikapcsolása");
    CB1.getValue(&number);
    if(number==1)
      {
        digitalWrite(WaterCleaner,HIGH);sendCommand("CB1.val=1");Blynk.virtualWrite(V107,255);manubit=1;
      }
      else
      {
        digitalWrite(WaterCleaner,LOW);sendCommand("CB1.val=0");Blynk.virtualWrite(V107,LOW);manubit=0;  
      }
}

void thermoPopCallback(void *ptr)
{
    uint32_t number = 0;   
    dbSerialPrintln("Szobatermosztát bekapcsolása/kikapcsolása");
    thermo.getValue(&number);
    manuTherm=number;
    if(number==1)
      {
        Blynk.virtualWrite(V115,255);
      }
      else
      {
        Blynk.virtualWrite(V115,LOW);  
      }
}
void CXPopCallback(void *ptr)
{
    uint32_t number = 0;
    bool memory = 0;    
    dbSerialPrintln("Iszap vagy buborékoltatás váltószelep");
    CX.getValue(&number);
    if(number==0)
      {
        digitalWrite(Relay4,LOW);sendCommand("CX.val=0");Blynk.virtualWrite(V106,LOW);
      }
      else
      {
        digitalWrite(Relay4,HIGH);sendCommand("CX.val=1");Blynk.virtualWrite(V106,255);
      }  
}
void ENTPopCallback(void *ptr)
{
       char text_char[11];
       TM1.getText(text_char, 11);
       String BubbTM1=text_char;
       int splitT = BubbTM1.indexOf("-");
       String TM1_Begin = BubbTM1.substring(0, splitT);
       String TM1_End = BubbTM1.substring(splitT+1, splitT+6);
       splitT = TM1_Begin.indexOf(":");
       TM1_Begin_Hour = TM1_Begin.substring(0, splitT).toInt();
       TM1_Begin_Min = TM1_Begin.substring(splitT+1, splitT+3).toInt();
       splitT = TM1_End.indexOf(":");
       TM1_End_Hour = TM1_End.substring(0, splitT).toInt();
       TM1_End_Min = TM1_End.substring(splitT+1, splitT+3).toInt();
       if(debug){Serial.print(TM1_Begin_Hour);Serial.print("H");Serial.print(TM1_Begin_Min);Serial.print(" -> ");Serial.print(TM1_End_Hour);Serial.print("H");Serial.println(TM1_End_Min);}
       EEPROM.write(20,TM1_Begin_Hour);
       EEPROM.write(22,TM1_Begin_Min);
       EEPROM.write(24,TM1_End_Hour);
       EEPROM.write(26,TM1_End_Min);
       TM2.getText(text_char, 11);
       String BubbTM2=text_char;
       splitT = BubbTM2.indexOf("-");
       String TM2_Begin = BubbTM2.substring(0, splitT);
       String TM2_End = BubbTM2.substring(splitT+1, splitT+6);
       splitT = TM2_Begin.indexOf(":");
       TM2_Begin_Hour = TM2_Begin.substring(0, splitT).toInt();
       TM2_Begin_Min = TM2_Begin.substring(splitT+1, splitT+3).toInt();
       TM2_End_Hour = TM2_End.substring(0, splitT).toInt();
       TM2_End_Min = TM2_End.substring(splitT+1, splitT+3).toInt();
       EEPROM.write(28,TM2_Begin_Hour);
       EEPROM.write(30,TM2_Begin_Min);
       EEPROM.write(32,TM2_End_Hour);
       EEPROM.write(34,TM2_End_Min);
       TM3.getText(text_char, 11);
       String BubbTM3=text_char;
       splitT = BubbTM3.indexOf("-");
       String TM3_Begin = BubbTM3.substring(0, splitT);
       String TM3_End = BubbTM3.substring(splitT+1, splitT+6);
       splitT = TM3_Begin.indexOf(":");
       TM3_Begin_Hour = TM3_Begin.substring(0, splitT).toInt();
       TM3_Begin_Min = TM3_Begin.substring(splitT+1, splitT+3).toInt();
       TM3_End_Hour = TM3_End.substring(0, splitT).toInt();
       TM3_End_Min = TM3_End.substring(splitT+1, splitT+3).toInt();
       EEPROM.write(36,TM3_Begin_Hour);
       EEPROM.write(38,TM3_Begin_Min);
       EEPROM.write(40,TM3_End_Hour);
       EEPROM.write(42,TM3_End_Min);
       TM4.getText(text_char, 11);
       String BubbTM4=text_char;
       splitT = BubbTM4.indexOf("-");
       String TM4_Begin = BubbTM4.substring(0, splitT);
       String TM4_End = BubbTM4.substring(splitT+1, splitT+6);
       splitT = TM4_Begin.indexOf(":");
       TM4_Begin_Hour = TM4_Begin.substring(0, splitT).toInt();
       TM4_Begin_Min = TM4_Begin.substring(splitT+1, splitT+3).toInt();
       TM4_End_Hour = TM4_End.substring(0, splitT).toInt();
       TM4_End_Min = TM4_End.substring(splitT+1, splitT+3).toInt();
       EEPROM.write(44,TM4_Begin_Hour);
       EEPROM.write(46,TM4_Begin_Min);
       EEPROM.write(48,TM4_End_Hour);
       EEPROM.write(50,TM4_End_Min);
       TM5.getText(text_char, 11);
       String BubbTM5=text_char;
       splitT = BubbTM5.indexOf("-");
       String TM5_Begin = BubbTM5.substring(0, splitT);
       String TM5_End = BubbTM5.substring(splitT+1, splitT+6);
       splitT = TM5_Begin.indexOf(":");
       TM5_Begin_Hour = TM5_Begin.substring(0, splitT).toInt();
       TM5_Begin_Min = TM5_Begin.substring(splitT+1, splitT+3).toInt();
       TM5_End_Hour = TM5_End.substring(0, splitT).toInt();
       TM5_End_Min = TM5_End.substring(splitT+1, splitT+3).toInt();
       EEPROM.write(52,TM5_Begin_Hour);
       EEPROM.write(54,TM5_Begin_Min);
       EEPROM.write(56,TM5_End_Hour);
       EEPROM.write(58,TM5_End_Min);EEPROM.commit();
}
void Bubble_Control()
{
 switch (BubbleCtrl) {
    case 1:  
       digitalWrite(WaterCleaner,HIGH);
    break;   
    case 2:  
       digitalWrite(WaterCleaner,LOW);
    break;   
    case 3:  

    break;   
    case 4:  

    break;   
    case 5:  

    break;   
    case 6:  
      BubbleCtrl=0;
    break;   

//----------------------- 
    default:
    break;
 }
}
void SliderMemo()
  {
    char temp[10] = {0};
    uint32_t number = 0;    
    h0.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H1 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[0]=slider_value;
    EEPROM.write( 0 , slider_value );
    EEPROM.commit();exchangerbit=1;
    h1.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H1 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[1]=slider_value;
    EEPROM.write( 1 , slider_value );
    EEPROM.commit();exchangerbit=1;
    dbSerialPrintln("h2PopCallback");
    h2.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H2 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[2]=slider_value;
    EEPROM.write( 2 , slider_value );
    EEPROM.commit();exchangerbit=1;
    dbSerialPrintln("h3PopCallback");
    h3.getValue(&number);
    if(debug){Serial.print("H3 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[3]=slider_value;
    EEPROM.write( 3 , slider_value );
    EEPROM.commit();exchangerbit=1;
    dbSerialPrintln("h4PopCallback");
    h4.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H4 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[4]=slider_value;
    EEPROM.write( 4 , slider_value );
    EEPROM.commit();exchangerbit=1;
    dbSerialPrintln("h5PopCallback");
    h5.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H5 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[5]=slider_value;
    EEPROM.write( 5 , slider_value );
    EEPROM.commit();exchangerbit=1;
    dbSerialPrintln("h6PopCallback");
    h6.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H6 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[6]=slider_value;
    EEPROM.write( 6 , slider_value );
    EEPROM.commit();exchangerbit=1;
    dbSerialPrintln("h7PopCallback");
    h7.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H7 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[7]=slider_value;
    EEPROM.write( 7 , slider_value );
    EEPROM.commit();exchangerbit=1;
    dbSerialPrintln("h8PopCallback");
    h8.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H8 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[8]=slider_value;
    EEPROM.write( 8 , slider_value );
    EEPROM.commit();exchangerbit=1;
    dbSerialPrintln("h9PopCallback");
    h9.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H9 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[9]=slider_value;
    EEPROM.write( 9 , slider_value );
    EEPROM.commit();exchangerbit=1;
    dbSerialPrintln("h10PopCallback");
    h10.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H10 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[10]=slider_value;
    EEPROM.write( 10 , slider_value );
    EEPROM.commit();
    dbSerialPrintln("h11PopCallback");
    h11.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H11 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[11]=slider_value;
    EEPROM.write( 11 , slider_value );
    EEPROM.commit();
    dbSerialPrintln("h12PopCallback");
    h12.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H12 Slider value is: ");}
    if(debug){Serial.println(slider_value + 11);}
    SliderValue[12]=slider_value;
    EEPROM.write( 12 , slider_value);
    EEPROM.commit();
    dbSerialPrintln("NAPPopCallback");
    NAP.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("NAP Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    Days=slider_value;
    EEPROM.write( 13 , slider_value );
    EEPROM.commit();
    dbSerialPrintln("h13PopCallback");
    h13.getValue(&number);
    slider_value=number;
    if(debug){Serial.print("H13 Slider value is: ");}
    if(debug){Serial.println(slider_value);}
    SliderValue[13]=slider_value;
    EEPROM.write( 14 , slider_value);
    EEPROM.commit();
  }



void AllTempRefresh()
{
        sensors.requestTemperatures(); // Send the command to get temperatures
        HeatPumpOut=sensors.getTempCByIndex(0);Blynk.virtualWrite(V108, HeatPumpOut);
        HeatPumpIn=sensors.getTempCByIndex(1);Blynk.virtualWrite(V109, HeatPumpIn);
        HeatExchangerOut=sensors.getTempCByIndex(2);Blynk.virtualWrite(V110, HeatExchangerOut);
        HeatExchangerIn=sensors.getTempCByIndex(3);Blynk.virtualWrite(V111, HeatExchangerIn);
        TankTemp=sensors.getTempCByIndex(4);Blynk.virtualWrite(V112, TankTemp);
        WaterForward=sensors.getTempCByIndex(5);Blynk.virtualWrite(V101,WaterForward);
        WaterReturn=sensors.getTempCByIndex(6);Blynk.virtualWrite(V102,WaterReturn);
        DHT_Internal();Blynk.virtualWrite(V113, intTemp);
        DHT_External();Blynk.virtualWrite(V114, extTemp);
}

There is a second part of code


void setup()
{

  pinMode(WaterCleaner, OUTPUT);
  pinMode(Relay2, OUTPUT);
  pinMode(Relay3, OUTPUT);
  pinMode(Relay4, OUTPUT);
  pinMode(LED1, OUTPUT);
  pinMode(BOARD_BUTTON_PIN, INPUT_PULLUP);
  pinMode(RoomSensor,INPUT_PULLUP); //Szobatermosztát

  
  digitalWrite(WaterCleaner, LOW);
  digitalWrite(Relay2, LOW);
  digitalWrite(Relay3, LOW);
  digitalWrite(Relay4, LOW);
  
  
  Serial.begin(BAUD_RATE);
  while( !Serial && debug); // wait for serial port to connect. Needed for native USB
  Serial.println("Debug port connected");
  nexSerial.begin(115200, SERIAL_8N1, RX2_pin, TX2_pin);  // Serial 2 for Nextion Display
  // locate devices on the bus
  
  sensors.begin();

  Serial.print("Locating devices...");
  devicesFound = sensors.getDeviceCount();  
  Serial.print("Found ");
  Serial.print(devicesFound, DEC);
  Serial.println(" devices.");

  // report parasite power requirements
  Serial.print("Parasite power is: "); 
  if (sensors.isParasitePowerMode()) Serial.println("ON");
  else Serial.println("OFF");

  for (int i = 0; i < devicesFound; i++)
    if (!sensors.getAddress(devices[i], i)) 
      Serial.println("Unable to find address for Device" + i); 

  // show the addresses we found on the bus
  for (int i = 0; i < devicesFound; i++)
  {    
    Serial.print("Device " + (String)i + " Address: ");
    printAddress(devices[i]);
    Serial.println();
  }

  for (int i = 0; i < devicesFound; i++)
    sensors.setResolution(devices[i], TEMPERATURE_PRECISION);    
      while (!Serial && debug) {;} // wait for serial port to connect. Needed for native USB

  if (!EEPROM.begin(EEPROM_SIZE))
    {
     Serial.println("Failed to initialise EEPROM");
    }
    else
    { Serial.println("Initialise EEPROM Success");
      
    }  
  if(debug){Serial.println("------- Display Boot END ------");} 


    nexInit();  //Nextion display initialization
    
    h0.attachPop(h0PopCallback);
    h1.attachPop(h1PopCallback);
    h2.attachPop(h2PopCallback);
    h3.attachPop(h3PopCallback);
    h4.attachPop(h4PopCallback);
    h5.attachPop(h5PopCallback);
    h6.attachPop(h6PopCallback);
    h7.attachPop(h7PopCallback);
    h8.attachPop(h8PopCallback);
    h9.attachPop(h9PopCallback);
    h10.attachPop(h10PopCallback);
    h11.attachPop(h11PopCallback);
    h12.attachPop(h12PopCallback);
        /* Register the pop event callback function of the current text component. */

    /* Register the pop event callback function of the current button0 component. */
    FHSW.attachPop(FHSWPopCallback, &FHSW); // Floor heater  pump switch    
    
 
    BS.attachPop(BSPopCallback, &BS); // got to setup screen
    BW.attachPop(BWPopCallback, &BW); // go to water cleaner screen
    AM.attachPop(AMPopCallback, &AM); //Status of Auto-Manual switch
   

    CB1.attachPop(CB1PopCallback, &CB1);
    CX.attachPop(CXPopCallback, &CX);

    ENT.attachPop(ENTPopCallback, &ENT);


    dbSerialPrintln("setup done");

    page0.show();
  

// Get all slider value from EEPROM memory -----------------------------------

  for(byte qa=0;qa<13;qa++)
    {
      SliderValue[qa]=EEPROM.read(qa);
      SliderValue[qa]=SliderValue[qa]*(SliderValue[qa]<100);
    }
    Days=EEPROM.read(13)*(EEPROM.read(13)<11);
    DaysCnt=EEPROM.read(14)*(EEPROM.read(14)<11);
  //----------------------------------------------
       TM1_Begin_Hour = EEPROM.read(20);
       TM1_Begin_Min = EEPROM.read(22);
       TM1_End_Hour = EEPROM.read(24);
       TM1_End_Min = EEPROM.read(26);
       if(debug){Serial.print(TM1_Begin_Hour);Serial.print("H");Serial.print(TM1_Begin_Min);Serial.print(" -> ");Serial.print(TM1_End_Hour);Serial.print("H");Serial.println(TM1_End_Min);}
  //----------------------------------------------
       TM2_Begin_Hour = EEPROM.read(28);
       TM2_Begin_Min = EEPROM.read(30);
       TM2_End_Hour = EEPROM.read(32);
       TM2_End_Min = EEPROM.read(34);
       if(debug){Serial.print(TM2_Begin_Hour);Serial.print("H");Serial.print(TM2_Begin_Min);Serial.print(" -> ");Serial.print(TM2_End_Hour);Serial.print("H");Serial.println(TM2_End_Min);}

  //----------------------------------------------
       TM3_Begin_Hour = EEPROM.read(36);
       TM3_Begin_Min = EEPROM.read(38);
       TM3_End_Hour = EEPROM.read(40);
       TM3_End_Min = EEPROM.read(42);
       if(debug){Serial.print(TM3_Begin_Hour);Serial.print("H");Serial.print(TM3_Begin_Min);Serial.print(" -> ");Serial.print(TM3_End_Hour);Serial.print("H");Serial.println(TM3_End_Min);}

  //----------------------------------------------
       TM4_Begin_Hour = EEPROM.read(44);
       TM4_Begin_Min = EEPROM.read(46);
       TM4_End_Hour = EEPROM.read(48);
       TM4_End_Min = EEPROM.read(50);
       if(debug){Serial.print(TM4_Begin_Hour);Serial.print("H");Serial.print(TM4_Begin_Min);Serial.print(" -> ");Serial.print(TM4_End_Hour);Serial.print("H");Serial.println(TM4_End_Min);}

  //----------------------------------------------
       TM5_Begin_Hour = EEPROM.read(52);
       TM5_Begin_Min = EEPROM.read(54);
       TM5_End_Hour = EEPROM.read(56);
       TM5_End_Min = EEPROM.read(58);
       if(debug){Serial.print(TM5_Begin_Hour);Serial.print("H");Serial.print(TM5_Begin_Min);Serial.print(" -> ");Serial.print(TM5_End_Hour);Serial.print("H");Serial.println(TM5_End_Min);}

       JIT_val=EEPROM.read(60);if(JIT_val>100){EEPROM.write(60,0);EEPROM.commit();}

  Serial.println("running setup");
  for (int i=0; i <= 100; i++){
   jx2.setValue(i);}
   AllTempRefresh();

  sendCommand("vis p0,1");
   page2.show();  

  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  // Print local IP address and start web server
  Serial.println("");
  Serial.println("WiFi connected.");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());
  
  timeClient.begin();
timeClient.setTimeOffset(7200);
  bool status;

  BlynkEdgent.begin();  
  SliderMemo();
  page1.show();  
  dht.begin();
  dht1.begin();
}  

void DateAndTime()
{
  while(!timeClient.update()) {
    timeClient.forceUpdate();
  }
  formattedDate = timeClient.getFormattedDate();
  int splitT = formattedDate.indexOf("T");
  dayStamp = formattedDate.substring(0, splitT);
  timeStamp = formattedDate.substring(splitT+1, formattedDate.length()-1);
  int splitH = timeStamp.indexOf(":");
  Hour = timeStamp.substring(splitH-2, splitH).toInt();
  Min = timeStamp.substring(splitH+1, splitH+3).toInt();
  HourMin = Hour*100 + Min;  // Aktuális idő óra és perc
  Hour1 = timeStamp.substring(splitH-2, splitH)+":"+timeStamp.substring(splitH+1, splitH+3);
}


void program_loop()
{  
 switch (cntr) {
    case 1:  
       Read_Sensor();
       if(!digitalRead(RoomSensor))
        {
          sendCommand("thermo.val=1");
          Blynk.virtualWrite(V115,HIGH);
        }else
          {
            sendCommand("thermo.val=0");
            Blynk.virtualWrite(V115,LOW);
          }
          
        if(digitalRead(Relay3))
        {
          Blynk.virtualWrite(V103,HIGH);sendCommand("tm1.en=1");
        }
        else {Blynk.virtualWrite(V103,LOW);sendCommand("tm1.en=0");}
        
        if(digitalRead(Relay2))
        {
          Blynk.virtualWrite(V104,HIGH);sendCommand("tm0.en=1");
        }
        else {Blynk.virtualWrite(V104,LOW);sendCommand("tm0.en=0");}
    break; 

    case 2:
    if(!manubit){
      if(debug){Serial.println("---- Check bubbling program ----");}  
      TM1_Begin_Hour_min = TM1_Begin_Hour*100+TM1_Begin_Min;
      TM1_End_Hour_min = TM1_End_Hour*100+TM1_End_Min;
      TM2_Begin_Hour_min = TM2_Begin_Hour*100+TM2_Begin_Min;
      TM2_End_Hour_min = TM2_End_Hour*100+TM2_End_Min;
      TM3_Begin_Hour_min = TM3_Begin_Hour*100+TM3_Begin_Min;
      TM3_End_Hour_min = TM3_End_Hour*100+TM3_End_Min;
      TM4_Begin_Hour_min = TM4_Begin_Hour*100+TM4_Begin_Min;
      TM4_End_Hour_min = TM4_End_Hour*100+TM4_End_Min;
      TM5_Begin_Hour_min = TM5_Begin_Hour*100+TM5_Begin_Min;
      TM5_End_Hour_min = TM5_End_Hour*100+TM5_End_Min;
      if(debug){Serial.print(TM1_Begin_Hour_min);Serial.print(" - ");}
      if(debug){Serial.print(HourMin);Serial.print(" - ");Serial.println(TM1_End_Hour_min);}

      if(HourMin>=TM1_Begin_Hour_min && HourMin<TM1_End_Hour_min)
        {
         sendCommand("CB1.val=1");Blynk.virtualWrite(V107,255);Bubble_Control();
         if(debug){Serial.println("---WaterCleaner ON---");}
        }
        else
        {
         if(debug){Serial.print(TM2_Begin_Hour_min);Serial.print(" - ");}
         if(debug){Serial.print(HourMin);Serial.print(" - ");Serial.println(TM2_End_Hour_min);}
         if(HourMin>=TM2_Begin_Hour_min && HourMin<TM2_End_Hour_min)
           {
            sendCommand("CB1.val=1");Blynk.virtualWrite(V107,255);Bubble_Control();  
           }
           else
           {
            if(debug){Serial.print(TM3_Begin_Hour_min);Serial.print(" - ");}
            if(debug){Serial.print(HourMin);Serial.print(" - ");Serial.println(TM3_End_Hour_min);}
            if(HourMin>=TM3_Begin_Hour_min && HourMin<TM3_End_Hour_min)
            {
             Bubble_Control();sendCommand("CB1.val=1");Blynk.virtualWrite(V107,255); 
            }
            else
            {
             if(debug){Serial.print(TM4_Begin_Hour_min);Serial.print(" - ");}
             if(debug){Serial.print(HourMin);Serial.print(" - ");Serial.println(TM4_End_Hour_min);}
             if(HourMin>=TM4_Begin_Hour_min && HourMin<TM4_End_Hour_min)
              {
               Bubble_Control();sendCommand("CB1.val=1");Blynk.virtualWrite(V107,255);
              }
              else
              {
               if(mudbit){digitalWrite(WaterCleaner,LOW);sendCommand("CB1.val=0");Blynk.virtualWrite(V107,LOW);} 
              } 
            }
           }
        }
      if(debug){Serial.print(TM5_Begin_Hour_min);Serial.print(" - ");}
      if(debug){Serial.print(HourMin);Serial.print(" - ");Serial.println(TM5_End_Hour_min);}

     if(HourMin>=TM5_Begin_Hour_min && HourMin<TM5_End_Hour_min && mudbit)
       {
        mudbit=0;
        Bubble_Control();sendCommand("CB1.val=1");Blynk.virtualWrite(V107,255);
        digitalWrite(Relay4,HIGH);sendCommand("CX.val=1");Blynk.virtualWrite(V106,255);
       }
     if(HourMin>=TM5_End_Hour_min && !mudbit)
       {
        mudbit=1;
        digitalWrite(Relay4,LOW);sendCommand("CX.val=0");Blynk.virtualWrite(V106,LOW);
        digitalWrite(WaterCleaner,LOW);sendCommand("CB1.val=0");Blynk.virtualWrite(V107,LOW);
        JIT_val=EEPROM.read(60);JIT_val=JIT_val+1;EEPROM.write(60,JIT_val);EEPROM.commit();
        JIT.setValue(JIT_val);
       }
    }
    break;  
    case 3:  
      DateAndTime();
      dayStamp.toCharArray(puffer, 11);
      t8.setText(puffer);
      cntr=0;
      Hour1.toCharArray(puffer, 11);
      t9.setText(puffer);

      itoa(extTemp, puffer, 10);
      OT.setText(puffer);  

      itoa(intTemp, puffer, 10);
      IT.setText(puffer);  
    break;   
    default:      
    break;
    
  }    
}  
void AutoMode()
{
 unsigned long currentMillis1 = millis();
        
   bool OP6picOld = OP6pic;
   if(Hour>=SliderValue[11] && Hour<=SliderValue[12] +11){OP6pic=1;}else{OP6pic=0;}
   if(OP6picOld!=OP6pic)
     {
      if(OP6pic){sendCommand("OP6.pic=39");Serial.println("Eljött az energia gyűjtés ideje");}else{sendCommand("OP6.pic=40");Serial.println("Energia gyűjtés ciklus vége");}
     }

   bool OP1picOld = OP1pic;
    if(extTemp>SliderValue[0]-20 && TankTemp < SliderValue[1] ) 
      { exchangerbit=0;
        BufferHeating=1;
        OP1pic=1;
      }else{OP1pic=0;}
      
    if(OP1picOld!=OP1pic)
     {
      if(OP1pic){sendCommand("OP1.pic=39");}else{sendCommand("OP1.pic=40");}
     }

   bool OP2picOld = OP2pic;
    if(extTemp>SliderValue[2]-20 && TankTemp < SliderValue[3] && exchangerbit) 
      { exchangerbit=0;
        BufferHeating=1;
        OP2pic=1;
      }else{OP2pic=0;}
    if(OP2picOld!=OP2pic)
     {
      if(OP2pic){sendCommand("OP2.pic=39");}else{sendCommand("OP2.pic=40");}
     }

   bool OP3picOld = OP3pic;
    if(extTemp>SliderValue[4]-20 && TankTemp < SliderValue[5] && exchangerbit) 
      { exchangerbit=0;
        BufferHeating=1;
        OP3pic=1;
      }else{OP3pic=0;}
    if(OP3picOld!=OP3pic)
     {
      if(OP3pic){sendCommand("OP3.pic=39");}else{sendCommand("OP3.pic=40");}
     }

   bool OP4picOld = OP4pic;
    if(extTemp>SliderValue[6]-20 && TankTemp < SliderValue[7] && exchangerbit) 
      { exchangerbit=0;
        BufferHeating=1;
        OP4pic=1;
      }else{OP4pic=0;}
    if(OP4picOld!=OP4pic)
     {
      if(OP4pic){sendCommand("OP4.pic=39");}else{sendCommand("OP4.pic=40");}
     }

   bool OP5picOld = OP5pic;
    if(extTemp>SliderValue[8]-20 && TankTemp < SliderValue[9] && exchangerbit) 
      { exchangerbit=0;
        BufferHeating=1;
        OP5pic=1;
      }else{OP5pic=0;}
    if(OP5picOld!=OP5pic)
     {
      if(OP5pic){sendCommand("OP5.pic=39");}else{sendCommand("OP5.pic=40");}
     }

 if(BufferHeating>0&&OP6pic>0)
      {TimeToEnergyCollection=1;}else{TimeToEnergyCollection=0;}

 if (Hour>=SliderValue[10] && !BufferUseable && TankTemp>TankTempMin && dayStampMemo!=dayStamp)
     {
       BufferUseable=HIGH; //Ez jelzi,hogy van a pufferben meleg és itt az idő felhasználni
       dayStampMemo=dayStamp;
     }

 if(!digitalRead(RoomSensor))
    {
     if(TankTemp>TankTempMin){digitalWrite(Relay2,HIGH);heaterbit=0;}
    }else{digitalWrite(Relay2,LOW);heaterbit=0;}

 if(TankTemp<TankTempMin){BufferUseable=0;}
 if(!BufferUseable||TimeToEnergyCollection){digitalWrite(Relay3,HIGH);}
 if(!TimeToEnergyCollection&&digitalRead(RoomSensor)){digitalWrite(Relay3,LOW);}

 if (currentMillis1 - previousMillis3 >= HeaterPumpHyst)
    {
       previousMillis3 = currentMillis1;
       heaterbit=1;
       if(debug){Serial.print("TimeToEnergyCollection=");Serial.println(TimeToEnergyCollection);}
       exchangerbit=1;BufferHeating=0; 
    }
}   
void loop()
{
  unsigned long currentMillis = millis();
  BlynkEdgent.run();
  nexLoop(nex_listen_list);  
  if(AutoManual){AutoMode();}
  // This is a sample code to output free heap every 5 seconds
  // This is a cheap way to detect memory leaks
    static unsigned long last = millis();
    if (millis() - last > 1000) {
        last = millis();
        if(debug){Serial.printf("[MAIN] Free heap: %d bytes\n", ESP.getFreeHeap());
         Serial.println(cntr);}
        program_loop();cntr++;    
    }

  if (currentMillis - previousMillis2 >= 30000)
   {
    previousMillis2 = currentMillis;
    BubbleCtrl++;
   }
  if (currentMillis - previousMillis >= 1000)
   {
    previousMillis = currentMillis;
    Toggle=!Toggle;
    if(Toggle){sendCommand("vis p0,1");Blynk.virtualWrite(V100,255);}else{sendCommand("vis p0,0");Blynk.virtualWrite(V100,LOW);} //WiFi LED
   }
}

You should use BlynkTimer instead of doing all this millis comparison in your void loop.

Pete.