Difficulty: expert
Content
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.
The sensor vendor needs to comply with the Spacewell webhook, supported data types & payload.
Within 1 vendor ID, sensor IDs need to be unique and prepended with the vendor ID.
Combining device IDs from multiple third parties in 1 External Data Source, raises the potential risk of conflicts.
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:
Comfort related data types:
Indoor Air Quality related data types:
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
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
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 code with 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>
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).
Within 1 vendor ID, sensor IDs need to be unique and prepended with the vendor ID.
Combining device IDs from multiple third parties in 1 External Data Source, raises the potential risk of conflicts.
* 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
FAQ
Troubleshooting
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