Difficulty: expert
Content
Table of Contents | ||||
---|---|---|---|---|
|
Learning Objectives
After reading this article, you’ll be able to:
Identify which data types are supported by Spacewell Workplace
Configure webhook & authorization token to connect your external data sources to Workplace
Suppose there are already sensors collecting data in the building and you want to include its data into the Workplace IOT platform. Spacewell provides a generic endpoint (using webhooks) for most of its sensor data types, to integrate, process and store sensor data from 3rd party platforms.
Expand | ||
---|---|---|
| ||
Since you’re on this page: looks like the sensors, that are in scope of sending data to the Workplace platform, are sending data to a platform or database that is not connected to Workplace. Working your way down this page, we’ll make sure that there is a connection set up between the platforms, that the data is send is a format that Workplace can work with and knows how to identify. Setting up External Data Sources and sending data from an external database to the Workplace platform can be compared to “A car arrives at a gate. The car is known to the gate keeper, and the person in the car has a badge, because he told his contact person up front that he was coming.”
Spacewell consultants that want to learn more about how Spacewell treats data that comes in, can check out /wiki/spaces/WM/pages/492237 |
The sensor vendor needs to comply with the Spacewell webhook, supported data types & payload.
Info |
---|
Within 1 vendor ID, sensor IDs need to be unique and prepended with the vendor ID. |
How to set up this connection?
Steps described on this page:
In the external (customer or 3rd party) database: Configure data payload
Configure the connection between External Data Source and Workplace
Go to database and fill in URL and token, make sure to test the connection
Devices send data to Workplace platform
Configure Data Payload
Webhooks
Webhooks provide a fast and secure way to reliably stream sensor data through from other systems.
The sensor provider is expected to post updates to the Spacewell endpoint.
The webhook endpoint expects a single HTTP request which represent a distinct message from the sensor.
The webhook URL:
HTTP method used: POST
HTTP headers:
Authorization: Bearer <token>
Content-Type: application/json
Supported data types & payload
Space occupancy related data types:
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Comfort related data types:
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Indoor Air Quality related data types:
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | ||
---|---|---|
| ||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Configure the connection between External Data Source and Workplace
How to access
Login with your credentials
Select Settings > External Data Sources in the Studio 2.0 interface
Select “Add New”
Tenant ID will be filled in based on the environment that you logged in to
Fill in Source ID with a unique name, referring to your external data source
Note |
---|
In Source ID field, only use alphanumeric values. The Source ID will later be used as a component of the device IDs. |
(Optional) Fill in a description, detailing what kind of data will come through the external data source
Copy the provided webhook URL + Authorization token to create the webhook in the external data source towards Spacewell Workplace
Make sure to enable your setup in Workplace
Info |
---|
It’s possible to refresh the Authorization Token in Studio. Remember that this new token now also needs to be updated in the 3rd party platform. |
Test your setup
Verify in a tool like Postman, if your setup works:
In case request is not successful, the endpoint returns 4xx-5xx status codes depending on the occurred issue.
In case of successful request, the endpoint returns 200 status code with an empty body.
Check below chapter “Troubleshooting” in case of doubts.
Configure the sensors in Workplace
Prerequisites for this step:
have the confirmation that the test was successful (endpoint returns 200 status codewith an empty body)
have the confirmation which data type will be used to convey the data
have the list of device IDs that will send data from the External Data Source to Workplace platform
Go to your environment (https://studio.cobundu.com ) and log in
Select the location, and manually add a sensor via "Add New Device"
Select the (most relevant) Device Type "Generic …” (eg for PIR: "Generic PIR") from the drop-down list. As per the chosen DeviceType, a default set of channels is enabled
If a device is able to gather data on a channel, that is not part of the DeviceTypes' default set of channels : it’s possible to manually add these in Advanced*
Fill in the Device ID, using the tenant ID and source ID available in Settings > External Data Sources. Adhere to the format <tenant_id>-<source_id>|<device_id>
Expand | ||
---|---|---|
| ||
for example
the Spacewell Device ID will be “spacewell-testgeneric|123" |
Give a meaningful name (eg customer_floor number_area) in Device Name.
Location will be filled in based on your pre-selection in the location tree
For more information on how to add multiple new devices to Studio, check out Configure devices (add, remove, import/export).
Info |
---|
Within 1 vendor ID, sensor IDs need to be unique and prepended with the vendor ID. |
* If a device is able to gather data on a channel, that is not part of the DeviceTypes' default set of channels : it’s possible to manually add these in Advanced
Select the relevant Sensor Type from the drop-down
Fill in the “channel” value as mentioned in the https://spacewell.atlassian.net/wiki/spaces/KB/pages/5242896/External+Data+Sources#Supported-data-types-%26-payload
Expand | ||
---|---|---|
| ||
In this example, we’re setting up a sensor that will provide data on footfall (sending data each time a person crosses a (virtual) line in one or in the other direction).
|
FAQ
Expand | ||
---|---|---|
| ||
Depending on the kind of sensor, they might not send heartbeats or data regularly. If they send data and then only send a message upon value change, you might find yourself with bits and pieces of data (eg 1 time slot of 15 minutes with data about temperature, and nothing the rest of the day), which would cause confusion when you try to read the dashboards. To work around this, you can opt to have us copy the data, per generic endpoint / device type level for any desired amount of time. For example for the sensor type "Generic PIR" we could set a "copy in further time slots" and this value would be valid for all Generic PIR sensor values, which come to us for your tenant. Of course, the data is only copied until new data comes in again. So if a value comes in on Monday at 9am, and the configuration says "copy for 7 days", and on Wednesday at 8am a new value comes in, then from Wednesday at 8am the new value is taken for 7 days, or until a new value comes in.
Reach out to your Account Manager to set this up. |
Expand | ||
---|---|---|
| ||
It's possible to re-use the external data source information (Authentication token + URL). So if devices have the same behavior, but are linked to different external data sources, it’s possible to only set up 1 endpoint in Studio, and have the 2 external data source send data to that same Workplace endpoint.
|
Troubleshooting
Expand | ||
---|---|---|
| ||
Make sure the following configuration is in place:
|
Expand | ||
---|---|---|
| ||
Make sure the following configuration is in place:
|
Expand | ||
---|---|---|
| ||
See “Legacy Generic End-Point Set-up” chapter below |
Expand | ||
---|---|---|
| ||
For security reasons: If a user logs in with a multi-tenant account, they are not able to make any changes to any external data sources. |
Legacy Generic End-Point Set-up
In the past, some external data sources were connected to Spacewell through a slightly different format. Because of that, there is a limitation only for the legacy / old generic endpoints:
The old / legacy Generic Endpoints will be shown in Studio with the label 'Created by Spacewell'
User will not be take actions (Refresh Authorization token, Enable / Disable will all be greyed out)
User can only View, and Copy URL / Authorization token.
To Enable / Disable or Refresh authorization token, reach out to your Account Manager.
Search
Live Search |
---|