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
Element | Type | Required | Description |
---|---|---|---|
error | int | false | |
federation | object | false | |
id | string (13) | true | |
name | string (1-50) | true | |
descr | string (0-1000) | false | |
devices | array | false | |
id | string (13) | true | |
vendorId | string (0-100) | false | |
customerId | string (0-100) | false | |
name | string (1-30) | true | |
descr | string (0-1000) | false | |
timeZone | int | false | |
usesDst | boolean | false | |
lon | double | false | |
lat | double | false | |
uri | string (unspecified length) | false | |
authorization | string (unspecified length) | true | |
notificationUri | string (0-1000) | false | |
notificationsMinInterval | int | false | in seconds; min. 600 |
token | string (unspecified length) | false | |
sensors | array | false | |
id | string (13) | true | |
customerId | string (0-100) | false | |
name | string (1-30) | true | |
descr | string (0-1000) | false | |
channels | array | false | |
id | string (13) | true | |
communicationId | string (1-32) | true | |
name | string (1-30) | true | |
enumerated | boolean | true | |
unit | string (0-1000) | false | |
min | double | false | |
max | double | false | |
purpose | string (0-10) | false | |
grouping | S (sum) or M (mean) | true | |
thresholdOperator1 | string (0-3) | false | |
thresholdValue1 | double | false | |
thresholdOperator2 | string (0-3) | false | |
thresholdValue2 | double | false |
CreateFederationToken
Returns the federation token.
This method cannot be called by a device.
Request
Element | Type | Required | Description |
---|---|---|---|
federation | object | true | |
id | string (13) | true |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false | |
token | string (unspecified length) | false |
AddDevices
Adds devices to a federation.
Request
Element | Type | Required | Description |
---|---|---|---|
federation | object | true | |
id | string (13) | false | It can be left null if the method is called by a federation manager (it is inferred from the authentication token); set it otherwise |
devices | array (max 10 elements) | true | |
vendorId | string (0-100) | false | |
customerId | string (0-100) | false | |
name | string (1-30) | true | |
descr | string (0-1000) | false | |
timeZone | int | false | |
usesDst | boolean | false | |
lon | double | false | |
lat | double | false | |
notificationUri | string (0-1000) | false | |
notificationsMinInterval | int | false | in seconds; min. 600 |
sensors | array (max 10 elements) | false | |
customerId | string (0-100) | false | |
name | string (1-30) | true | |
descr | string (0-1000) | false | |
channels | array (max 10 elements) | false | |
id | string (13) | true | |
communicationId | string (0-32) | false | |
name | string (1-30) | true | |
enumerated | boolean | true | |
unit | string (0-1000) | false | |
min | double | false | |
max | double | false | |
purpose | string (0-10) | false | |
grouping | S (sum) or M (mean) | true | |
thresholdOperator1 | string (0-3) | false | |
thresholdValue1 | double | false | |
thresholdOperator2 | string (0-3) | false | |
thresholdValue2 | double | false |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false | |
devices | array | false | |
id | string (13) | true | |
uri | string (unspecified length) | true | |
authorization | string (unspecified length) | true | |
needsNotificationUriVerification | boolean | false | true if the notification Uri needs a verification (e.g. a new email address) and the verification has not yet been provided |
sensors | array | false | |
id | string (13) | true | |
channels | array | false | |
id | string (13) | true |
GetDevice
Returns a device.
Request
Element | Type | Required | Description |
---|---|---|---|
device | object | true | |
id | string (13) | false | It can be left null if the method is called by a device (it is inferred from the authentication token); set it otherwise |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false | |
device | object | false | |
id | string (13) | true | |
vendorId | string (0-100) | false | |
customerId | string (0-100) | false | |
name | string (1-30) | true | |
descr | string (0-1000) | false | |
timeZone | int | false | |
usesDst | boolean | false | |
lon | double | false | |
lat | double | false | |
uri | string (unspecified length) | false | |
authorization | string (unspecified length) | true | |
notificationUri | string (0-1000) | false | |
notificationsMinInterval | int | false | in seconds; min. 600 |
sensors | array | false | |
id | string (13) | true | |
customerId | string (0-100) | false | |
name | string (1-30) | true | |
descr | string (0-1000) | false | |
channels | array | false | |
id | string (13) | true | |
communicationId | string (1-32) | true | |
name | string (1-30) | true | |
enumerated | boolean | true | |
unit | string (0-1000) | false | |
min | double | false | |
max | double | false | |
purpose | string (0-10) | false | |
grouping | S (sum) or M (mean) | true | |
thresholdOperator1 | string (0-3) | false | |
thresholdValue1 | double | false | |
thresholdOperator2 | string (0-3) | false | |
thresholdValue2 | double | false |
ModifyDevice
Modifies a device.
Request
Element | Type | Required | Description |
---|---|---|---|
device | object | true | |
id | string (13) | true | |
vendorId | string (0-100) | false | |
customerId | string (0-100) | false | |
name | string (1-30) | true | |
descr | string (0-1000) | false | |
timeZone | int | false | |
usesDst | boolean | false | |
lon | double | false | |
lat | double | false | |
notificationUri | string (0-1000) | true | |
notificationsMinInterval | int | false | in seconds; min. 600 |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false | |
needsNotificationUriVerification | boolean | false | true 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
Element | Type | Required | Description |
---|---|---|---|
device | object | true | |
id | string (13) | true |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false |
CreateDeviceToken
Returns the device token.
Request
Element | Type | Required | Description |
---|---|---|---|
device | object | true | |
id | string (13) | true |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false | |
token | string (unspecified length) | false |
AddSensors
Adds sensors to a device.
Request
Element | Type | Required | Description |
---|---|---|---|
device | object | true | |
id | string (13) | false | It can be left null if the method is called by a device (it is inferred from the authentication token); set it otherwise |
sensors | array (max 10 elements) | true | |
customerId | string (0-100) | false | |
name | string (1-30) | true | |
descr | string (0-1000) | false | |
channels | array (max 10 elements) | false | |
communicationId | string (0-32) | false | |
name | string (1-30) | true | |
enumerated | boolean | true | |
unit | string (0-1000) | false | |
min | double | false | |
max | double | false | |
purpose | string (0-10) | false | |
grouping | S (sum) or M (mean) | true | |
thresholdOperator1 | string (0-3) | false | |
thresholdValue1 | double | false | |
thresholdOperator2 | string (0-3) | false | |
thresholdValue2 | double | false |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false | |
sensors | array | false | |
id | string (13) | true | |
channels | array | false | |
id | string (13) | true |
ModifySensor
Modifies a sensor.
Request
Element | Type | Required | Description |
---|---|---|---|
sensor | object | true | |
id | string (13) | true | |
customerId | string (0-100) | false | |
name | string (1-30) | true | |
descr | string (0-1000) | false |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false |
DeleteSensor
Deletes a sensor.
Request
Element | Type | Required | Description |
---|---|---|---|
sensor | object | true | |
id | string (13) | true |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false |
AddChannels
Adds channels to a sensor.
Request
Element | Type | Required | Description |
---|---|---|---|
sensor | object | true | |
id | string (13) | true | |
channels | array (max 10 elements) | true | |
communicationId | string (0-32) | false | If left empty, it has the value of the returned id. |
name | string (1-30) | true | |
enumerated | boolean | true | |
unit | string (0-1000) | false | |
min | double | false | |
max | double | false | |
purpose | string (0-10) | false | |
grouping | S (sum) or M (mean) | true | |
thresholdOperator1 | string (0-3) | false | See note |
thresholdValue1 | double | false | See note |
thresholdOperator2 | string (0-3) | false | See note |
thresholdValue2 | double | false | See 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
Element | Type | Required | Description |
---|---|---|---|
error | int | false | |
channels | array | false | |
id | string (13) | true |
ModifyChannel
Modifies a channel.
Request
Element | Type | Required | Description |
---|---|---|---|
channel | object | true | |
id | string (13) | true | |
communicationId | string (0-32) | false | If left empty, it has the same value of the id. |
name | string (1-30) | true | |
enumerated | boolean | true | |
unit | string (0-1000) | false | |
min | double | false | |
max | double | false | |
purpose | string (0-10) | false | |
grouping | S (sum) or M (mean) | true | |
thresholdOperator1 | string (0-3) | false | See note |
thresholdValue1 | double | false | See note |
thresholdOperator2 | string (0-3) | false | See note |
thresholdValue2 | double | false | See note |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false |
DeleteChannel
Deletes a channel.
Request
Element | Type | Required | Description |
---|---|---|---|
channel | object | true | |
id | string (13) | true |
Response
Element | Type | Required | Description |
---|---|---|---|
error | int | false |
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 code | HTTP status code | Description |
---|---|---|
<none> | 200 (Ok) | Ok |
10 | 400 (Bad request) | Bad request |
20 | 401 (Unauthorized) | Authentication failed |
25 | 401 (Unauthorized) | Session expired |
30 | 403 (Forbidden) | Missing subscription (never created or expired) |
100 | 404 (NotFound) | Federation inexistent |
110 | 404 (NotFound) | Device inexistent |
120 | 404 (NotFound) | Sensor inexistent |
130 | 404 (NotFound) | Channel inexistent |
140 | 403 (Forbidden) | Invalid characters in channel communicationId |
142 | 403 (Forbidden) | Duplicate channel communicationId for its device |
999 | 500 (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 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.
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.