MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.2k stars 21.35k forks source link

Device's reported properties #33665

Closed obrookstein closed 4 years ago

obrookstein commented 5 years ago

Hi, In IoT Hub, the way for a device to report its properties, is by updating the reported properties section in its twin file. Since the DT's IoT hub is not exposed, and there's no way to reach the twin files, what is the best practice for a DT device to report it current property (other than using telemetry)?

Thanks,


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

SnehaAgrawal-MSFT commented 5 years ago

@obrookstein Thanks for your feedback! We will investigate and update you shortly.

dsk-2015 commented 5 years ago

@alinamstanciu fyi

julieseto commented 5 years ago

I'm not working on Digital Twins anymore, so I removed the "assigned to." Christian, Dan, or Alina could be the assignees.

mimckitt commented 5 years ago

@julieseto please provide their GitHub usernames so we can properly assign.

obrookstein commented 5 years ago

@MicahMcKittrick-MSFT, @julieseto ?

KingdomOfEnds commented 5 years ago

@obrookstein - Have you tried accessing the required information through the Management API's? You can, for instance, follow the documentation here: https://docs.microsoft.com/azure/digital-twins/how-to-query-common-apis to query for sensorvalues (devices can submit information and properties about themselves as sensorvalues). It might not be the best option (if you simply don't want to transmit telemetry about device state, though the Message object has optional properties and telemetry attributes that can be attached as needed), but from an access standpoint it might suit your use-case.

KingdomOfEnds commented 5 years ago

There's also a YOUR_MANAGEMENT_API_URL/system/devices/statuses API Endpoint as well. It provides basic state information about your devices. From the Quickstart, you can bring back the following states:

[
    {
        "id": 1,
        "name": "Active",
        "accessControlPath": "/system",
        "friendlyPath": "/system",
        "accessControlType": "System"
    },
    {
        "id": 3,
        "name": "Disabled",
        "accessControlPath": "/system",
        "friendlyPath": "/system",
        "accessControlType": "System"
    },
    {
        "id": 2,
        "name": "Offline",
        "accessControlPath": "/system",
        "friendlyPath": "/system",
        "accessControlType": "System"
    },
    {
        "id": 0,
        "name": "Provisioned",
        "accessControlPath": "/system",
        "friendlyPath": "/system",
        "accessControlType": "System"
    }
]
obrookstein commented 5 years ago

Thanks @KingdomOfEnds, I'm, using telemetry messages to report status updates, but it feels that updating the "reported properties" in the iot hub twin file is a better approach to update the device current configurations, and it is an additional option in IoT Hub to the telemetry. I was hoping for a similar mechanism with DT.

obrookstein commented 5 years ago

Hey @KingdomOfEnds ,

This one is left open. I understand that there's currently no way to do so?

Also - let me please add to that - how about C2D messages? How can we achieve that with DT?

Thanks,

KingdomOfEnds commented 5 years ago

Hi @obrookstein - Yes, that's correct the IoT Hub device files are not exposed during the Preview. Typically, you can modify those through the Portal (as well as submit C2D messages directly through the Portal or Programmatically). I know the engineering team's hard at work preparing for the future and I'm happy to notify you when and if those features become available.

PS - And thank you very much for your suggestions and insights! I will make sure they are relayed to the PM and Engineering teams!

baanders commented 4 years ago

Thank you all for the discussion. It appears the original questions in this issue have been addressed, and it now hangs open on possible notification of future features that may or may not become available. Opting to close the issue based on this, rather than leaving it open indefinitely.

I am taking over Azure Digital Twins content and will continue to monitor for the features @KingdomOfEnds described. If they become available, I will follow up with another comment in this thread, notifying @obrookstein about the new release information. The issue can also be reopened at that point if necessary.

Thank you!

baanders commented 4 years ago

please-close