Add an Instance
11 min
an instance represents a specific asset (a machine, device, or line) that is created from a model when you add an instance, you select the model it inherits its structure from and then fill in the actual values the real world attribute data for that asset and the data topics that feed its dynamic attributes note digital twins requires a scale or growth litmus license before you begin create a digital twins model before adding an instance see \[create and import models]\( /create and import models revised md) for details add an instance when you add an instance, you set a few key options that affect how data is published interval how often litmus edge assembles and publishes the full instance payload set to zero to disable interval based publishing; use the pollonce topic instead to trigger on demand flatten hierarchy converts nested json objects to single level, dot notation key value pairs (for example, dynamic attribute temperature value 30 ) enable this when sending payloads to tabular databases such as sql or influxdb publish attributes creates additional, targeted topics for individual static and dynamic attributes alongside the main instance topic enable this when downstream consumers need only part of the full payload see publish specific attributes docid\ vl7rn0 wiajo25vsadbnt below to add an instance navigate to digital twins > instances the instances pane appears click the add an instance tile the add an instance dialog appears search for or select the model to associate with this instance in name , enter a name for the instance in interval , enter the publishing interval in seconds enter 0 to disable interval based publishing in topic , review the default topic for this instance the topic follows the format digitaltwins \<model name> \<instance name> to flatten nested json structures, select flatten hierarchy to publish individual attribute topics in addition to the main topic, select publish attributes click add configure the instance after creating the instance, select its tile in grid view to open the configuration page the instance inherits its attribute structure from the model; your task here is to fill in the real values and map live data topics click save after making changes, then click restart instance to apply them static attributes the static attributes tab shows the metadata fields defined in the model replace the placeholder values with the actual values for this specific asset for example, replace the plant name, area, and manufacturer with the values for the specific machine this instance represents action details \[1] search attributes filter the list of static attributes \[2] refresh refresh attribute values \[3] import attributes import attribute values from a csv file see \[create and import models]\( /create and import models revised md) for the required csv format \[4] save instance save changes to the instance \[5] edit edit the value for a specific static attribute dynamic attributes the dynamic attributes tab shows the real time data fields defined in the model for each attribute, map the data topic that feeds it a devicehub tag, an integration topic, or any other message broker topics that publishes the relevant data for this specific asset important data for a dynamic attribute appears in the instance payload only when that attribute has a topic mapped to it note if a dynamic attribute has a topic expression defined in the model, the topic is not editable here to change it, update the model's topic expression or the instance's parameter values action details \[1] search attributes filter the list of dynamic attributes \[2] edit map a data topic to the attribute click the edit icon and search for a devicehub tag or enter a topic name directly \[3] refresh refresh attribute values \[4] import attributes import attribute topic mappings from a csv file \[5] save instance save changes to the instance data access the data access tab shows the instance topic and lets you subscribe to it to view the real time assembled payload details \[1] the instance topic name and interval click the copy icon to copy the topic string \[2] subscribe or unsubscribe to view live data for the instance the instance topic follows the format digitaltwins \<model name> \<instance name> publish specific attributes when publish attributes is enabled for an instance, litmus edge creates additional topics that publish subsets of the full payload static attributes publish all key value pairs to a single topic at the instance's configured interval digitaltwins \<model name> \<instance name> staticattributes dynamic attributes each publish to their own topic, event driven based on when new data arrives for that attribute digitaltwins \<model name> \<instance name> \<dynamic attribute name> example a model named cnc with an instance named cnc001 , an interval of 10 seconds, and dynamic attributes temperature , current , pressure , and power static attributes topic (publishes every 10 seconds) digitaltwins cnc cnc001 staticattributes temperature topic digitaltwins cnc cnc001 temperature current topic digitaltwins cnc cnc001 current pressure topic digitaltwins cnc cnc001 pressure power topic digitaltwins cnc cnc001 power to subscribe to these topics when adding or editing the instance, select publish attributes navigate to analytics > instances and add the datahub subscribe processor enter the topic for the attribute you want to subscribe to note you can use wildcards in these topics use an asterisk ( ) to match a single segment (model name or instance name), or a right angle bracket ( > ) to match everything after a given point examples digitaltwins cnc power subscribes to the power attribute for all cnc instances digitaltwins cnc cnc001 > subscribes to all attribute topics for cnc001 next steps manage instances docid\ req2rshywfuzlnezqls0t