Email notification if Azure IoT Hub Device disconnected state

Latha 1 Reputation point
2021-04-16T07:40:40.853+00:00

Hi,

I have followed below document for sending the email notification if received IoT Hub device disconnected state.

https://learn.microsoft.com/en-us/azure/event-grid/publish-iot-hub-events-to-logic-apps

I am receiving email notification but there is no device is disconnected state in IoT Hub. In Event Grid subscription, selected device disconnected state event. In logic app, do I need to add any condition? I have added same as mentioned document in Logic app. I have attached logicapp screenshot.
88542-logicapp-iothubdevicestate.png

Could any one hep on this issue?

Regards,
Latha

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
695 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Satish 13,631 Reputation points Microsoft Employee
    2021-04-17T05:58:25.973+00:00

    Hello @Latha Thanks for reaching out to us!

    Few Troubleshooting Steps:

    1) Have you verified that all the LogicApp runs history ?
    2) Please verify if you have selected the event type in the IoTHub events settings?
    3) Check if you are able to see the connected & disconnected states for the Device Twin is getting changed?

    88761-image.png

    88678-image.png

    88677-image.png

    We have verified the Document and were not able to repro the issue, as below images show the successful email alerts for Connected and Disconnected events.

    The schema for DeviceConnected and DeviceDisconnected events have the same structure. This sample event shows the schema of an event raised when a device is connected to an IoT hub:

    88704-image.png

    Verification from our side:

    88718-image.png

    88693-image.png

    Email Alerts to my Inbox:

    88694-image.png

    Please comment in the below section to get further help in this matter.

    If the response is helpful, please click "Accept Answer" and upvote it.