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.
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.
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. In the formula of a rule template you can only use real signals as variables or signals of the same device template.
Adding a dashboard template
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.
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.
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