Someone please explain the use of templates / devices in the new blynk

Hi!

I’m experimenting with the new Blynk, and I see first I must create templates, then create the devices which must belong to one of the above templates. So far so good. For my use case scenario, I thought it would make sense to create a template for each MCU type I use, like ESP8266, ESP32 etc.

In my projects I always use the same virtual pins for all devices to get some basic data, like:

// VIRTUAL PINS - ADMIN
#define V_UPTIME            V113  // uptime in hours
#define V_VCC               V115  // vcc in volts
#define V_RAM               V116  // free ram (heap)
#define V_DBM               V117  // wifi signal strength
#define V_SET_TYPE          V118  // set device type
#define V_SEND_RTC          V119  // sends device rtc value
#define V_RESTART_CAUSE     V120  // sends device last restart cause (fw update, watchdog, brownout, manual reset, etc)
#define V_RESTART           V121  // restart button
#define V_MAC               V122  // device mac address
#define V_TERMINAL          V123
#define V_UPDATE_NAME       V124  // updates device name
#define V_UPDATE_TOKEN      V125  // updates device token in eeprom
#define V_GET_UPDATE        V126  // OTA firmware update
#define V_MESSAGE           V127  // last message from device

so, it seemed useful to create all these datastreams for the template, because this is common with all devices. But when I add a new device, I would like to also create dedicated datastreams for each individual device. How can I do this? Or, if it is not possible to do, what is the “normal” way to do it, for example 10 individual esp8266 sonoff devices which run very different tasks? I have to create new template for each device separately?

Thanks!

The first thing you need to know about templates is that when create a web dashboard (which you do in the template view) then every device based on that template.
When you create a device from the template and create a mobile dashboard, then this dashboard layout is the same for each device too.
It’s just the data that you see for each device that varies, the dashboard layout is identical.

So, if you have one device to open your garage door and another to control your heating, then you’ll need different templates, because you’ll need different dashboards.

You dont need to use all of your datastreams so you could have extra ones that do different things for different devices, but if you want different dashboards then you’ll need different templates anyway. If you’re not careful, you’ll run out of templates.

This is made worse because you can’t easily bridge data from one device to another, and use a single dashboard with tabs to do everything you want.
Node-Red makes the bridging easy though, so personally I have one main template /device with tabs that does virtually everything.

Also, when you design your web dashboard in the template view it will show made-up data, and this will almost certainly confuse you, so take care to swap over to device view to see your real data.

Pete.

1 Like