IoT solutions begin with a few devices but after the prototyping stage and you are required to deploy 500+ devices. Using the template feature in Ubidots, you can deploy dashboard templates and assign devices to specific dashboards for rapid setup.
To better describe the function of Ubidots Templates, we will simulate tracking a truck's speed, fuel consumption, and location. After a great proof of concept the fleet manager now wants to rollout 100's of devices. This article is your the step-by-step instructions to creating templates in Ubidots.
The logic for any template dashboard consists of a parent dashboard that is copied and added to a list of potential templates. Then when a new device is added, a new dashboard with previously built widgets can be applied to this new device for rapid deployment.
To begin, log into your Ubidots for Business account, select the appropriate dashboard to be working in, and click the "plus" icon in the top right to create a new widget.
Our dashboard is called "Truck 1" and comprises of three widgets:
- A metric that reads the fuel consumed
- A GPS Trace to know the route the truck has followed
- A metric with the average speed the truck across a route
Next, click the file icon located in the dashboard's menu.
You will be prompt to confirm a new template.
Next, select the regularity parameters of your template.
1.- Any new device is created: every time you create a new device, there will be a new dashboard created for it with the mirrored parameters of the template.
This option is great when all the devices in your solution share the same characteristics and have the same function.
2.- A device with this prefix in the label is created: remember that once you create a new device, it will be assigned an API label, which works as the identifier for Ubidots' platform. With this option you can assign a specific prefix to any device (e.g. truck) telling Ubidots to create a new templated dashboard associated with the device prefix "truck" in the API label.
In this case, since we can use the prefix "truck" for each new truck connected, a new dashboard will autogenerate at each iteration of the prefix "truck."
3.- Never, I'll use this template manually to create more dashboards later: with this option, you "save" the template for later. Ubidots won't create any new dashboard automatically with it, but it has been stored for later development.
Once you're ready to deploy a template, please know that any new template is assigned only a single device, i.e. each widget used in the template will be assigned to this device's variables.
Pro Tip: if your device doesn't have a variable whose API label is "position" - which tells Ubidots the device to track the device's location - the maps widgets cannot be created.
Following the template design and parameters setup, Ubidots will prompt you to "Check your template." Here you can derive if the device's variable will suit the template.
"To be able to replicate a dashboard’s Widgets, the variables of the selected device must have the exact same API labels of the Variables of the original Device."
The reasoning behind this is that Ubidots needs to know X variable should match with X device.
Note: Upon clicking "Finish" or "Duplicate Dashboard," the new template becomes available in the dashboard dropdown under the subheading "Templates."
Creating Dashboard Templates
You can access your new templates the same way you access dashboards. Go to Device Management -> Dashboards and click the window icon beside your dashboard custom name. The Templates section is located below your dashboards list.
To create a new template, select the template you wish to deploy which will prompt the follow popup:
Next, select "Continue" and then select the "right triangle" icon to deploy a new mirrored dashboard to your predetermined template parameters.
Next, choose the new dashboard's name, select the appropriate device and check the widgets for applicable capabilities.
After verifying your variables you can deploy countless dashboards to scale your IoT solution.