Configure the Modbus Thing template with metric types that you want to collect, and add custom commands to send to your Modbus Thing device.
Prerequisites
Ensure that you have:
- Created a Liota gateway template on VMware Pulse IoT Center.
- Enrolled a gateway using the Liota gateway template.
Procedure
- From the VMware Pulse IoT Center UI, go to Inventory > Device Templates.
- In the Inventory > Device Templates page, click CREATE.
The Create Device Template wizard is displayed.
- In the Details step, enter the following information:
- Under Template Name, enter the name of your Thing template.
- In the Select Device Type drop-down menu, select Thing.
- Click NEXT.
- In the Properties step, click NEXT.
- In the Metrics step, click +Add to add a metric and enter the following information. In this example, we configure the metrics for a Modbus humidity sensor device:
Note: Ensure that the metric name and value type that you enter in the Modbus device package matches with the information that you enter here.
- Under Display Name, enter the display name of the metric to collect. For example, Humidity.
- In the Value Type drop-down menu, select the metric value type. For example, Double.
- Under Unit, enter the unit of the collected metric. For example, Water vapor.
- Click NEXT.
- In the Connected Device Templates step, click NEXT.
- In the Commands step, click +Add to add a command. In this example, we add a command to set the humidity on your humidity sensor device. Enter the following information:
- Under the Type drop-down menu, select Client Command.
- Under Name, enter a name for your command. For example, set-humidity.
- Under Client Identifier, enter the client domain. For example, com.liota.modbus.
- Under Arguments, enter the following information:
- name - Name of the argument. For example, Humidity.
- addr - The unique entity, address, and type values. For example, {"entity": "HoldingRegister", "address": 1, "type": "float32"}.
- value - Enter the humidity value to be updated on the device.
- Click DONE.
Results
You have successfully created a Modbus Thing template to collect humidity metrics and have added a custom command to configure the humidity level.
What to do next
Add this Thing Template to the Liota gateway template that you have created.