Events#

IoT devices often trigger events. An event is a significant change in the state of a device or its environment. As an example, there could be a machine that is monitored by an IoT device using multiple sensors. An event is triggered by an unusual combination of sensor readings. It is important to aggregate several states into a single event, so an application in the cloud can analyze the event in detail to know the environmental conditions at that moment.

The database model defines the Events table that represents events generated by endpoints.

Events via Composite Observe#

In order to group multiple resources together in an unambiguous way, LwM2M composite resources are used. Once a composite resource is updated in the IoT device (endpoint), Leshan generates a composite event with all values of the composite resource. Django deserializes the event, stores its individual resources in the database and creates a new event. The individual resources within the event may haveindividual timestamps, the event itself has a separate timestamp in addition.

Note

Currently Observe interactions are handled in Leshan at LwM2M Observe.