The device server exposes a notification subscription service via its REST API and returns event triggered notifications via HTTP POST request to a supplied web hook URL. To get the most from this document you'll need to be familiar with basics of the device server REST API - see Introduction to the device server REST API.
Another way manage observations is by using the - developer console.
Which events can be observed?
Observable events fall into three categories:
- Client connects
- Client disconnects
- Client details are updated
- Client connection expires or times out
- New object instantiated
- Object instance resource changes
3.Resource value events
- Resource value changes
Subscribers to the above events will recieve a notification each time the event
occurs until such time that the subscription is cancelled.
A typical client event notification identifies the client, the time of the event, and the type of event that has occurred:
Setting up an Observation Subscription
Using the developer console, on the left sidebar navigate to Subscriptions.
On the top right corner press SUBSCRIPTION +, and a Client event subscription will pop-up. Select the events you want to subscribe and enter the webhook URL where you want notifications to be sent.
Note: The webhook URL is defined on your application or system.
Setting up a Resource Observation Subscription
On devices section is retreived a list with all the Awa LWM2M Clients connected to the device server.
If you click on a device and it will be displayed it's object id and instances
(temperature in this example) It is possible to navigate into details.
Manage Subscriptions - View and Delete
The subscription section shows a list of current subscriptions. The image
bellow shows the event subscription and an exaple of webhook URL.
The little rubish bin icon allows to delete subscriptions.