---
title: Create and configure a model
slug: litmusedge/product-features/digital-twins/create-and-configure-models
description: Learn how to create and configure Digital Twins models. 
docTags: 
createdAt: 2022-09-08T19:10:53.000Z
---

A model defines the structure of a digital twin: its static attribute placeholders, dynamic attribute fields, data transformations, topic expression parameters, and schema. Every instance you create from the model inherits that structure and supplies the values for a specific physical asset.

This topic shows you how to create a model and configure its attributes and schema. Also see [Configure transformations](docId\:tbKP-rLU3oCBdJCnjy4lq) and [Configure parameters](docId\:TSNcJWVOs5H4bXMoUjIcg) topics.

## Before you begin

Before you create a model, ensure you have:

- A Scale or Growth Litmus license
- Access to Digital Twins in Litmus Edge (LE)
- An exported model JSON file if you plan to import a model instead of creating one
- A CSV file of attributes if you plan to import static or dynamic attributes

## Create a model

You can create a model from scratch or import one from a JSON file exported from another LE instance.

**To create a new model:**

1. Navigate to **Digital Twins** > **Models**.
2. Click the **Create a model** tile.
   The *Create a Model* dialog appears.
3. Click the **Type** list and select a model type.
4. Enter a name for the model.
5. Optionally, enter a short description in the **Description** field.
6. To use the Litmus Unified Namespace (UNS) or Unify Cloud Connector, select the **UNS Enabled** checkbox and select a UNS connector from the drop-down list. The connector ensures that MQTT topic names conform to your Unified Namespace structure.
7. Click **Add**.
   The new model tile appears in the *Models* pane.

**To import a model:**

1. From the *Models* pane, click the **Import Model** icon.
2. Select the `<model name>.json` file
3. Click **Open**.

::Image[]{src="https://app.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/LAj9ItVAwnDjSPV0mYRoF_image.png" size="80" width="1920" height="482" position="flex-start" caption="Import Model icon" darkWidth="1920" darkHeight="482" alt="Import Model icon in the Models pane" showCaption="true" indent="2"}

Optionally, click the **Upload image** icon to add a picture that visually identifies the model.

### Model versions

Each model starts at version zero (v.0). The version increments each time you save the model. The current version appears on the model tile and on the model configuration page. Instances track which model version they were created from, which matters when you use **Upgrade Instances** to push model changes to existing instances.

::Image[]{src="https://app.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/krxXpLExxunVPtAqY2bLV_image.png" size="30" width="318" height="197" position="flex-start" caption="Model tile" darkWidth="318" darkHeight="197" alt="Model tile" showCaption="true"}

## Add static attributes

Static attributes hold fixed metadata such as `Manufacturer`, `Plant`, `Area`, or `Device Description`. You set placeholder values in the model and instances replace them with values for the assets they represent.

**To add static attributes:**

1. Click the model tile to open the model configuration page.
2. From the **Static Attributes** tab, click **Add item**.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/qlVit9OKpjz42ARH1psCk_image.png" size="80" width="1367" height="691" darkWidth="1367" darkHeight="691" position="flex-start" alt="Static Attributes tab with the Add item button" showCaption="false" indent="2"}

3. In **Attribute Name**, select an existing attribute from the drop-down list or enter a new name.
4. In **Attribute Value**, enter a placeholder value.

### Import static attributes

You can import static attributes from a CSV file. This is useful when you have many attributes or want to populate several instances at once. Before importing, create a CSV file with the following headers:

| Header         | Description                                                         | Required |
| -------------- | ------------------------------------------------------------------- | -------- |
| `ModelName`    | Model the attributes belong to                                      | Yes      |
| `Key`          | Attribute name                                                      | Yes      |
| `Value`        | Attribute value                                                     | Yes      |
| `InstanceName` | Sets attribute values on the named instance instead of on the model | No       |

**To import static attributes:**&#x20;

1. Navigate to **Static Attributes** and select **Import Attributes**.
2. Click **Import/Export Attributes** at the right and select **Sample CSV**.
3. Navigate to the CSV file and open it.

**To export static attributes to a CSV file for offline editing:**

1. Select the **Static Attributes** tab.
2. Click **Export Attributes**.

### Asset Hierarchy attributes

When an instance is linked to an asset in Asset Hierarchy in Litmus Edge Manager (LEM), these additional read-only static attributes display:

- `hierarchyPath`: Instance's location in the asset hierarchy (for example, `ACME.Europe.Greenfield.Plant_2.Boiler.Boiler_01`)
- `hierarchyMetadata`: JSON key/value pairs that describe the levels and order of the hierarchy (for example, `enterprise`, `region`, `site`, `plant`, `area`). LEM keeps the levels in the same order when it syncs.

LEM sets and updates these values when the instance is added to, moved within, or deleted from the hierarchy. If the model was synced from LEM, these values are locked. If the model is local, they stay editable. Other static attributes on the same instance remain editable.

## Add dynamic attributes

Dynamic attributes hold real-time data for an asset, such as temperature readings, current values, and pressure. Each dynamic attribute is mapped to a data topic in an instance and the live data from that topic appears in the instance payload.

Dynamic attributes support JSON, boolean, array, string, and number data types. If you don't specify a data type, JSON applies. Each dynamic attribute can also reference a transformation schema to shape the data before it enters the payload.

**To add a dynamic attribute:**

1. Click the **Add item** icon.

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/5CbpPhNbgvE_GIeBPhkmX_image.png" size="100" isUploading="false" width="1626" height="608" darkWidth="1626" darkHeight="608" alt="Dynamic Attributes tab with the Add item icon" showCaption="false" indent="2"}

2. Enter a name for the attribute.
3. Optionally, enter a value in **Unit** and select a **Data Type**.
4. If the data type is JSON, optionally select **Skip Key** to exclude the attribute key from the payload while keeping its value. For example, the value persists as `value='20'` without the key name.
5. Optionally, define a topic expression using static strings and parameter placeholders in curly brackets. For example: `devicehub.alias.{device}.tagname`. The `{device}` part is resolved per instance based on the instance's parameter value for `device`.
6. Optionally, select a transformation schema from the **SchemaID** field.

::Image[]{src="https://app.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Ow4FsT_yg0PiL_SmRe_yu_image.png" size="80" width="1368" height="436" position="flex-start" indent="2" darkWidth="1368" darkHeight="436" alt="Dynamic attribute row showing the Unit, Data Type, topic expression, and SchemaID fields" showCaption="false"}

7. Click **Save Model**.

### Import and export dynamic attributes

**To import dynamic attributes:**

1. To download the sample CSV file, click **Import/Export Attributes** at the right and select **Sample CSV**.
2. Populate it with your attributes.
3. Click the model tile and select the **Dynamic Attributes** tab.
4. Click **Import Attributes**.

**To export dynamic attributes to a CSV file:**

1. Select the **Dynamic Attributes** tab.
2. Click **Export Attributes**.

## Define the schema

A schema groups static and dynamic attributes into a named hierarchy for downstream systems that expect a specific JSON structure.

**To create a schema:**

1. Select the **Schema** tab.
2. Click the **Action menu** icon for `root` and select **Add Node**.
3. Add attributes to the schema using either method:
   - Drag attributes from the left-hand list onto the canvas under the appropriate category.
   - Click the **Action menu** for a category, select **Add item to Node**, then select the attribute.
4. Click **Save Model**.

::Image[]{src="https://app.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/31uNHcIQd4kUcCSpSCB7b_image.png" size="80" alt="Schema tab with attributes arranged under the root node" isUploading="false" width="1418" height="590" darkWidth="1418" darkHeight="590" position="flex-start" showCaption="false" indent="2"}

The **Schema** tab also provides the following options:

- **Export Schema:** Exports the current schema to a JSON file.
- **Sync Attributes:** Appends all current attributes to the schema hierarchy. The `static_attributes` and `dynamic_attributes` nodes are recreated if they already exist. Confirm the sync when prompted.
- **Clear Schema:** Removes all nodes from the schema builder. Changes apply when you save the model.

## Apply model updates to instances

Existing instances do not inherit model changes automatically. Use **Upgrade Instances** to push the changes to selected instances.

**To apply model updates:**

1. Click **Upgrade Instances**.
2. Select the instances to upgrade.
3. Click **Upgrade**.

::Image[]{src="https://app.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/w7qQIdsrHtyK2pXC_-mvW_image.png" size="80" alt="Upgrade Instances dialog with the instance selection list" isUploading="false" width="1415" height="678" darkWidth="1415" darkHeight="678" position="flex-start" showCaption="false" indent="2"}



## Verify the model

**To confirm the model is configured correctly:**

1. From the **Models** pane, confirm the model tile appears with the name and version you expect.
2. Open the model and confirm the attributes you added are listed on the **Static Attributes** and **Dynamic Attributes** tabs.
3. Create an instance from the model and open its **Data Access** tab.
4. Confirm the assembled JSON payload contains the attributes and structure you defined.

## Related topics

- [Digital Twins](docId\:xlj3gvOZyg_52Ue4pB5u7)
- [Configure transformations](docId\:tbKP-rLU3oCBdJCnjy4lq)
- [Configure parameters](docId\:TSNcJWVOs5H4bXMoUjIcg)
- [Add an instance](docId\:jzOth4T0hCrTRauUSdRyK)
- [Model and instance actions](docId\:HK0IDxlg7ZCoetaJWcoBO)&#x20;
