Product Features
Digital Twins

Create and Import Models

28min

Notes:

  • The Digital Twins feature is available for Litmus Edge version 3.3.1 and later.
  • To access the Digital Twins feature, you need a Scale or Growth Litmus license.

You can create Digital Twins models by navigating to Digital Twins > Models.

See Use Digital Twins to Contextualize Data to review how to leverage Digital Twins.

Step 1: Create Model

You have two options for creating the model. You can create a new model or import a model as a JSON file.

Create a New Model

To create a new model:

  1. Navigate to Digital Twins. The Models pane appears.
  2. From the Models pane, click the Create a model tile. The Create a Model dialog box appears.

    The Create a Model tile
    The Create a Model tile
    
  3. Click the Type drop-down list and select a model type.
  4. Enter the name of the model in the Name field.
  5. (Optional) Enter a short description of the model in the Description field.
  6. Click Add. A new model tile appears in the Models pane.

Import an Existing Model

You can import a model as a JSON file.

To import an existing model, click the Import Model icon, select the <model name>.json file, and click Open.

Import Model icon
Import Model icon


Model Versions

Note: This feature is available for Litmus Edge version 3.11.0 and later.

When you create a model, the model version starts at v.0. When you make changes to the model, the version number is updated.

For Litmus Edge version 3.11.0 and later, the version number is displayed in the model tile.

Model version number
Model version number


For Litmus Edge version 3.11.1 and later, the version number is also displayed in the model and instance configuration.

Document image


Implement Model Updates to Instances

If there are changes to the model that need to be implemented in associated instances, click Upgrade Instances.

Document image


Then, select the instances to upgrade and click Upgrade.

Model Changed dialog
Model Changed dialog


Step 2: Configure Model

After creating the model, you can configure it appropriately for instances.

Important:

  • For Litmus Edge version 3.5.6 and earlier, no changes are allowed to a model after creating an instance for the model.
  • For Litmus Edge version 3.11.0 and later, you have the option to update models with instances and select which instances to update as well.

Click the Model tile (grid view) or Model name (table view) to view the model details.

Model Image

Click the Upload image icon to select an image for the model. The image will display for the model tile on the Models pane. Supported file types include: .jpeg and .png

Document image


Static Attributes

Manage the metadata for the model from the Static Attributes tab.

Notes:

  • For Litmus Edge versions 3.3.1 to 3.5.6, there is a limit of 100 static attributes. For versions 3.11.0 and later, the limit is 2000.
  • The ability to export and import dynamic attributes is available for Litmus Edge version 3.11.0 and later.

Manually Add Static Attributes

To add static attributes:

  1. Click the Model tile (grid view) or Model name (table view) to open the model details.
  2. From the Static Attributes tab, click the Add item icon.

    Document image
    
  3. In the Attribute Name field, either select an item from the drop-down list or enter a custom attribute name.

    Document image
    
  4. In the Attribute Value field, enter a value for the model.
  5. When done adding attributes, click Save Model. For Litmus Edge versions 3.5.6 and earlier, save individual attributes by clicking the Save icon in each attribute row.
Document image


If you need to filter existing attributes, you can use the search field.

Document image


Import Static Attributes

To import static attributes (Litmus Edge version 3.11.0 and later), create a CSV file with the following headers.

Required Headers

  • ModelName
  • Key
  • Value

Optional Headers

  • InstanceName

After creating the file, click the model tile, navigate to Static Attributes, and click the Import Attributes icon.

Document image


Export Static Attributes

To export a CSV file of existing static attributes (Litmus Edge version 3.11.0 and later), click the Export Attributes icon.

Document image


Transformations

Use the Transformation tab to transform the data collected in instances by converting raw JSON data to a desired format by defining the JSON-based schema.

You can define schema IDs, which can be used to manipulate the payload and define a structure for the payload as the model inherits data.

See Use Digital Twins to Contextualize Data to review how to format transformations.

Note: If you update a transformation and remove all elements from the schema, the entire NATS message will be included in any dynamic attribute that has the transformation selected for the Schema ID.

Arrays

As of Litmus Edge version 3.11.3, you can configure arrays in transformations.

For example:

JSON


Configure Transformations

To add a transformation schema:

  1. Click the Model tile (grid view) or Model name (table view) to open the model details.
  2. Click the Transformation tab.
  3. Click the Add a Schema icon. The Add dialog box appears.

    Document image
    
  4. Enter a name for the schema.
  5. In the code window, copy and paste the JSON-based schema.
  6. Click Add.
  7. When done adding attributes, click Save Model. For Litmus Edge versions 3.5.6 and earlier, transformations are automatically saved.
Document image


To edit or delete a schema, click the Action menu for the schema and select an option.

Document image


Dynamic Attributes

Manage variable data in the model from the Dynamic Attributes tab. You have the option of adding a schema ID, which can be used to map dynamic attributes one-to-one for data transformation.

Notes:

  • For Litmus Edge versions 3.3.1 to 3.5.6, there is a limit of 100 dynamic attributes. For versions 3.11.0 and later, the limit is 2000.
  • The ability to export and import dynamic attributes is available for Litmus Edge version 3.11.0 and later.

Manually Add Dynamic Attributes

To add a dynamic attribute:

  1. Click the Add item icon.

    Document image
    
  2. In the Name field, enter a name for the attribute.
  3. (Optional) Enter values for Unit and DataType. For Litmus Edge version 3.11.0 and later, you have the option of selecting the data type from the drop-down menu.
  4. (Optional) If you've created data transformation schemas, select one from the SchemaID field.
  5. When done adding attributes, click Save Model. For Litmus Edge versions 3.5.6 and earlier, save individual attributes by clicking the Save icon in each attribute row.
Document image


If you need to filter existing attributes, you can use the search field.

Document image


Import Dynamic Attributes

To import dynamic attributes (Litmus Edge version 3.11.0 and later), create a CSV file with the following headers.

Required Headers

  • ModelName
  • SchemaID

Optional Headers

  • InstanceName
  • Topic
  • Name
  • Unit
  • DataType

After creating the file, click the model tile, navigate to Dynamic Attributes, and click the Import Attributes icon.

Document image


Export Dynamic Attributes

To export a CSV file of existing dynamic attributes (Litmus Edge version 3.11.0 and later), click the Export Attributes icon.

Document image


Hierarchy

Use the Hierarchy tab to create a custom data structure for the model.

Notes:

  • The Save button is available for Litmus Edge version 3.5.2 and later.
  • The ability to rename nodes/items and import/export hierarchies is available for Litmus Edge version 3.11.0 and later.
  • Clicking the Save Model button will increment the version number, even if no changes are made.
Document image


To create a category for the hierarchy, click the Action menu icon for root and select Add Node.

Document image


To add attributes to the hierarchy, do one of the following:

  • Drag and drop attributes from the left-hand list to the canvas under the appropriate category.
  • Click the Action menu for a category and select Add item to Node. Then, select the attribute to add.

When done configuring the hierarchy, click Save Model. For Litmus Edge versions 3.5.6 and earlier, click the Save icon.

Document image


Rename Nodes

To rename nodes and attributes added to nodes (for Litmus Edge version 3.11.0 and later), click the Rename Node and Rename Item icons.

Document image


Import Hierarchies

To import a CSV file of a hierarchy (Litmus Edge version 3.11.0 and later), create a CSV file with the following headers:

  • ID
  • ModelID
  • Position: Enter the position of the attribute in the hierarchy.
  • ParentID: If the attribute is under a node/category, enter the ParentID of the node. To get the ParentID, create a new node, export the hierarchy, and then refer to the ParentID column.
  • Name: The name of the attribute.
  • IsFolder: If it is an attribute, the value is FALSE. If it is a node, the value is TRUE.
  • AttributeID
  • AttributeType
Document image


Export Hierarchies

To export a CSV file of an existing hierarchy (Litmus Edge version 3.11.0 and later), click the Export hierarchy icon.

Document image