A template represents a device prototype to be used to create new devices with the same structure.
Creating a template
To create a device template in Databoom you need to create a new device, selecting the Template Device type.
Once the type is set, a form will show to fill all the template fields, type of device (HTTP o MQTT) is required. In case of MQTT template additional information regarding projects and topics are also needed.
It is also possible to generate a template from an existing device.
Adding signal templates
In the edit form it's possible to add a list of signals (description, signal type and token). When a device is created from the template, signals are also created on the model of the template.
When edits are saved, it is possible to access template signals edit pages by clicking their tags. Signal templates tags also contain copy button, to store signal token without having to visit signal detail page. A search field is available to filter signals template.
While adding a signal template is possible to specify whether to create a virtual signal. In the edit page it will then be possible to specify the signal formula. In the formula of a virtual signal template you can only use real signals as variables or signals of the same device template.
Adding rule templates
In the edit form it's possible to add a list of rules. When a device is created from the template, rules are also created.
Once edits are saved, it is possible to access template rules edit pages by clicking their tags. A search field is available to filter rules template. In the formula of a rule template you can only use real signals as variables or signals of the same device template.
Adding dashboard and report templates
If a dashboard template was generated from a dashboard containing signals generated from templates, it's possible to specify it in device template settings. In this case, when a new device is created from template, a dashboard is automatically created on the model of the template.
In the same way it is possible to add also a report template.
Creating a device from template
Depending on the type of device selected as template, it's possible to start communicating with the consequent devices creation on the set model.
Edits on a template are inherited by all the generated devices if the following communications use the template to transmit. If, for example, signals are added to a template and the communication with a generated device happens through the template itself, the device will update with the new signals. On the contrary, if a signal is added to a generated device, the edit doesn't reflect on its template.
It is possible to update a device generated by template also from its detail page, by clicking the button Update from template. Only "macroscopic" edits are inherited from template, as additional signals, rules, dashboards or reports. To update signals and rules with edits to their template details, it is possible to click the Update from template button in their detail page.
A device generated by template will have a tag with the description of the template that can be used to filter when searching in the device list.
To better understand the use and utility of templates it's highly recommended the further reading of the documentation about the type of generable devices:
For a full step-by-step guide about templating, read also