Azure / opendigitaltwins-dtdl

Digital Twins Definition Language
Creative Commons Attribution 4.0 International
466 stars 160 forks source link

[Query] DeviceConnected/DeviceDisconnected events #85

Closed dkattan closed 3 years ago

dkattan commented 3 years ago

Query/Question According to this page, it is possible to use Message Routing to receive Device Connect and Disconnected events and route them to the internal Event Hub

image

In practice, we receive DeviceCreated events, but do not receive DeviceConnected or DeviceDisconnected events.

We tried creating Routes for all available Data Sources, to no avail:

image

I can watch the DeviceTwin connectedState change from Connected to Disconnected and vice-versa, but we do not receive any events when this happens.

image

My hypothesis is that this particular functionality (ability to receive lifecycle events on the built-in eventhub) is in some sort of public preview and needs to be enabled by some unpublished mechanism.

The information about this is inconsistent and sparse.

There is this Stack Overflow post from 2018 suggesting that this is not a supported feature of the IoT Hub.

But then there is this blog post from March 2020 suggesting it is a supported feature:

In addition to telemetry data, routes can be created for other events such as Device Twin changes, Device Lifecycle events and Digital Twin changes (currently in public preview). If you create a route with the data source set to one of these other events, IoT Hub will send messages to the appropriate endpoint for that event (Device Twin, Digital Twin, Device Lifecycle).

@briancr-ms @ridomin

briancr-ms commented 3 years ago

Thanks for your question about IoT Hub. This repo is focused on the design and development of DTDL (Digital Twins Definition Language).

To help you with your question, the IoT Hub team says: currently IoT Hub does not route device connectivity state events. These are available via Event Grid. See this concept doc and tutorial on how to use them - here.

IoT Hub issues can be reported through the feedback link on the Overview portal page for your Azure IoT Hub portal or through the Azure IoT feedback forum: https://feedback.azure.com/forums/321918-azure-iot.