Antonio Vildes Barbosa
Antonio Vildes Barbosa

Reputation: 127

Rule to check when device stops sending messages to IoT Central

I want to create a rule to check when my device stops sending messages to IoT Central.

For example, when I have a power outage and my device stops working I want to be able to fire an action: send email, run an Azure Function, etc.

I was thinking of creating a command to send a message to my device and then try to read it back. Then I would create a job to run this command but this doesn't seem to be right way to deal with this.

Is that possible? What should I do?

EDIT I already have some telemetry information being sent from my device to the cloud. If I was able to calculate the time past since the last message, I could create a rule (ex.: When time is greater than X) to fire an action.

Upvotes: 2

Views: 517

Answers (2)

Matthijs van der Veer
Matthijs van der Veer

Reputation: 4085

This Microsoft tutorial deals with your scenario. The telemetry is exported to an event hub and Stream Analytics checks if a device stops sending telemetry.

It seems you can't do this in IoT Central without exporting the data somehow.

Upvotes: 2

George Trifonov
George Trifonov

Reputation: 1991

You can try to create virtual health monitor device in a cloud which will periodically ping your physical devices . For example cloud device x will have telemetry 'HealthDeviceAtHomeA', if you able to reach device A from cloud device X you are sending telemetry HealthDeviceAtHomeA = 100, otherwise HealthDeviceAtHomeA = 0 . Then for device x create a rule that will check average of HealthDeviceAtHomeA for last 5 min and if it less then for example 50 you will alert. This will ensure connectivity and you can define different rules and logic as a number of your devices grows. If you have firewall restrictions then your home device can report its health to virtual health device.

Upvotes: 0

Related Questions