Skip to content

This repo demonstrates how to provide a plant/mine walkthrough in 3d by integrating ADT in IoT Central

License

Notifications You must be signed in to change notification settings

malichishti/iot-central-3dScenes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Integrate ADT and 3d Scenes with IoT Central

IoT.Central.and.ADT.3d.Scenes.mp4

IoT Central as we know is a No Code aPaaS which allows users to quickly connect IoT Devices to cloud and start realizing use cases like Condition Monitoring, Remote Operations etc. Each device that gets connected already has Twin model defined, which makes integration with ADT as the logical next step. Here I demonstrate how you can not only integrate with ADT and start sending telemetry and properties to ADT but also how you can embed the ADT 3d Scenes back in IoT Central to close the loop and provide a richer experience to your users. This enables the users to walk through a plant or a mine, observe state of different assets, quickly identify assets which need attention and then drill down in a particular asset to view it in detail.

image

  1. Data Export
  2. Event Hub Trigger
  3. Patch Twins Function
  4. Embedder App
  5. IoT Central Dashboard

Step 1 - Upload the respective DTDL models into the ADT

For the device groups/models that you would like to integrate with ADT, upload their DTDL Models into the ADT. Once uploaded create a default/empty twin of the asset with a dtid same as the device id from IoT Central.

image

Links to help:

Step 2 - Create a Data export to Event Hub

In IoT Central create a Data Export for all your devices to an Event Hub destination as per the instructions here. Configure the Data Export to export all of the Telemetry to the Even Hub. image

Step 3 - Azure function to pass data from Event Hub to ADT

Create an Azure Function with a trigger on Event Hub. This would be responsible to receive the telemetry from Event Hub and Patch it in ADT for the respective twin. You can find the source code for this Function at /Azure Function - Event Hub to ADT/TelemetryTrigger.cs You can see it finds the deviceId from the message which is used to link to the corresponding twin via dtid. Next it sends a Patch to ADT for all telemetry received.

The Azure Function requires following Applications settings defined:

  1. EVENTHUB - this is a connection string to the Event Hub
  2. ADT_SERVICE_URL - This is the ADT Instance URL e.g. https://my-twins3.api.aue.digitaltwins.azure.net

Please Note: The Azure Function must have Azure Digital Twins Data Owner access to the ADT. You can achieve this by giving a System assigned identity to the Azure function and then adding a Role access for it on ADT.

Step 4 - Setup 3d Models

Now that we have Twins integrated with Device telemetry from IoT Central, next step is to create 3d Scenes and map telemetry and behaviors in the 3d models. You can follow the instructions here. Sample models can be found in this repository.

Step 5 - Create Embedder App

In this step you create an Azure App Service using https://github.com/malichishti/adt-3d-embedder-app This would enable you to embed any specific 3d Scene using an iFrame.

Step 6 - Embed a 3d Scene inside IoT Central Dashboard

You are now ready to embed the 3d Scene in IoT Central:

  1. Create a new dashboard
  2. In he edit view, add a External content Tile
  3. In the properties of the tile add a URL to your embedder app including a querystring parameter called sceneId e.g. https://3d-embedder.azurewebsites.net/?sceneId=3b614761fd1187ace3bac52ebb241c54

image

Now you will be able to see the 3d scene in your dashboard.

You can also setup navigation/drilldown between 3d scenes by using the Link Widget in 3d Scene Build view and passing a link to the embedder app.

image

About

This repo demonstrates how to provide a plant/mine walkthrough in 3d by integrating ADT in IoT Central

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages