Remotely interact with devices

Completed

Once your IoT-enabled customer assets are registered with an Azure IoT Hub or custom IoT provider, readings from the devices are captured based on the configuration. When configuring a solution, you can define how and when you want to trigger an alert that can be sent back into Dynamics 365. For example, let’s say that you have an IoT-enabled thermostat. The device constantly sends temperature readings back to the IoT hub. As soon as a temperature reading that is outside of a specified threshold is discovered, it generates an IoT alert record in Dynamics 365. Configuring how these items are triggered is outside of the scope of this learning module.

The Dynamics 365 Connected Field Service solution contains several record types that can be used to help with sending commands back to the device.

The following table defines some of the key record types that are used.

Record Type Use
Device category Allows for grouping of IoT devices by a specific category. Device categories can be used with Command Definitions for easier device management.
Command Used to remotely interact with a connected IoT device by passing JSON commands to the device.
Command definition Used to predefine commands to streamline sending them to devices. When you create a Command, you can select a Command Definition, and any defined properties are populated.
Property definition Used to define specific properties that can be passed as part of a Command Definition.

When you configure the Connected Field Service solution, you can set up a Power BI chart. This option requires that you add a SQL database to your IoT hub. Then connect it to a Power BI template that helps with publishing device readings to a chart in Dynamics 365. If you choose to configure Power BI, once the device is registered, you can view readings sent by the device directly on the Customer Asset record. By default, you can see the last 20 readings, but you can change the default settings in the report by using Power BI Desktop.

Once an alert is received, it contains all the relevant information about the device alert. The alert data takes the JSON data generated by the alert and displays it in the application. You can use this information to determine the next action to take.

Screenshot of Switch to JSON View toggle.

Many times, you might be able to resolve the issue remotely by resetting or sending a command back to the device. A command can be executed from a Customer Asset record, an alert, or automated using Power Automate flows.

Screenshot of a command being executed from a Customer Asset record.

A command consists of JSON that is sent back to the device. The command has parameters that it passes through to the device. To help with passing commands back to devices, command definitions and property definitions can be used to make command creation easier and more flexible. Command and property definitions are discussed in more detail in another course.