Please help in adapting Blynk legacy code to Blynk IOT

If you wnat to keep the same functionality (Arduino OTA as opposed to Blynk.Air) then you don’t need to change much.

Create a template and virtual datastreams in the Blynk IoT web console. When you create the datastreams that are being used for LEDs then set the m8n/max values to 0-255 (or use 0-1 and change your sketch where it writes 255 to the LED widget.

I don’t think you should be including this line anyway…

Once you’ve done that then you create a device from your template and that will give you three lines of code that MUST be pasted at tge very top of your sketch.

Bl6nk notify…

Isn’t used anymore. Instead you need to create an event in your template screen and add a notification to that, then use Blynk.logEvent
Your existing sketch looks messy in this respect, sending multiple notifications for the same fire event, although it’s difficult to tell as you haven’t used meaningful variable names or added in-code comments to explain the logic, and I can’t be bothered to unpick it.

Either way, you should read this…

Once you’ve done that then you’ll need to install the latest Blynk library and re-compile your code.
You’ll need to create a new mobile dashboard, and also create a web dashboard if you want to use that functionality too.

More info on all of this in the documentation…

Pete.