[SOLVED] Arduino mega often disconnect local blynk server

I think you send too much data. I see you call all your functions in the loop() part. This is not the most efficient way to do things. I can imagine Blynk is not happy about that.

Have you tried removing the functions and instead calling them with a timer? I’ve made something similar over here: Home Domotics except it’s for lights instead of alarms, but I think the same principles apply. All you want in your main loop is:

void loop()
{
  Blynk.run();
  timer.run(); // For simple timer or other library you want
}

This should basically be your loop().