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.
Info
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
- Configure devices on Workplace platform
- 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
For all data types, it makes sense to verify if data will be send regularly or not; see https://onespacewell.atlassian.net/wiki/spaces/KB/pages/4357488644/External+Data+Sources#FAQ
Space occupancy related data types:
If your headcount device is able to track multiple count areas, you can send us the data of the individual count areas by replacing "<unique_device_id>" through "<unique_area_id>".
* The smallest time unit accepted by Workplace platform are seconds. Payload messages should not contain any milliseconds data
** Depending on the reliability of the sensor, space occupancy data may only contain data confirming “movement” (presence, headcount, footfall in one or the other direction etc), not the absence of movement… To tackle this in the Workplace platform, a decay feature has been introduced, which allows to visualize occupancy/headcount on the live (end user facing) floor plans for longer than what the data really tells us.
For an example on how Decay works, see Motion sensor
For a potential solution for data gaps in the dashboards (copy data in time slots), see https://onespacewell.atlassian.net/wiki/spaces/KB/pages/4357488644/External+Data+Sources#FAQ
Comfort related data types:
* The smallest time unit accepted by Workplace platform are seconds. Payload messages should not contain any milliseconds data
Indoor Air Quality related data types:
* The smallest time unit accepted by Workplace platform are seconds. Payload messages should not contain any milliseconds data
Battery related data types:
* The smallest time unit accepted by Workplace platform are seconds. Payload messages should not contain any milliseconds data
Info
Best practice is to test this in a sandbox environment locally first
Configure the connection between External Data Source and Workplace
How to access
- Go to https://studio.cobundu.com/
- Login with your credentials
- Select Integrations > External Data Sources
- 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
Once the webhook is created in the 3rd party database with above provided URL and token, make sure to test the connection.
This step is to be performed by the party that wants to send data to Spacewell Workplace.
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.
200 code confirms that Workplace is receiving a message in JSON format, but does not validate that we can read/unpack the message. Check below chapter “Troubleshooting” in case of doubts.
Next steps
To create custom Device Types and configure your third party sensors in Workplace, see Custom Device Types
FAQ
Reach out to your Account Manager to set this up.
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.