Need help: receiving a messagem by Bluetooth, starting a countdown and sending a notification/alarm when the countdown ends

I'm building my own water temperature controller for sous vide after seeing the insane prices being charged for them. The project currently works as follows:

  • Turn on ESP32 by powering it up, it enters standby
  • Open the app made with MIT AI2, connect Bluetooth, select temperature and time
  • Send a message to the ESP32 with temperature and time
  • ESP32 activates the electronic part (optocoupler and TRIAC, simple stuff), turning on the resistance
  • ESP32 monitors the water temperature through sensors and turns the resistance on and off as needed to heat the water to the chosen temperature

Right now I'm manually monitoring the water temperature through serial, adding the vacuum sealed food and using my phone's timer to notify me when it's done. I want to pass all this to the app, so it would additionally work like that:

  • Bluetooth connection keeps active (it seems to disconnect after some time)
  • App notifies me if the BT connection is lost
  • ESP32 monitors the water temperature and sends a BT message to the app when the chosen temperature is reached
  • App starts a countdown using the given time, displaying the time remaining in the app
  • App sends a notification/alarm to the phone when the time is up

I've been reading about all of this for the last few days, but a lot is going over my head right now and some links that seems to be useful are dead.

The MIT AI2 project that I've been working on is:
Sous_Vide.aia (5.1 KB)
(I just deleted some stuff that wasn't working, hope I didn't break anything that was.)

And the ESP32 code is:
FInalV01.ino (4.8 KB)

Any help, tutorial, link or tip is highly appreciated.

Dear @FelipeLapena,
tbh I didn't check your codes (AI2 and Arduino) so I cannot tell you whether they are fine or not, but you can check the following old post of mine:

In the linked example you can find how to connect an ESP32 via classic BT and BLE to an app by using the itoo extension (credits to @Kumarawsami :hugs:) that runs in background.
My first hint is anyway to have a basic app (and Arduino code) that implements the BT communication without troubles, and only after that part is working you can add the section relevant to the temperature control, or other activities you might need.
Lastly, to be sure that at least your Arduino (ESP32) part is working fine, I suggest you to use the Serial Bluetooth Terminal (SBT) ready made app, free from the playstore, so to remove the 50% of uncertainty (your app) from where the problems could arise. After the SBT works fine with your ESP, you can start to develop your own app.

I hope it helps