Separate Library

New Blynk version. Is it possible to put the Device_name and template _id in a separate library so as stationcredentials.h

They need to be the first things that the compiler sees in the main .ino file, otherwise the compiler will think that it is a Legacy sketch and compile the code with the Legacy server url rather than the IoT server url.

So, the short answer is “No”.

You could force the sketch to connect to the correct server, or amend the Blynk library so that it always connects to the correct server, but I would recommend it. You may also run into difficulties if you try to use Blynk.Air if you take that approach.

Pete.

I tried this before and it worked. So in my opinion, it’s possible but not necessary.

I put the Device_name and Template_id data in the .ino file.
Thanks Pete.