Updated on 2023-09-21 GMT+08:00

Creating a Product

Overview

A product is a device model, which is a set of service attributes of devices of the same type. Each device belongs to a product and inherits all service attributes of the product.

Product information includes basic information and thing model. It describes what a product is, what functions the product can provide, and what services the product can provide for external systems.

  • Basic information

    Describes basic information about a device, including the manufacturer name, manufacturer ID, product type, product model, protocol type, and device type. The product model and manufacturer ID are used together to identify a product.

    For example, the product model of a water meter is NBIoTDevice, the manufacturer name is HZYB, the manufacturer ID is TestUtf8ManuId, and the device type is WaterMeter.

  • Thing model

    Service capabilities of a device need to be defined. After the capabilities of a device are divided into multiple thing model services, define the attributes, commands, and command parameters of each thing model service.

    Take a water meter as an example. It has multiple capabilities, such as reporting data about the water flow, alarms, power, and connections, and receiving various commands delivered by a server. When describing the capabilities of a water meter, you can divide the capabilities into five thing model services, and define the attributes reported by each thing model service and their supported commands, as listed in the following table.

    Table 1 Service description

    Thing Model Service

    Description

    WaterMeterBasic

    Used to define parameters reported by the water meter, such as the water flow, temperature, and pressure. If these parameters need to be controlled or modified using commands, you also need to define parameters in the commands.

    WaterMeterAlarm

    Used to define data reported by the water meter in various alarm scenarios. Commands need to be defined if necessary.

    Battery

    Used to define data including the voltage and current intensity of the water meter.

    DeliverySchedule

    Used to define transmission rules for the water meter. Commands need to be defined if necessary.

    Connectivity

    Used to define connection parameters for the water meter.

    The number of thing model services defined depends on the requirements. In the preceding example, the alarm thing model service can be split into the water pressure alarm service and traffic alarm service, or the alarm service can be integrated into the basic water meter service.

Prerequisites

Creating a Product

  1. Log in to the ROMA Connect console. On the Instances page, click View Console next to a specific instance.
  2. In the navigation pane on the left, choose LINK > Product Management. On the page displayed, click Create Product in the upper right corner.
  3. In the Create Product dialog box, set product parameters and click OK.
    Table 2 Parameters for creating a product

    Parameter

    Description

    Product Type

    Select a product type.

    • Common: a directly connected device or a gateway subdevice.
    • Gateway: a gateway device, which can be associated with subdevices and manage them.

    Protocol Type

    Select the protocol type used by the product.

    • MQTT: a publish-subscribe network protocol that transports messages between devices.
    • Modbus: a serial communication protocol.
    • OPC UA: an Ethernet-based communication protocol.

    Product Name

    Enter a product name. It is recommended that you enter a name based on naming rules to facilitate search.

    Product Template

    After a product template is selected, the created product has all services and attributes of the product template.

    Only product templates in the Enabled state can be selected.

    Integration Application

    Select the integration application to which the product belongs.

    Manufacturer Name

    Enter the manufacturer name of the device in use.

    Manufacturer ID

    Enter the manufacturer ID of the device in use.

    Product Model

    Enter the product model of the device in use.

    The product model and manufacturer ID collectively identify a product. The combination of product model and manufacturer ID must be unique.

    Device Type

    Select the type of the device to be connected. You can select Default Type or add a device type that is added in DEVICE_TYPE on the Data Dictionaries tab page of the Instance Information page. For details, see Creating a Data Dictionary.

    Model Version

    Enter a custom model version of the device.

    Description

    Enter a brief description of the product.

(Optional) Adding a Thing Model Service for a Product

  1. On the ROMA Connect console, choose LINK > Product Management and click a product name to access the product details page.
  2. Add thing model services for the product.
    1. On the Thing Model tab page, click Create.
    2. In the Create Thing Model Service dialog box, set thing model service parameters and click OK.
      Table 3 Parameters for creating a thing model service

      Parameter

      Description

      Name

      Enter a thing model service name. It is recommended that you enter a name based on naming rules to facilitate search.

      Status

      This parameter specifies whether to enable the thing model service. The thing model service is enabled by default.

      Description

      Enter a brief description of the thing model service.

  3. Add attributes for the thing model service.
    1. On the Thing Model tab page, select the thing model service for which you want to add attributes.
    2. On the Attributes tab page, click Create.
    3. In the Create Attribute dialog box, set attribute parameters and click OK.
      Table 4 Parameters for creating an attribute

      Parameter

      Description

      Name

      Enter an attribute name. It is recommended that you enter a name based on naming rules to facilitate search.

      Data Type

      Select the data type of the attribute.

      • Int: integer. If you select Int, you also need to specify Min. Value, Max. Value, Step, and Unit.
      • Number: number. If you select Number, you also need to specify Min. Value, Max. Value, Step, and Unit.
      • String: a character string. If you select String, you also need to specify the maximum data length and enumerated values.
      • Bool: Boolean. If you select Bool, you also need to specify 0 and 1.
      • DateTime: date. If you select DateTime, you also need to specify the maximum data length.
      • JsonObject: JSON object. If you select JsonObject, you also need to specify the maximum data length.
      • Array: array.

      The following uses the Int type as an example:

      When defining the temperature attribute for thermometers, set Type to Int, Min. Value to 0, Max. Value to 100, Step to 2, and Unit to °C. This indicates that the device reports the temperature value (for example, 0°C, 2°C, 4°C, 6°C and 8°C) each time the temperature changes by two degrees.

      Mandatory

      This parameter specifies whether the attribute must be reported by a device. This parameter is enabled by default.

      Description

      Enter a brief description of the attribute.

      Min. Value

      NOTE:

      The configuration items are displayed based on the selected data type. The Int type is used as an example.

      Minimum value of the thing model service attribute.

      Max. Value

      NOTE:

      The configuration items are displayed based on the selected data type. The Int type is used as an example.

      Maximum value of the thing model service attribute.

      Step

      NOTE:

      The configuration items are displayed based on the selected data type. The Int type is used as an example.

      Step of the attribute.

      Unit

      NOTE:

      The configuration items are displayed based on the selected data type. The Int type is used as an example.

      Enter the unit of the attribute. The value cannot exceed 50 characters. For example, the unit of the temperature attribute can be °C.

  4. Add commands for the thing model service.
    1. On the Thing Model tab page, select the thing model service for which you want to add commands.
    2. On the Commands tab page, click Create.
    3. In the Create Command dialog box, set command parameters and click OK.
      Table 5 Parameters for creating a command

      Parameter

      Description

      Command Name

      Enter a command name. It is recommended that you enter a name based on naming rules to facilitate search.

      Description

      Enter a brief description of the command.

    4. Locate the created command in the command list and click next to the command name to expand the command field list.

      Click Delivery Command Fields or Response Command Fields on the right to view the delivery command fields and response command fields of the command.

    5. Click Create Field.
    6. In the Create Delivery Command Field or Create Response Command Field dialog box, set field parameters and click OK.
      Table 6 Parameters for creating a field

      Parameter

      Description

      Field Name

      Enter a field name. It is recommended that you enter a name based on naming rules to facilitate search.

      Data Type

      Select the data type of the command field.

      • Int: integer. If you select Int, you also need to specify Min. Value, Max. Value, Step, and Unit.
      • Number: number. If you select Number, you also need to specify Min. Value, Max. Value, Step, and Unit.
      • String: a character string. If you select String, you also need to specify the maximum data length and enumerated values.
      • Bool: Boolean. If you select Bool, you also need to specify 0 and 1.
      • DateTime: date. If you select DateTime, you also need to specify the maximum data length.
      • JsonObject: JSON object. If you select JsonObject, you also need to specify the maximum data length.
      • Array: array.

      Mandatory

      This parameter specifies whether the field must be carried in the delivery command. By default, the field must be carried.

      Description

      Enter a brief description of the command field.

      Min. Value

      NOTE:

      The configuration items are displayed based on the selected data type. The Int type is used as an example.

      Minimum value of the delivery command field.

      Max. Value

      NOTE:

      The configuration items are displayed based on the selected data type. The Int type is used as an example.

      Maximum value of the delivery command field.

      Step

      NOTE:

      The configuration items are displayed based on the selected data type. The Int type is used as an example.

      Step of the delivery command field.

      Unit

      NOTE:

      The configuration items are displayed based on the selected data type. The Int type is used as an example.

      Enter the unit of the delivery command field. The value cannot exceed 50 characters. For example, the unit of the voltage field can be V.

(Optional) Adding a Customized Topic for a Product

If the basic topics of a device cannot meet your requirements, you can customize a topic for the device. After the customized topic is added to a product, the topic is inherited by all devices under the product.

  1. On the ROMA Connect console, choose LINK > Product Management and click a product name to access the product details page.
  2. On the Topic Classes tab page, click Create Topic.
  3. In the dialog box displayed, configure topic information and click OK.
    Table 7 Parameters for creating a topic

    Parameter

    Description

    Operation Permission

    Select the topic permission granted for the device.

    • Publishing: The device has the permission to publish messages into the topic.
    • Subscription: The device has the permission to subscribe to the topic and obtain messages from the topic.

    Topic Class Name

    Enter the custom field in the name of the custom topic. The version number, device ID, and customized fields form a custom topic name: /{Version number}/{Device ID}/{Custom field}.

    Version Number

    Enter the version number of the topic, for example, V1.0.

    Description

    Enter the brief description of the custom topic.