Previous Topic

Next Topic

Book Contents

Book Index

Templates

Templates List

All available Templates, successfully created after:

     •   its bundle or file is installed/loaded
     •   a REST or JSON-RPC request
     •   a Web Console action:
          •   using the Add button mbs_au_adding_v92 under the Actions column
          •   using the Copy button mbs_au_rule_copy_v92 to create a similar template, which can be easily updated
          •   using the Create Template button mbs_au_templ_rule_v92 from the Rules tab

can be viewed in a sortable table under the second main tab:

mbs_au_templ_lisst_v92

A Template can be added, updated, copied, used for creating a rule, or removed via the corresponding buttons from the Actions column, as described further.

Some templates, provided to the system not via the Web Console, but by a file or a bundle, are updated or removed when the providing file/bundle is updated or uninstalled.

It is also described how to create a Rule from a template with the respective button mbs_au_templ_rule_v92.

Template Details

To see the template details use the Details buttonautomation_details_icon, or simply select the template UID from the first column of the table.

mbs_au_details_v92.png

This page is not editable. It contains general information and details about the Variables, Triggers and Flow if available. If a Handler is used, a click on its UID provides more details, including its Inputs/Outputs.

Creating a Template

To create a template via the Web Console:

Adding a New Template

Clicking on the mbs_au_add_v92 button right under the Actions column opens up a page to fill in the General information fields, like UID, Name, Description, Tags and adding Variables, Triggers and Flow by mbs_au_adding_v92 buttons. A convenient way for choosing among available types, Triggers and Flow is provided from a drop-down menu:

mbs_au_add_page_v10

Adding Variables

The Add variable dialog box appears after a click on the add button mbs_au_adding_v92:

mbs_au_add_var_v10

It allows choosing from the possible types of GENERIC, NUMERIC, ENUM, BEAN and ANY from a drop-down menu:

mbs_au_add_var2_v92

If a single variable is added successfully, it can be updated and removed, using the corresponding buttons – mbs_au_rem_edit_buttons_v92. When there are more than one variables, two more buttons appear under the Actions column to allow moving a variable up and down conveniently in the table:

mbs_au_move_v92.

Adding Triggers

Before adding a trigger choose its type from the drop-down menu:

mbs_au_trigger_types_v92

After the add button mbs_au_adding_v92 is clicked a table appears. It corresponds to the type of the trigger – with empty spaces or with available or proposed value and drop-down menus for choosing from existing options:

mbs_au_add_temp_v92

The fields marked with asterisk - *, are mandatory to successfully run a rule created by a template.

Adding a Flow

To add a flow first choose one of the available Action or Condition handlers from the drop-down menu and then click on the add button mbs_au_adding_v92.

mbs_au_choosehandler_flow

To avoid entry mistakes when providing the data, corresponding to the selected handler in the right format, there are Drop-down menus. They provide options according the type, displayed in the metadata tooltip:

mbs_au_add_flow_v10

If more than one Action or Condition handlers are used, move up and down buttons appear for ordering the Flow table in a preferred way. After all data is filled in, a click on the Add button saves the whole template.

mbs_au_add_all_v10

The fields marked with asterisk - *, are mandatory to successfully run a rule created by a template.

Copying a Template

The Web Console facilitates the process of creating new templates via the copying action:

mbs_au_onofftemplcopy_v92

It provides the whole information of the original template with an empty UID field for the new one.

In case the UID field is left empty, the Web Console provides a system UID.

mbs_au_cpying_templ_v10

If the user added UID is already in the system, an error message appears prompting for unique UID.

Updating a Template

The templates, which are added through the Web Console as described above, may further be updated.

At present the Web Console does not allow update and removal of templates, which are added to the system by files or bundles. The are updated or removed only if the files/bundles are updated or uninstalled.

For those templates there are no update or remove buttons:

mbs_au_system_templ_v92

To update a template, added by the Web Console, just click on the Update button automation_edit_icon. Updating a template is similar to the adding a template action, except that the template UID cannot be changed.

mbs_au_update_v10

Clicking on the Update button saves the operation.

When a Template is updated by copying the template, both templates exist in the list.

mbs_au_updated_v92

Creating a Rule from a Template

The Web Console allows you to create a rule by template via the Create rule button.

The example below uses the template created as described in "Using a Rule to Create a Template" section from Rules guide.

mbs_au_rtf_create

Pressing the Create rule button mbs_au_templ_rule_v92 opens Create rule from <name_of_template> box where you can provide UID of the rule and values for the defined template's variables.

mbs_au_rft_v10.2

The metadata information for each variable is provided in the tooltip, where available:

mbs_au_rft2_v10.2

After pressing the ADD button a new Turn Off Heating rule will be created from the template.turn.off.heating. For its JSON representation refer to "Turn Off Heating Rule Example" section from Rule JSON Examples.

Removing a Template

To remove a Template simply click the Remove button automation_delete_icon, situated in the Actions column of the Templates list.

mbs_au_remove_v92

If the Template is removed successfully, it disappears from the main table.