Difficulty: expert
Content
Table of Contents | ||||
---|---|---|---|---|
|
Learning Objectives
After reading this article, you’ll be able to:
Identify which Generic Endpoints data types are supported by Spacewell WorkplaceManage a project to set up Generic Endpoints
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.
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:
EU: <https://bohemian.eu1.cloud.cobundu.com/generic/<sensor_vendor>/data>
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. |
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>
US: <https://bohemian.us1.cloud.cobundu.com/generic/<sensor_vendor>/data>
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 | |||||
---|---|---|---|---|---|
| |||||
|
How it works
The sensor vendor needs to comply with the Spacewell webhook, which means a joint project between Spacewell, the customer and the 3rd party sensor provider.
Spacewell will first create a vendor ID, which is descriptive and unique, as a Generic Endpoint. Usually, it refers to a tenant ID, or it can refer to the name of a sensor platform.
Within 1 vendor ID, sensor IDs need to be unique and prepended with the vendor ID.
So if you're thinking of combining device IDs from multiple third parties in 1 Generic Endpoint, there could be a potential risk of conflicts.
Copy Data in time slots
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.
This also means that we will only see in Workplace if a sensor is NOT transmitting data after the configured time has expired (in previous example: after 7 days).
Project steps
The following chapter describes step by step how to set up a generic endpoint and sensor data stream.
Prerequisites: We assume that this is part of an existing collaboration, where a tenant and locations are already set up.
Step 1 - Project start-up
Expand | ||
---|---|---|
| ||
Reach out to your Spacewell Account Manager to inform us about this new API-project. Include following information:
|
Expand | ||
---|---|---|
| ||
In a Kickoff meeting with the stakeholders from all 3 parties, the goal of the project and next steps are discussed. |
Expand | ||
---|---|---|
| ||
Make sure the master data (buildings, floors, locations) are already uploaded. |
Expand | ||||||
---|---|---|---|---|---|---|
| ||||||
Send the API documentation to the sensor provider. In the document, you'll see that there is a placeholder for the <sensor vendor> URL and for the bearer <token>. Let the 3rd party know what their specific URL and token are based on the information you receive from the Spacewell team.
|
Step 2 - Make sure all questions are resolved
Expand | ||
---|---|---|
| ||
Any questions regarding the API document should be addressed to the Spacewell Implementation Consultant, who will take them up with Workplace Product Management. The Workplace Team might also have questions for the sensor provider and needs to provide the bearer token. |
Expand | ||
---|---|---|
| ||
Agreement from both parties on the tasks ahead. |
Step 3 - Development & testing
Expand | ||
---|---|---|
| ||
The sensor provider develops the link between their sensors and the Spacewell API using the provided documentation. The Customer stays involved by providing location master data if necessary. |
Expand | ||
---|---|---|
| ||
Activate some sensors and configure them in Studio to see if data is reaching the webhook. In case request is not successful, the endpoint returns 4xx-5xx status codes depending on the occurred issue. The requestor may want to store failed requests and try re-sending them later. In case of successful request, the endpoint returns 200 status code with an empty body. |
Step 4 - Sensor Installation & configuration
Expand | ||
---|---|---|
| ||
If not yet installed, sensors need to be installed according to 3rd party installation instructions. |
Expand | ||
---|---|---|
| ||
Make sure you have sensor IDs, Location master data, sensor plan (if available), and mapping between rooms and sensor IDs. From this step, you follow the normal setup process in Spacewell back-end Studio for configuring sensors. |
Expand | ||
---|---|---|
| ||
Please be aware that only after the next data package is send, data for this sensor will be visible in your tenant. (This means that depending on time of upload to Studio and activity at the customer site, this can take a while.) You can manually add a record via "Add New Device"
For more information on how to add multiple new devices to Studio, check out Configure devices (add, remove, import/export). |
Expand | ||
---|---|---|
| ||
Go to your environment and change the location ID for each Sensor in Sensor Management. |
Step 5 - Validation & acceptance
Expand | ||
---|---|---|
| ||
High level sub-steps:
|
title | Acceptance & Project Closure |
---|
Once the Project is implemented, make sure to finalize the project in an Acceptance Document.
View file | ||
---|---|---|
|
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
(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
Test your setup
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
Go to your environment (https://studio.cobundu.com ) and log in
Select the location, where you can 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: a "Device ID" prefix will be given by the Spacewell development team
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. |
Custom: Copy Data in time slots
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.
This also means that we will only see in Workplace if a sensor is NOT transmitting data after the configured time has expired (in previous example: after 7 days).
Reach out to your Account Manager to set this up.
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 |
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 |
---|