How can trailing forecast data be added to Azure Digital Twins DTDL models?

Giel Oomen 36 Reputation points
2022-09-28T13:31:59.423+00:00

Hey Microsoft or other devs,

We have been working with Azure Digital Twins for a bit over a year now and have already learned a lot. However, we are currently facing a challenge where we want to add trailing forecast data into a Digital Twin. The goal is to have real-time energy generation data (from solar panels) combined with hourly forecast data from openweathermap in our Azure Data Explorer and finally to be able to predict future energy generation from the solar panels.

Is the best approach to create one DTDL model which contains data for timestamp, UVI, temp, hum etc. and then create another overlaying DTDL model that contains the data DTDL model 48 times as component? Adding the same component multiple times is possible if they have unique names. This seems a bit tedious but we are not sure if there are better alternatives. One thing we can think of instead of using components is using a digital twin for all 48 hours that all have a relation to the core twin. But this also seems a bit tedious given that the data will be trailing (Twin 1 will get the data from Twin 2 in the next hour, 2 will get 3's data, 3's will get 4's etc.).

Hopefully this makes sense and someone can guide us in the right direction. Thanks in advance!

Thanks in advance,

Giel

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
385 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Giel Oomen 36 Reputation points
    2022-10-10T20:20:05.36+00:00

    To add some more info to this. We currently have one forecast system that updates once a day and one forecast (weather) that updates hourly. The weather forecast is a trailing model with 48 components (that contain a subset of all desired information given the 32kb limit) and the other forecast with 24h data updates once a day.

    Currently the main struggles are querying these two options in the data explorer. We can query the weather twin and show the forecast data with the TimeStamp on which it was updated, but this TimeStamp is different from the time where the values will actually happen (in the future). We have a dt object in all DTDL models but the documentation does not show how to extract multiple properties from twin models. https://learn.microsoft.com/en-us/azure/digital-twins/how-to-use-data-history?tabs=cli

    We are now playing around and trying to get it to work in the different possible ways.

    0 comments No comments

  2. Giel Oomen 36 Reputation points
    2022-10-15T10:05:14.327+00:00

    Another update on adding forecast data to DTDL models.

    We have continued to try out things and have changed our 48 component DTDL model to a single component with all weather data. The big advantage of this is that we can combine all weather data in one twin model rather than having to cut it into different parts due to twin size limits. The main disadvantage is that we only have the current weather data and the weather data in 47h and nothing in between (this is just in the live graph though).

    We are currently overwriting the same component 48 times at the start of each hour, and setting the SourceTimeStamp in the twins' metadata to track timestamps. This makes it possible to get graphs from a query that go into the future. It is not sure yet how this affects forecasting so we will come back with more info on the topic.

    Have a great weekend!

    Giel

    @QuantumCache , Unfortunately, I am not allowed to respond to our email thread. I received autoreplies that say "The group azcommunity-enterpriseiot isn't set up to receive messages from ****.

    0 comments No comments