Using Bridge, Tags, and Device Tiles After Dynamic Provisioning

I’m evaluating deploying an application using Blynk. Users will be able to buy one or more identical devices. Each device will need provisioning, and each should ideally be added to a device tile automatically.

Users should be able to control each device individually by clicking on a tile and going to the device’s page. However, I also want to have one button widget in the layout below the device tiles that can switch all devices on or off. This is so that users don’t have to click on each tile to switch all devices on or off in an emergency.

After reading the documentation, forums, and several examples; I don’t see how to code Bridge or Tags using dynamically provisioned devices. I also can’t verify how dynamically provisioned devices can be dynamically added to device tiles.

This humbly leads me the following two requests:

  1. Could someone post a code example on how to code with Bridge to control multiple devices when the auth codes aren’t known ahead of time? Or, can someone post the process for using Tags to control multiple dynamically provisioned devices?

  2. Could someone also please comment on whether dynamically provisioned devices will be automatically added to device tiles?

The documentation and forum articles that I’ve found stop short of showing how to do #1, and whether #2 will occur after dynamic provisioning. If this exists and I just haven’t found it, I apologize for posting this.

Thank you tremendously for your help – I’m very excited to hear the answers!

Hi, thanks for the questions.

  1. We will be significantly reworking Tags for exported apps. Now it’s not working properly. This work is planned for next 2 months
  2. As a part of Tags work, we will be also adding Grouping in Tiles.

Bridge is not supported in commercial version of Blynk. It’s only a demo for now. You can think of certain hacks and workarounds. For example by using Static Provisioning.
4.

  • Yes, of course. That’s the main goal of Tiles.
1 Like

Thank you, @pavel – I appreciate your reply. I’m curious if the device tiles are accessible in the code via a class in the Blynk library? If so, I’m thinking that there must be a way to cycle through the tiles and write a command to each device. That would help for cases when I want to give a command to an unknown number of devices. If so, what is the name of the class?

Write a command from where?

@micprice It’s usually not a good idea to implement it this way.
When working on a specific project, we can develop such interactions as part of custom development.
Alternatively, you can use Node.RED or similar software to automate your devices.

Thanks @vshymanskyy – I’ll look into Node RED to implement this. I figured since there was a Bridge class (allowing us to programmatically connect to another device), I wanted to check if there was a DeviceTiles class that would allow us to access its child devices and perform a digitalWrite on each to complete an action.

I did some more reading, and this sounds like it’ll be best solved with the upcoming tag groupings feature or a customization. If I can allow my user to select a tagged group of devices and then take an action on that group (such as shutting them all off), that would be fantastic.

I may consider building a workaround, but think I may be overengineering this. Anyway, this is just a note to thank you for a really awesome product. Without it, I would’ve spent days just getting started. Even weeks. I have a prototype app very quickly, and for that I’m grateful.

@Pavel

Oct '18

  1. We will be significantly reworking Tags for exported apps. Now it’s not working properly. This work is planned for next 2 months
  2. As a part of Tags work, we will be also adding Grouping in Tiles.

Have there been any new features / fixes released in this area (Tags, Device Tiles and Dynamic Auth Token Provisioning)?

Joe

@Pavel

Can you give us a little more detail in terms of what will be supported in the way of Tags, Device Tiles and Dynamic Auth Token Provisioning? How does “Grouping” relate to Tags with respect to Device Tiles? Will Tags be assigned through, say Settings.h in much the same way a template is assigned using BOARD_TEMPLATE_ID?

Joe

Device tiles groups will be templated in the same manner as tiles, and user’s will have access to manually select already provisioned devices (by some filtering, if needed) to be used in a group.

Thank you, @BlynkAndroidDev.

In the case of Device Tiles, a template is statically associated with devices. You can assign a template to a statically provisioned device via the app and to a dynamically provisioned device using BOARD_TEMPLATE_ID in Settings.h. The template specifies the Device Tile Action Type (Default, Button or Level), corresponding Input and Label / formatting.

In the case of Device Tiles Groups, are you suggesting a template will be associated with a group, rather than with devices? Groups will be statically defined? You will dynamically add a device to a Device Tiles Group and the group template will override the Device Tiles template? The Device Tile will be displayed with an Action Type / Input / Label / formatting as specified by the group template? For example, as part of “Group A”, the Device Tile corresponding to a particular device may display temperature and as part of “Group B”, the same device may display humidity?

Can a Device Tiles Group be used to apply an action (e.g., Text Input, Numeric Input, Button, Slider, Step, …) across all the devices in the group? Or does the group simply govern which (and how) Device Tiles are displayed?

It’s my understanding Tags is the mechanism used to apply an action to a “collection” of devices. Will Tags be supported in conjunction with dynamically provisioned devices?

Joe

Groups will not be ‘statically associated with devices’. There are templates for tiles and there will be also new templates for groups (with support for some widgets inside a group, whose actions will be applied to all group devices). Groups will be created by the user on the base of their group templates (different group UI, like in tiles with page/button/dimmer), and the user will select the devices to be used in the group.