# Device Connected/Disconnected Event
# Abb.Ability.Device.Connected / Abb.Ability.Device.Disconnected
The Ability Platform features a platform event for monitoring the connectivity state of directly connected and Edge devices. This feature enables a user to remotely monitor the connectivity status of a device in non-real time, furnishing event logs that may be used for diagnostic purposes.
# Event Message Format
The platform event definition format is consistent with the format of other device events in Ability:
Abb.Ability.Device.Connected
Abb.Ability.Device.Disconnected
# Common Headers
Property | Mandatory | Data Type | Description |
---|---|---|---|
eventType | Mandatory | - | Type of the event. Requires enum with the following values: |
- | - Abb.Ability.Device.Connected | ||
- | - Event name: Abb.Ability.Device.Connected . Emitted when a device is connected to the connectivity provider (i.e., IoT hub). | ||
- | - Abb.Ability.Device.Disconnected | ||
- | - Event name: Abb.Ability.Device.Disconnected . Emitted when a device is disconnected from the connectivity provider (i.e., IoT hub). | ||
eventTime | Mandatory | - | Date and time of the event, in ISO 8601. |
deviceId | Mandatory | string | Identifier of the directly connected device that connected/disconnected. |
hubName | Mandatory | string | Name of the IoT hub to which the device is connected. |
tenantId | Mandatory | string | Representation of an organization. |
id | Mandatory | string | Unique identifier for event flow. |
# Payload
No payload is required.
# Feature Functionality
- Provides the status of the device/Edge connection and any connection state change.
- Connect/Disconnect event is available to be subscribed by the application via the Data Access API.
- Device status reporting is applicable only to directly connected devices.
# Use Cases
This added feature was developed with two use cases in mind:
It may be used for determining the online/offline status of devices in fleet monitoring environments. If a device is offline, this alerts the user that the device requires support/maintenance.
In the future, this feature might be used for machine learning.
# Benefits
- An event status snapshot is taken once every minute, allowing status monitoring of connect/disconnect states that occur from one snapshot to the next.
# Limitations
If the device connection is flickering, which means the device connects and disconnects frequently, the feature will not send every single connection state, but will publish the connection state present when a snapshot is taken. In case of an IoT Hub outage, the feature will publish the device connection state as soon as the outage is over. If the device disconnects during the outage, a device disconnected event will be published within 10 minutes.
According to Microsoft, the one minute snapshot is hard coded and cannot be changed.
This feature does not guarantee sequential ordering of events; however, due to the one minute interval, it is unlikely for messages to be sent out of sequence.
NOTE
Sequential transport of events cannot be guaranteed by the IoT hub (nor therefore by this solution). The user can sequence event messages using eventTime (see Common Headers, above).
# Audit Logging
Abb.Ability.Device.Connected
and Abb.Ability.Device.Disconnected
platform
events are also logged in the Audit Log.