Help

Introduction

Sensorbis is a system to acquire, store, visualize and export telemetry of Internet-connected devices.

System architecture

The system is composed of

  • a cloud infrastructure that acquires and stores the telemetry
  • a web application to
    • visualize and export telemetry data
    • manage devices, sensors and channels
  • a programming interface (API) to manage devices, sensors and channels (for complex scenarios)
  • a component that sends notifications by email when a telemetry datum exceeds a configured threshold

The set of devices is grouped in a federation.
Each device has one or more sensors.
Each sensor has one or more data channels.
Sensors can have a special purpose (e.g. latitude and longitude channels used to define the device location).
Each federation can have one or more views to display the telemetry data and can be accessed by one or more users.
Devices, sensors and channels can be managed through the web application or through the API.
Older telemetry can be aggregated hourly to decrease the subscription cost. Each hourly aggregated datum contains the number, the sum and the average of the original values.

Web application

The web application manages sets of devices and shows their telemetry data.

Federations

A federation is a set of related devices.
It is the main entity of the system and it has associated subscriptions, users and views. A federation has a token used to call the provided programming interface (API) (see Management API).
The web application shows the list of federations you have access to.
By selecting a federation, you have access to the related devices, users and views.
You can create a federation by activating a new subscription.
You can also join an existing federation if invited by another user.

Structure

The structure section shows devices, sensors and channels of the selected federation in three columns in a hierarchical layout.
The checkmarks are used to select the channels to show on the view. If you change the selected channels, click the button Update to reflect the changes on the view.
By clicking on an item name, you can select the sub-items contained in it.
By selecting the cog icon, you can edit an item.

Subscriptions

The web application shows the list of your subscriptions and allows you to create new subscriptions.
A valid subscription is needed to create a federation.
A subscription defines

  • the contractual duration
  • the period of time the telemetry is stored, detailed and hourly aggregated
  • the maximum amount of telemetry data per hour
  • the maximum number of users of the web application

The subscription lasts for a whole number of months, where a month is always considered to be 31 days long.
A subscription can be renewed at the expiration.
Subscription parameters can be extended during its period of validity or when renewed.
A calculator helps to count the amount of telemetry data that will be sent by federation devices.

Users

Users can be associated to any number of federations. Users can have the following permissions set by the administrator of the federation

  • Administrator: user has full control
  • Modify: user can modify the federation devices
  • Download: user can download telemetry data

Users can join a federation if invited by an administrator of the federation.
Invitations are sent by email and can be accepted by clicking on a link inside the email.

Data visualization

Data are shown on customizable views.
Type of a view can be

  • Static chart
  • Real-time chart
  • Map
  • User-provided map/plan/image

By a selection interface with columns for devices, sensors and channels, you can choose the channels to show on a view.
Charts of a view can be grouped per device, per sensor or per measurement unit. Each chart shows a group.
Maps, plans and images show an info box per device to show its data and to open the related chart.
Charts may use hourly aggregated data when a single data point contains one or more hours of data.

Static chart

Each chart allows the visualization of

  • grouping (by sum or average on each channel) over a time interval (especially useful for large periods)
  • average or sum of data of more channels

Each chart allows positioning on a given period and zooming.
Several indicators are provided to be overlapped on the chart.

Real-time chart

Each chart is updated with low latency and displays data sliding as time goes by.
Each chart allows the visualization of

  • grouping (by sum or average on each channel) over a time interval (especially useful for large periods)
  • average or sum of data of more channels

Data are updated according to a time interval that can be modified by the user within given limits.

Map

If a device has fixed geographical coordinates set, or if it contains a geographical positioning sensor (such a GPS), data of each sensor can be displayed on a geographical map.
Positional data define the point at which the device is displayed (the point moves in case of location tracking).
In correspondence of the device, real-time data of one or more channels can be displayed, also as a separated chart.
Data are grouped (by sum or average on each channel) over a time interval equal or smaller than the visualization update interval. Such interval can be modified by the user within given limits.

User-provided map/plan/image

If a device has fixed geographical coordinates set, data of each sensor can be displayed on a custom map, plan or image (uploaded by the user).
Positional data define the point at which the device is displayed. Spatial coordinates are related to the map, plan or image provided.
In correspondence of the device, real-time data of one or more channels can be displayed, also as a separated chart.
Data are grouped (by sum or average on each channel) over a time interval equal or smaller than the visualization update interval. Such interval can be modified by the user within given limits.

Data export

Static charts can be exported as

  • chart image
  • HTML data file
  • comma-separated values (CSV) file

Management API

The provided programming interface (API) manages federations, devices, sensors and channels.
Operations for a federation can be accomplished by a federation manager (or a federation gateway), a special device that can communicate with the other devices and with the system.
The communication of this special device with the other devices is not covered by the system.
This special device needs a federation-level authentication token acquired through the federation form of the web application (it can later be changed by the device itself). This token has to be stored in the device (for example, inside its firmware).
Each other device has its own device-level token, acquired by the web application (in the device form) or by the federation manager and stored in the device (for example, inside its firmware) or communicated by the federation manager (this is not covered by the system).
Requests must be made using HTTPS protocol with POST method.
All the requests must contain the HTTP Basic Authentication header field filled with the token of the caller entity (replace text within the brackets):
Authorization: Basic <token>

The API service address is
https://services.sensorbis.cloud/V0100/Service.svc/rest    for the REST endpoint,
https://services.sensorbis.cloud/V0100/Service.svc/soap    for the SOAP endpoint.
https://services.sensorbis.cloud/V0100/Service.svc/mex    for the Metadata Exchange endpoint.

The address of its formal specification is
https://services.sensorbis.cloud/V0100/Service.svc?singleWsdl in WSDL,
https://services.sensorbis.cloud/V0100/Service.svc/rest/help in XSD.

A service client implementation in Javascript can be downloaded here: serviceClient.js

The methods of the service are described hereafter.

Methods

GetFederation

Returns a federation with its devices, sensors and channels.
This method cannot be called by a device.

Request

Request is empty. The federation id is inferred from the authentication token.

Response
ElementTypeRequiredDescription
errorintfalse
federationobjectfalse
idstring (13)true
namestring (1-50)true
descrstring (0-1000)false
devicesarrayfalse
idstring (13)true
vendorIdstring (0-100)false
customerIdstring (0-100)false
namestring (1-30)true
descrstring (0-1000)false
timeZoneintfalse
usesDstbooleanfalse
londoublefalse
latdoublefalse
uristring (unspecified length)false
authorizationstring (unspecified length)true
notificationUristring (0-1000)false
notificationsMinIntervalintfalsein seconds; min. 600
tokenstring (unspecified length)false
sensorsarrayfalse
idstring (13)true
customerIdstring (0-100)false
namestring (1-30)true
descrstring (0-1000)false
channelsarrayfalse
idstring (13)true
communicationIdstring (1-32)true
namestring (1-30)true
enumeratedbooleantrue
unitstring (0-1000)false
mindoublefalse
maxdoublefalse
purposestring (0-10)false
groupingS (sum) or M (mean)true
thresholdOperator1string (0-3)false
thresholdValue1doublefalse
thresholdOperator2string (0-3)false
thresholdValue2doublefalse

CreateFederationToken

Returns the federation token.
This method cannot be called by a device.

Request
ElementTypeRequiredDescription
federationobjecttrue
idstring (13)true
Response
ElementTypeRequiredDescription
errorintfalse
tokenstring (unspecified length)false

AddDevices

Adds devices to a federation.

Request
ElementTypeRequiredDescription
federationobjecttrue
idstring (13)falseIt can be left null if the method is called by a federation manager
(it is inferred from the authentication token);
set it otherwise
devicesarray (max 10 elements)true
vendorIdstring (0-100)false
customerIdstring (0-100)false
namestring (1-30)true
descrstring (0-1000)false
timeZoneintfalse
usesDstbooleanfalse
londoublefalse
latdoublefalse
notificationUristring (0-1000)false
notificationsMinIntervalintfalsein seconds; min. 600
sensorsarray (max 10 elements)false
customerIdstring (0-100)false
namestring (1-30)true
descrstring (0-1000)false
channelsarray (max 10 elements)false
idstring (13)true
communicationIdstring (0-32)false
namestring (1-30)true
enumeratedbooleantrue
unitstring (0-1000)false
mindoublefalse
maxdoublefalse
purposestring (0-10)false
groupingS (sum) or M (mean)true
thresholdOperator1string (0-3)false
thresholdValue1doublefalse
thresholdOperator2string (0-3)false
thresholdValue2doublefalse
Response
ElementTypeRequiredDescription
errorintfalse
devicesarrayfalse
idstring (13)true
uristring (unspecified length)true
authorizationstring (unspecified length)true
needsNotificationUriVerificationbooleanfalsetrue if the notification Uri needs a verification (e.g. a new email address) and the verification has not yet been provided
sensorsarrayfalse
idstring (13)true
channelsarrayfalse
idstring (13)true

GetDevice

Returns a device.

Request
ElementTypeRequiredDescription
deviceobjecttrue
idstring (13)falseIt can be left null if the method is called by a device
(it is inferred from the authentication token);
set it otherwise
Response
ElementTypeRequiredDescription
errorintfalse
deviceobjectfalse
idstring (13)true
vendorIdstring (0-100)false
customerIdstring (0-100)false
namestring (1-30)true
descrstring (0-1000)false
timeZoneintfalse
usesDstbooleanfalse
londoublefalse
latdoublefalse
uristring (unspecified length)false
authorizationstring (unspecified length)true
notificationUristring (0-1000)false
notificationsMinIntervalintfalsein seconds; min. 600
sensorsarrayfalse
idstring (13)true
customerIdstring (0-100)false
namestring (1-30)true
descrstring (0-1000)false
channelsarrayfalse
idstring (13)true
communicationIdstring (1-32)true
namestring (1-30)true
enumeratedbooleantrue
unitstring (0-1000)false
mindoublefalse
maxdoublefalse
purposestring (0-10)false
groupingS (sum) or M (mean)true
thresholdOperator1string (0-3)false
thresholdValue1doublefalse
thresholdOperator2string (0-3)false
thresholdValue2doublefalse

ModifyDevice

Modifies a device.

Request
ElementTypeRequiredDescription
deviceobjecttrue
idstring (13)true
vendorIdstring (0-100)false
customerIdstring (0-100)false
namestring (1-30)true
descrstring (0-1000)false
timeZoneintfalse
usesDstbooleanfalse
londoublefalse
latdoublefalse
notificationUristring (0-1000)true
notificationsMinIntervalintfalsein seconds; min. 600
Response
ElementTypeRequiredDescription
errorintfalse
needsNotificationUriVerificationbooleanfalsetrue if the notification Uri needs a verification (e.g. a new email address) and the verification has not yet been provided

DeleteDevice

Deletes a device.

Request
ElementTypeRequiredDescription
deviceobjecttrue
idstring (13)true
Response
ElementTypeRequiredDescription
errorintfalse

CreateDeviceToken

Returns the device token.

Request
ElementTypeRequiredDescription
deviceobjecttrue
idstring (13)true
Response
ElementTypeRequiredDescription
errorintfalse
tokenstring (unspecified length)false

AddSensors

Adds sensors to a device.

Request
ElementTypeRequiredDescription
deviceobjecttrue
idstring (13)falseIt can be left null if the method is called by a device
(it is inferred from the authentication token);
set it otherwise
sensorsarray (max 10 elements)true
customerIdstring (0-100)false
namestring (1-30)true
descrstring (0-1000)false
channelsarray (max 10 elements)false
communicationIdstring (0-32)false
namestring (1-30)true
enumeratedbooleantrue
unitstring (0-1000)false
mindoublefalse
maxdoublefalse
purposestring (0-10)false
groupingS (sum) or M (mean)true
thresholdOperator1string (0-3)false
thresholdValue1doublefalse
thresholdOperator2string (0-3)false
thresholdValue2doublefalse
Response
ElementTypeRequiredDescription
errorintfalse
sensorsarrayfalse
idstring (13)true
channelsarrayfalse
idstring (13)true

ModifySensor

Modifies a sensor.

Request
ElementTypeRequiredDescription
sensorobjecttrue
idstring (13)true
customerIdstring (0-100)false
namestring (1-30)true
descrstring (0-1000)false
Response
ElementTypeRequiredDescription
errorintfalse

DeleteSensor

Deletes a sensor.

Request
ElementTypeRequiredDescription
sensorobjecttrue
idstring (13)true
Response
ElementTypeRequiredDescription
errorintfalse

AddChannels

Adds channels to a sensor.

Request
ElementTypeRequiredDescription
sensorobjecttrue
idstring (13)true
channelsarray (max 10 elements)true
communicationIdstring (0-32)falseIf left empty, it has the value of the returned id.
namestring (1-30)true
enumeratedbooleantrue
unitstring (0-1000)false
mindoublefalse
maxdoublefalse
purposestring (0-10)false
groupingS (sum) or M (mean)true
thresholdOperator1string (0-3)falseSee note
thresholdValue1doublefalseSee note
thresholdOperator2string (0-3)falseSee note
thresholdValue2doublefalseSee note

Note: If both the threshold values are used, they must define a range of normality (e.g. the threshold condition "< 0 or > 10" defines a normality range from 0 to 10).

Response
ElementTypeRequiredDescription
errorintfalse
channelsarrayfalse
idstring (13)true

ModifyChannel

Modifies a channel.

Request
ElementTypeRequiredDescription
channelobjecttrue
idstring (13)true
communicationIdstring (0-32)falseIf left empty, it has the same value of the id.
namestring (1-30)true
enumeratedbooleantrue
unitstring (0-1000)false
mindoublefalse
maxdoublefalse
purposestring (0-10)false
groupingS (sum) or M (mean)true
thresholdOperator1string (0-3)falseSee note
thresholdValue1doublefalseSee note
thresholdOperator2string (0-3)falseSee note
thresholdValue2doublefalseSee note
Note: If both the threshold values are used, they must define a range of normality (e.g. the threshold condition "< 0 or > 10" defines a normality range from 0 to 10).
Response
ElementTypeRequiredDescription
errorintfalse

DeleteChannel

Deletes a channel.

Request
ElementTypeRequiredDescription
channelobjecttrue
idstring (13)true
Response
ElementTypeRequiredDescription
errorintfalse

Error codes

List of the error codes that can be returned by the API service.
Each error code has a corresponding HTTP status code returned.

Error codeHTTP status codeDescription
<none>200 (Ok)Ok
10400 (Bad request)Bad request
20401 (Unauthorized)Authentication failed
25401 (Unauthorized)Session expired
30403 (Forbidden)Missing subscription (never created or expired)
100404 (NotFound)Federation inexistent
110404 (NotFound)Device inexistent
120404 (NotFound)Sensor inexistent
130404 (NotFound)Channel inexistent
140403 (Forbidden)Invalid characters in channel communicationId
142403 (Forbidden)Duplicate channel communicationId for its device
999500 (Internal server error)Unspecified error

Devices data

Requirements

Devices must be capable to:
  • send data over a HTTPS connection;
  • store the data destination uri and the authorization string (or get them from federation gateway, but this is not covered by the system)
The destination uri is never changed (unless the device is recreated, therefore obtaining a different id).
The authorization string can be changed using the web application but it is not required.
Since the destination uri and the authorization string are not required to be modifiable, they can be stored permanently, even in the firmware.

Data sending

Devices send data (usually called "telemetry") by a HTTPS communication using the POST method.
Devices must send an authorization string in the packet header. The authorization string and the destination uri can be found in the device editor form of the web application or they can be retrieved by all the programming interface (API) methods that return a device in the response.
A data packet has the following format (replace text within the brackets):

POST <destination uri>
Authorization: <authorization string>
Content-Type: application/json;charset=utf-8
Content-Length: <JSON payload length>

<JSON payload>

JSON payload is an object in JSON format with the following structure:

{
"t":<timestamp>,
"c":
[
{
"i":<channel communication id>,
"v":<value>
}
... (max. 100 array items)
]
}

Every timestamp will be stored as sent, without any assumption about timezone or daylight saving time. Timestamp is optional. If omitted, the current time in UTC (i.e. without a time zone offset) is used.
Timestamp of devices in a federation should refer to a common time zone and daylight saving time. If some devices of the federation don't send the measurements' time, we recommend using the UTC time for the devices that send the timestamp.
If the devices in a federation are not in the same time zone and daylight saving time, again, we recommend using the UTC time.
Instead, if all the devices are in the same time zone and daylight saving time, you can use the UTC time or the local time zone.
The federation time zone can be set in the federation properties of the web application. This allows any user to correctly display timestamps in his own preferred time zone.
Timestamps should not be older than the effective upload date/time for more than 48 hours otherwise the related values could be missing in hourly aggregated data.
Timestamps are expressed as the number of milliseconds since January 1, 1970, 00:00:00 UTC.
A value is a 64-bit number ranging approximately from ±5.0 × 10324 to ±1.7 × 10308 with 15-16 digits of precision, conforming to IEEE Standard for Floating-Point Arithmetic (IEEE 754).
For data aggregation purposes, it is required that the sum of all or part of the values sent in the same hour for each channel falls within the range of a 64-bit number as defined above.
The channel communication id can be found in the channel editor form of the web application or it can be retrieved by all the API methods that return a channel in the response.
Your subscription defines the maximum amount of data that can be sent per hour. If this limit is exceeded, acquisition of data from federation devices can be temporary suspended (i.e. all data sent will be temporary discarded) without any notice. Severe or repeated breaches could lead to the termination of the agreement.

Test tools

Free test tools are provided to ease the sending of telemetry data.

Test device for Android

You can use the Android app Sensorbis Test Device to simulate a device.
Follow the help contained in the application to send telemetry data.
You can download it from the Google Play Store.

Get it on Google Play
Google Play and the Google Play logo are trademarks of Google LLC.

Test device for Windows

You can use the Windows application TestDevice to simulate a device.
Follow the help contained in the application to send telemetry data.
The Microsoft .Net Framework 4.0 or above is necessary to execute the application. It is usually installed on computers running Microsoft Windows 7 SP1 or above.
Download TestDevice application You must be logged in to download the application.

Threshold notifications

Sensorbis sends notifications by email when a configured threshold is exceeded.
For each channel you may set a threshold as a single value or as a range of values, using the logical comparison operators =, <>, <, <=, > and >=.
For each device you may set a notification email address and a minimum interval between notifications for the same channel.
The system asks for a verification of the notification email address to prevent abuse.
Your subscription contains the limit of notification emails that can be sent per day.
The email notifications may be processed and sent up to 10 minutes after the threshold is exceeded and there is no way to guarantee success and promptness of email deliveries.
If more values exceed the threshold within the aforesaid processing period, any of them may be returned in the notification email.
Values for notifications are considered only if their date/time (property t) is between 2 days before and 2 days after the UTC date/time of the moment the value is stored.
To check if the subscription daily limit for notifications is reached, UTC time is considered.