Creating a Model¶
A model is an abstraction of the product’s features, and defines what the product is, what it can do, and what services it can provide. This section shows how to create a model and define custom features for the model.
Prerequisite¶
Ensure that the features that are required for the model have been designed, and that the features are not in the standard feature library. For information about how to design features for a model, see Device Modeling.
Ensure that you have the permissions to create models. If you do not have the access, contact your OU administrator. For more information about user access in EnOS, see Policies, Roles, and Permissions.
Ensure that you have read the limitations for models. See Limitations.
About This Task¶
This task enables you to create a model and configure the following features in EnOS.
Attributes
Measurement points
Service
Event
Step 1: Creating a Model¶
In EnOS Management Console, select Models to open the Model page.
Click the New Model button and fill in the fields in the GUI, among which:
Identifier: The unique model identifier.
Model Name: The model name.
Category: Static extension info of the product, such as manufacturer and device model.
Create From: See Model Relationship.
Validate Model: Incoming device data will be compared with the feature definitions defined in the model. When enabled, if a reported measurement point, for example, is not defined in the model, an error will be reported. Note that disabling this will change the data storage path and access APIs in the time series database (TSDB), which can result in the loss of data from the original path. Subsequently, data archiving and subscription also needs to be reconfigured.
Description: The description of the model.
Clone Tags from Parent Model?: Yes or No.
Click OK.
Step 2: Defining Custom Model Features¶
From the list of created models, find the model that needs feature definition and click the Edit icon .
Click the Feature Definition tab and click Edit followed by Add > Create Custom Feature to set one or more features according to the product attributes.
Create Custom Feature¶
Select Create Custom Feature to add custom feature definitions accordingly.
Adding Attributes¶
On the Add Feature page, select Attributes from the Feature Type dropdown list and fill in the fields in the GUI, among which:
Name: The attribute name.
Identifier: The unique attribute identifier.
Data Type: The attribute data type. For more information, see Data Types.
Description: The description of the attribute.
Click OK to finish creating the attribute.
Adding Measurement Points ¶
On the Add Feature pop-up window, select Measurement Points from the Feature Type drop-down list and fill in the fields in the GUI, among which:
Name: The measurement point name.
Identifier: The unique measurement point identifier.
Point Type: Select the type of measurement point, which usually distinguishes the features of the data ingested by the measurement points. When storing data, the different types of measurement data are stored separately according to their types. When reading data, different types of measurement data can also be processed differently. The description of each point type is as per the below.
AI: The AI type measurement point usually ingests time series data of numerical type. When reading data, you can choose to aggregate data with specific algorithms.
DI: The DI type measurement point usually ingests device status data. When reading data, you can choose to only query the device status change data.
PI: The PI type measurement point is usually used for calculating electric power data. When reading data, you can choose to aggregate the data with specific algorithms.
Generic: The measurement point for all other types of data, especially data of non-numerical types.
Note
If the measurement point data has been stored in the time series database (TSDB), the point type cannot be modified. Changing the point type may result in failure when querying stored historical data. For more information, see Configuring TSDB Storage.
Data Type: The data types available will differ according to the selected Point Type.
AI Point Type: Available data types for selection are int, float, and double.
Point Type: Only int data type is available.
PI Point Typ: Only double data type is available.
Generic: Available data types for selection are int, float, double, enum, string, timestamp, date, struct, array, and file.
For more information, see Data Types.
Quality Indicator: Whether the measurement point is an indicator of the data quality. If set to Yes, the configurations are as follows:
Value: Sets the data type of the measurement point. Only three types are supported: int, float, and double.
Quality Indicator: The data quality indicator (data type: array) that is predefined by the system. It cannot be changed. You can click View to see the predefined quality indicator parameters as well as their descriptions.
Description: The description of the measurement point.
Click OK to create the measurement point.
To create more measurement points, repeat the steps above.
Note
When measurement points are created, you must configure the storage policy for the measurement point data as soon as possible. Otherwise, the measurement point data will not be stored in TSDB by default after the device is connected to EnOS Cloud. For more information about configuring storage policy, see Configuring TSDB Storage.
Adding Service¶
On the Add Feature pop-up window, select Service from the Feature Type drop-down list and fill in the fields in the GUI, among which:
Name: The service name.
Identifier: The unique service identifier.
Description: The description of the service.
Input Parameter: The input paramters for the service. You can specify whether this parameter is required, and specify a minimum and maximum value for the input parameter, and to provide a default value for the required input parameter should one not be provided during service invocation.
Click OK to create the service.
To create more services, repeat the steps above.
Adding Event¶
On the Add Feature pop-up window, select Event from the Feature Type drop-down list and fill in the fields in the GUI, among which:
Name: The event name.
Identifier: The unique event identifier.
Severity:
Information: Refers to the general notifications reported by the devices, such as a notification on job completion.
Warning: The warning messages or exceptions reported by a running device. These events may lead to malfunctioning.
Error: The error messages or emergencies reported by a running device. These events severely impact a device so that it is unable to operate properly and must be addressed immediately.
Description: The description of the event.
Click OK to create the event.
To create more events, repeat the steps above.
Import from Standard Feature Library¶
Select Import from Standard Feature Library.
Choose the feature that you need from the list in Select Standard Feature and click OK.
In Add Feature, modify the feature details as needed.
Click Confirm to finish adding the feature from the library.
Note
You can add the same standard feature definition to the same model multiple times as long as their Identifier are different.
The Feature Type, Standard ID, Data Type and Unit of standard feature definitions cannot be edited.
Publish the Feature Definition¶
After adding the feature definitions, click Publish.
Step 3: (Optional) Adding a Tag¶
A tag describes the common information shared by models of the same type. It can be used to distinguish model objects by describing their categories such as domain, type, and scope. For example, by adding a domain:solar tag to a model, you are specifying that the model falls in the solar field.
From the list of created models, find the target model and click Edit.
Under the Basic Information tab, click Edit in the Tags section.
On the pop-up window, click New tag, and enter the key-value pair (key:value) for the new tag.
Click OK to save the tag.
Results¶
When the feature definition of the model is completed, the system will automatically generate a model for the product in JSON format.
Note
After add the features for your model, you need to click Publish. Otherwise, the features would not be saved.
The model is locked during editing mode, and other users cannot edit it until your publish the changes or cancel and exit the editing mode.