Use Digital Twins to Contextualize Data
Refer to the following how-to guide for leveraging Digital Twins for energy monitoring.
In this user scenario, the devicehub device will simulate the energy monitoring process across different plant sites. The data generated by the tags reflects real-time energy production, which allows for active analysis of energy efficiency, cost, and consumption patterns.
Digital Twins will model the asset as an energy-monitoring machine located at several plant sites. The instances for the model will be the specific energy-monitoring machines at each site.
The power generated in the last hour will be used to calculate values for cost, energy used, and energy rate. The timestamp value will be used to generate values for the attributes of season, start hour, and energy-rate description.
We need to add two tags for this. Tag 1, named "L3_Machine2", will generate random values simulating the variable power of an energy-monitoring machine. Tag 2 in Devicehub collects and stores data from energy monitoring devices. It helps in analyzing energy rates and seasons by simulating timestamp values.
Follow the steps to Connect a Device and configure the following parameters:
- Device Type: Simulator
- Driver Name: Generator
- Enable Alias Topics: Select the checkbox.
After connecting the device, add the following tag. See Add Tags to learn more.
- Name: Select S - Random value generator
- Value Type: Select float64
- Polling Interval: Enter 1
- Tag Name: Enter L3_Machine2
- Min value: Enter 1
- Max value: Enter 25
Values for power generated will be sent through the topic devicehub.alias.P2_Electrical_Panel.L3_Machine2.
The data collected from Energy Monitoring devices is stored in Devicehub by enabling the Enable Data Store option on the simulator devices. The simulator device will act as a device measuring power values. The tag will simulate these timestamp values from one of the energy monitoring machines, and then the output will be written to the topic flowToDT.EMD_L3_Machine2.
To process this data, you will need to connect to a third-party database and create a Flow using Flows Manager. This flow will collect the values and determine the season and energy rate based on the date and timestamp.
This user scenario will be based on the following sample output payload from one instance.
You will first need to create the model that will store the instances of energy monitoring machines.
To create the model:
- Navigate to Digital Twins. The Models pane appears.
From the Models pane, click the Create a model tile. The Create a Model dialog box appears.
- Click the Type drop-down list and select ASSET.
- Enter the name of the model in the Name field (for example, Energy_Monitoring_Model).
- (Optional) Enter a short description of the model in the Description field.
- Click Add. The new model appears in the Models pane.
After creating the model, you can configure it with the following parameters.
The static attributes will need to be customized for each instance.
- Asset
- Line
- Model
- Manufacturer
- Location
- Plant
The transformations are based on the sample payload above.
The list of transformations would display as the following.
Tip: To access nested metadata keys, you should include a period after the initial dollar sign. For example:
- $.metadata will extract the entire metadata object.
- $.metadata.$cost will extract the cost key in the metadata object.
The dynamic attributes will use the appropriate schemaID (transformation) to generate values.
Name | Unit (optional) | DataType (optional) | SchemaID (optional) |
---|---|---|---|
cost | USD | | cost |
energyRateDescription | | | energyRateDescription |
energyRate | USD/kWh | | energyRate |
energyUsed | | | energyUsed |
shift | | | shift |
startHour | | | startHour |
season | | | season |
power | kW | | |
The output for the model will be based on the hierarchy, which would categorize the dynamic and static attributes into telemetry or properties. It would look like the following.
Once the model is configured, you will need to Add an Instance for each energy monitoring device at each site.
One of the instances is described below based on the topics for the data in the user scenario description.
You will customize the model static attributes to the specific instance.
Attribute Name | Attribute Value |
---|---|
Asset | Machine 2 |
Line | Line 1 |
Model | model_112233 |
Manufacturer | Siemens |
Location | Canada |
Plant | Toronto |
You will configure the appropriate topics in the user scenario description to the dynamic attributes configured in the model.
Name | Unit | DataType | Topic | SchemaID (optional) |
---|---|---|---|---|
power | kW | | devicehub.alias.P2_Electrical_Panel.L3_Machine2 | |
cost | USD | | flowToDT.EMD_L3_Machine2 | cost |
energyRateDescription | | | flowToDT.EMD_L3_Machine2 | energyRateDescription |
energyRate | USD/kWh | | flowToDT.EMD_L3_Machine2 | energyRate |
energyUsed | | | flowToDT.EMD_L3_Machine2 | energyUsed |
shift | | | flowToDT.EMD_L3_Machine2 | shift |
startHour | | | flowToDT.EMD_L3_Machine2 | startHour |
season | | | flowToDT.EMD_L3_Machine2 | season |