Data aggregation

If you’re trying to trace all the events from a device, it would be easier to use the SmartApp SDK as you can run it locally or host it and perform actions in Databases from there.
You can create subscriptions by component or capability. There are also subscriptions to the location modes and devices health (see the endpoint’s document and functions).
When the subscription event is received on its handler, you could send that information to your dataset.