IoT alerts

Completed

In Dynamics 365 Field Service, IoT alerts represent a subset of IoT messages that might require attention, such as when a configured sensor in a refrigerator that you have serviced is alerting that humidity has risen above an acceptable threshold. As these alerts come in, you might decide to provide remote support on the item. Alternatively, to support service delivery, you might want to convert that incoming IoT into a work order, which can then be scheduled and assigned to a service technician.

Trigger IoT alerts

Before you explore the process of working with IoT Alert records, you should first examine how alerts can be generated and triggered. IoT hubs process numerous data for devices. As IoT device information flows into an Azure IoT hub, you can create rules that will dictate when IoT alerts should be created based on the IoT messages that are coming in. For example, you could have an alert trigger when a smart thermostat has a temperature reading above 70 degrees.

As messages come in, you need a way to review them and then define the criteria for triggering an alert. One tool that is most often used with Azure IoT hubs is Azure Stream Analytics, which is a real-time analytics service. As data from connected devices comes into IoT Hub, Stream Analytics will analyze the data and can trigger events based on the defined criteria.

For example, when you previously deployed Connected Field Service, a stream analytics job was also created that includes predefined criteria around temperature for your simulator. You can find and edit these criteria in Stream Analytics in your resource group. When you are in the stream, go to Query on the left pane and select IoTStream.

Two primary items in the IoTStream section are:

  • Events - The events pane in the lower part of the screen displays all incoming IoT messages from the connected device.

  • JSON to create alert - The upper pane shows the JSON code that creates IoT alerts from IoT messages.

Screenshot of the query and IoTStream options in the menu.

In the previous image, the JSON code specifies that when a device's temperature reading is greater than the reference temperature, the job will grab details such as the Device ID, temperature reading, and threshold temperature. This data will be passed over to Dynamics 365 in the IoT Alert record.

Trigger IoT alerts with the simulator

The following example shows how to trigger IoT alerts by using your simulator from earlier. Go to the URL of the simulator that you previously configured. When you are in the simulator, using the Device ID dropdown menu, select an IoT device to simulate. (Remember that these devices will be populated based on IoT devices that you registered directly in the IoT Hub or within Dynamics 365 Field Service).

Screenshot of the IoT alert simulator.

Note

If you aren't using Azure IoT Hub, you can create IoT alerts in Field Service based on IoT messages in your custom IoT provider. For more information, see Extensible IoT data sources for Connected Field Service.

View IoT alerts in Field Service

After the rule is created in Stream Analytics, a logic will create IoT alerts based on the rule criteria. The simulator example used 70 degrees as the temperature threshold, so when the temperature exceeded 70 degrees, an IoT alert was generated. The IoT Alert record provides necessary details about the alert. The Alert Data section displays the details that were captured as part of the previous Stream Analytics query.

Based on what was defined in the Stream Analytics query, the following alert data was sent:

  • Device ID - Specifies the ID of the device that generated the alert, such as HVACUnit20.

  • Readingtype - Specifies the type or reading. The simulator supports the Temperature and Humidity reading types.

  • Reading - Specifies the actual reading value for the device, such as 71.

  • Eventtoken - The event token number for the event.

  • Threshold - The threshold value that was exceeded in the reading, such as 70.

  • Ruleoutput - Defines the rule output based on the event, such as AlarmTemp.

  • Time - Registers the time when the event occurred.

Screenshot of an IoT Alert form, showing the Alert Data section.

Based on your organization's policies and the specific details that were reported in the alert, you might decide to take different actions on an IoT alert. For example, based on the severity, you might choose to interact remotely with the device by using the Send Command option on the command bar, or you might convert the alert into a case or work order record.

Convert an IoT alert to a work order

Out of the box, when an IoT alert is created, it will include a business process flow that can help guide you through the process of working with the alert through its life cycle and converting it into records, such as cases and work orders.

Screenshot of an IoT alert in Field Servive highlighting the business process flow.

The business process flow includes five stages:

  • Created - The initial stage that automatically will be the active stage after the IoT alert is initially created.

  • Create Case - Use to convert the alert to a case record so that it can be investigated remotely.

  • Create Work Order - Use after the case record is converted to a work order to indicate that someone will need to be sent on site.

  • Schedule Work Order - Indicates that the work order is ready to be scheduled and dispatched.

  • Close Work Order - Helps capture necessary details prior to closing the work order.

Screenshot of the Quick Create: Work Order form for the case that was created from the IoT alert.

Organize IoT alerts

Commonly, multiple IoT alerts are created for the same IoT device for the same issue. As a result, the system will recognize similar items and group them together.

Screenshot of Field Service IoT alerts, showing an icon indicating that they are grouped.

For more information, see Alerts in Connected Field Service for a video demonstration.