This page describes how to use the reporting engine within the IoT Bridge to visualize and organize data within the IoT Bridge. Reporting is a powerful tool within the IoT Bridge to collect data from devices and provide simple, yet effective dashboards showing the health of your devices.
Here are some ideas for information you may wish to collect in reports.
A report is a living list of entries
that have one or more fields
that contain values that can be either a string
, number
, or timestamp
. A report can have one or more aggregations
to analyze and roll up data from fields
to provide a visual representation of the data.
Report entries are the rows
in a report, typically each row will represent a device. Entries are visible on the Report details
view.
Fields represent the columns of data associated with each Entry (row). Only the latest value for each field is stored in the report, publishing the Field multiple times for the same Entry will overwrite previous values.
Aggregations are summaries of the Field data from Entries. There are two main aggregation types available: terms
and range
. Aggregations can optionally by pivoted on string Fields providing another dimension to the report.
Assume that we have a report with temperature
and customer
fields on each entry. Performing a simple range
aggregation on the temperature
field, it would provide an aggregation like this:
If we add a pivot on the customer
field, the aggregation will now look like:
As you can see, it is quick and easy to build out useful and complex reports related to your devices in the field.
The report dialog allows you to create and edit reports by managing the fields and aggregations
report.publish()
.number
, string
, and timestamp
.string
.range
which creates buckets to count entries based on a number
field and terms
to count entries based on unique string
fields.range
then you must specify the range buckets for the aggregation.
from
and to
value are evaluated inclusive of the from
value and exclusive of the to
value. Ranges can overlap, and you may omit the from
or the to
, but not both.Reports get their data from triggers invoking the report.publish()
function.
// publish fields 'temperature' and 'humidity' for the device
report.publish('env_report', event.endpoint.key, event.ts, { values: { temperature: 26.5, humidity: 53}})
// publish fields and set the name for the entry in the report
report.publish('env_report', event.endpoint.key, event.ts, { name: 'my device', values: { temperature: 26.5, humidity: 53}})
// publish location with entry
report.publish('env_report', event.endpoint.key, event.ts, { location: {lat: -45.23, lon: 80.123}, values: { temperature: 26.5, humidity: 53}})
report.get()
and report.aggregates()
The following events are considered billable:
report.publish()