Device events
Device events are reported when an event occurs on the device. The device manager reports this event as a message that will be collected by the routing service, which forwards it to the consumer. Business applications can use the listening channels (HTTP REST, MQTT client and Webhook) in order to have them.
Device created event
The deviceCreated events are generated by the Live Objects device manager when a device is provisioned.
These events are notifications and are not aimed at giving full provisioning details about the device. To retrieve the details about the device, you should use the Device Management Inventory REST API.
The deviceCreated notification is useful, for example, when devices are auto-provisioned in Live Objects (see MQTT devices and external connector mode).
The consumption of this event used with the Device Management REST API allow you to update your own business application database for example.
|
If you are not familiar with the device representation and device management in Live Objects, see Device inventory section. |
The event is a JSON object. Please find below a description of its fields.
| Field | Description |
|---|---|
type |
deviceCreated. This field is set by Live Objects in the routed event. |
version |
Version number. See the existing versions in the summary. |
deviceId |
Device identifier. |
timestamp |
Timestamp for the routing event. |
{
"type":"deviceCreated",
"version":1,
"deviceId":"urn:lo:nsid:mqtt:1234",
"timestamp":"2019-09-05T09:50:00.394Z"
}
Device deleted event
The deviceDeleted events are generated by the Live Objects device manager when a device is deleted.
These events are notifications and are not aimed at giving full provisioning details about the device. To retrieve the details about the device, you should use the Device Management Inventory REST API.
The consumption of this event used with the Device Management REST API allow you to update your own business application database for example.
|
If you are not familiar with the device representation and device management in Live Objects, see Device inventory section. |
The event is a JSON object. Please find below a description of its fields.
| Field | Description |
|---|---|
type |
deviceDeleted. This field is set by Live Objects in the routed event. |
version |
Version number. See the existing versions in the summary. |
deviceId |
Device identifier. |
timestamp |
Timestamp for the routing event. |
{
"type":"deviceDeleted",
"version":1,
"deviceId":"urn:lo:nsid:mqtt:1234",
"timestamp":"2019-09-05T09:55:00.004Z"
}
Device status event
This event is generated by Live Objects when a device interface’s status is changing. Examples :
-
When a LwM2M device recently created connects to Live Objects for the first time, a device status event is generated with the previous status : REGISTERED and the current status : ONLINE
-
When a MQTT device is disconnected, a device status event is generated with the previous status : ONLINE and the current status : OFFLINE
-
When the first JOIN REQUEST is received from a recently created LoRa device, a device status event is generated with the previous status : REGISTERED and the current status : INITIALIZING
This event is internally used by the device manager to update its connectors database. Also, it’s possible to route this event using Triggers and Actions feature. By doing this, a business application can listen and process this event.
| Please refer to the Connectivity section for the description of device status state machines on each connectivity (LwM2M, MQTT, LoRa, …). And to the interface status section for a summary of the supported device status. |
The device status event is a JSON object. Please find below a description of its fields.
| Field | Description |
|---|---|
type |
deviceStatus. This field is set by Live Objects in the routed event. |
version |
Version number. See the existing versions in the summary. |
deviceId |
Device identifier. |
updatedInterface |
Information about the interface. In status sub-section, information about the status of the interface with the previous and current state. |
timestamp |
Timestamp for the routing event. |
{
"type":"deviceStatus",
"version":1,
"deviceId":"urn:lo:nsid:mqtt:1234",
"updatedInterface":{
"connector":"mqtt",
"nodeId":"1234",
"enabled":true,
"status":{
"current":"ONLINE",
"previous":"OFFLINE"
}
},
"timestamp":"2019-09-05T09:50:00.394Z"
}
| Please refer to a global overview of supported event occurred on the interfaces of each connector, see Interface section. |