Insight interaction between digital twins sensors and devices in IoT Central - Some clarifications

GuidoL 310 Reputation points


i need some clarifications to continue the deployment of my project about Rdif smart library using digital twins.

i focus on interaction between digital twins sensors and devices i created in IoT Central.

About devices created in Iot Central, i used custom template device for IoT device, so i configured telemetry and command and once created i exported json configurations and used these to upload models in Azure Digital Twins Explorer Preview. Once obtained models, i created twins sensors from these.

Consider that it's only a simulation and i don't want to connect IoT Central Devices and Digital Twins to library physical device (such as rfid self server kiosk, rfid gate, rfid programming station) .

In this way in twins sensors, i don't have any property (only telemetry and command) but without property i can't update them with data generated from IoT Devices created from device templates using Azure Function.

I understand that if a want to describe my devices have this capabilty and need to react to them outside of ADT, i have to use telemetry and instead, i want to store the values of my telemetry, i have to use a property.

So do i need to modify digital twins models (property instead telemetry) to have property which allows to Azure function to update the data or follow an other way? Actually rfid sensor needs telemetry and not property; property use is instead sensible in rfid tag that is subject to detections and modifications.

Thanks in advance.


Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
221 questions
{count} votes

Accepted answer
  1. LeelaRajeshSayana-MSFT 13,871 Reputation points

    Hi @GuidoL Greetings! Thank you for posting the question here. While there is no straight approach to update the Telemetry data of Azure Digital Twin using Azure functions, there is a method available to publish the telemetry data using a Digital Twin to an end point listener. You can leverage this for your testing and simulate the data to an end point.

    DigitalTwinClient class provides a PublishTelemetryAsync method which Publishes telemetry from a digital twin asynchronously. The result is then consumed by one or many destination endpoints (subscribers) defined under DigitalTwinsEventRoute. Please refer the documentation on the Method for more detials.

    You can publish the Telemetry data using the following line of code

    await client.PublishTelemetryAsync(deviceId, Guid.NewGuid().ToString(), "{\"Temperature\": 5}");

    As you are already aware, Telemetry data is not explicitly stored anywhere unless we create an End point listener. If you would like to avoid the usage of property, this might be a good approach that you can test with.

    Please also refer the article Process Azure Digital Twins data updates with the new Azure Function Extension Libraries which provides you the steps needed to set up and Event Hub end point and consume the Simulated data through an Azure function.

    Hope this helps. Please let us know if you have any additional questions in the comments below.

    If the response helped, please do click Accept Answer and Yes. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful