DifficultyMoeilijkheidsgraad: expert
Inhoud
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.
title | External Data Sources for beginners - an analogy |
---|
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.”
We want the external platform to send data to Workplace, which is why we use webhook with HTTP method “post”. This means the data gets pushed by the other system, and Workplace will not have to pull it from somewhere.
By creating an External Data Source in the tenant, you create a door or gate towards the Workplace platform: the Webhook URL. You’ll also receive the code to open the gate: the Authorization Token. Providing this information to the owners of the database, they are now able to reach the door.
But they need to present us the data in a way that we can consume! So they need to adhere to some rules:
the data they send us must be meaningful: Workplace needs to be able to do something with that data (for example present them on a live floor plan or in a dashboard). So the External Data Source needs to provide the data in any of the 10+ supported data types.
it’s not enough that they would just throw some data at us. In order to correctly interpret that data, it needs to adhere to a specific (payload) format. In this way, we know which part of the information to interpret as the device ID, which part as the value we need to store in the Workplace database etc.
For Spacewell to know where we need to store the data in our database, the sensor needs to be known on our end, and linked to a location. This is why the device needs to be registered in Studio. To register the device in Workplace Platform, you need:
Device Type, which actually contains a preset of data types (per chosen DeviceType, a default set of channels is enabled).
Device ID, which needs to be unique.
In order to make this ID unique across all tenants, the device ID format includes the tenant ID
In order to make this ID unique within the tenant, the device ID format includes the External Data Source ID
Location information. If a sensor is not linked to a location, data is not stored in the Spacewell database.
|
Leerdoelen
Na het lezen van dit artikel zul je in staat zijn om:
Bepalen welke gegevenstypen worden ondersteund door Spacewell Workplace
Configureer webhook & autorisatietoken om uw externe gegevensbronnen met Workplace te verbinden
Stel dat er al sensoren zijn die gegevens verzamelen in het gebouw en u wilt deze gegevens opnemen in het Workplace IOT-platform. Spacewell biedt een generiek eindpunt (met webhooks) voor het grootste deel van zijn soorten sensorgegevensom sensorgegevens van platforms van derden te integreren, verwerken en op te slaan.
Expand | ||
---|---|---|
| ||
Nu u toch op deze pagina bent: het lijkt erop dat de sensoren die gegevens naar het Workplace platform sturen, gegevens naar een platform of database sturen die niet met Workplace is verbonden. Op deze pagina zullen we ervoor zorgen dat er een verbinding is tussen de platforms en dat de gegevens worden verzonden in een formaat waarmee Workplace kan werken en dat het weet hoe het te identificeren. Het opzetten van externe gegevensbronnen en het verzenden van gegevens van een externe database naar het Workplace platform kan worden vergeleken met "Er komt een auto aan bij een poort. De auto is bekend bij de poortwachter en de persoon in de auto heeft een badge, omdat hij zijn contactpersoon van tevoren heeft verteld dat hij eraan kwam."
Spacewell consultants die meer willen weten over hoe Spacewell omgaat met gegevens die binnenkomen, kunnen kijken op /wiki/spaces/WM/pages/492237 |
The sensor vendor needs to comply with the De sensorverkoper moet voldoen aan de Spacewell webhook, supported data types & ondersteunde gegevenstypen en payload.
Info |
---|
Within Binnen 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.
moeten sensor-ID's uniek zijn en voorafgegaan worden door de vendor ID. |
Hoe stel ik deze verbinding in?
Stappen beschreven op deze pagina:
In de externe database (klant of derde partij): Gegevenslading configureren
De verbinding tussen Externe gegevensbron en Workplace configureren
Ga naar de database en vul URL en token in, zorg ervoor dat je de verbinding test
Apparaten sturen gegevens naar Workplace platform
Gegevenslading configureren
Webhooks
Webhooks bieden een snelle en veilige manier om betrouwbaar sensorgegevens van andere systemen door te sturen.
Van de sensorprovider wordt verwacht dat hij updates post naar het Spacewell eindpunt.
Het webhook-eindpunt verwacht een enkel HTTP-verzoek dat een afzonderlijk bericht van de sensor vertegenwoordigt.
De webhook URL:
Gebruikte HTTP method used-methode: POST
HTTP-headers:
AuthorizationMachtiging: Bearer Drager <token>
Content-TypeInhoudstype: applicationtoepassing/json
Supported data types & payload
For all data types, it makes sense to verify if data will be send regularly or not; seeOndersteunde gegevenstypen en payload
Voor alle gegevenstypen is het zinvol om te controleren of gegevens regelmatig worden verzonden of niet; zie https://spacewell.atlassian.net/wiki/spaces/KB/pages/5242896/External+Data+Sources#FAQ
Space occupancy related data typesDatatypes met betrekking tot ruimtebezetting:
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
If your headcount device is able to track multiple count areas, you can send us the data of the individual count areas by replacing Als je hoofdopnameapparaat meerdere telgebieden kan volgen, kun je ons de gegevens van de afzonderlijke telgebieden sturen door "<unique_device_id>" through te vervangen door "<unique_area_id>". |
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
* 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 Afhankelijk van de betrouwbaarheid van de sensor kan het zijn dat de ruimtebezettingsgegevens alleen gegevens bevatten over bevestiging "beweging" (aanwezigheid, aantal hoofden, voetstappen in de ene of de andere richting enz. afwezigheid van beweging... Om dit in het Workplace platform aan te pakken, is er een vervalfunctie geïntroduceerd die het mogelijk maakt om de bezetting/headcount op de live (eindgebruiker gerichte) plattegronden langer te visualiseren dan wat de gegevens ons werkelijk vertellen.
Voor een voorbeeld van hoe verval werkt, zie https://spacewell.atlassian.net/wiki/spaces/KB/pages/491737/Motion+sensor#How-is-Motion-sensor-data-reflected-in-Workplace-Live-Views%3F
For a potential solution for data gaps in the dashboards (copy data in time slots), see Zie voor een mogelijke oplossing voor gegevenslacunes in de dashboards (gegevens kopiëren in tijdslots) https://spacewell.atlassian.net/wiki/spaces/KB/pages/5242896/External+Data+Sources#FAQ
Comfort related data typesComfortgerelateerde gegevenstypen:
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Indoor Air Quality related data typesAan binnenluchtkwaliteit gerelateerde gegevenstypen:
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | ||
---|---|---|
| ||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
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 toHet beste is om dit eerst lokaal te testen in een sandbox-omgeving |
De verbinding tussen Externe gegevensbron en Workplace configureren
Hoe krijg ik toegang
Ga naar https://studio.cobundu.com/
Login with your credentials
Select Integrations > External Data Sources in the Inloggen met je gegevens
Selecteer Integraties > Externe gegevensbronnen in de 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
Selecteer "Nieuw toevoegen".
Huurder-ID wordt ingevuld op basis van de omgeving waarop je bent ingelogd
Vul Source ID in met een unieke naam, verwijzend naar uw externe gegevensbron
Note |
---|
Gebruik in het veld Source ID alleen alfanumerieke waarden. De bron-ID wordt later gebruikt als onderdeel van de apparaat-ID's. |
(Optioneel) Vul een beschrijving in, waarin staat wat voor soort gegevens via de externe gegevensbron komen
Kopieer de URL van de webhook + het autorisatietoken om de webhook aan te maken in de externe gegevensbron naar Spacewell Workplace.
Zorg ervoor dat uw installatie is ingeschakeld in Workplace
Info |
---|
It’s possible to refresh the Authorization Token Het is mogelijk om het autorisatietoken te vernieuwen 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.
Check below chapter “Troubleshooting” in case of doubts.
Next steps
To create custom Device Types and configure your third party sensors in Workplace, seeVergeet niet dat dit nieuwe token nu ook moet worden bijgewerkt in het platform van de 3e partij. |
Test je opstelling
Zodra de webhook is aangemaakt in de database van de 3e partij met de bovenstaande URL en token, moet u de verbinding testen.
Deze stap moet worden uitgevoerd door de partij die gegevens naar Spacewell Workplace wil verzenden.
Controleer met een programma als Postman of je opstelling werkt:
Als het verzoek niet succesvol is, retourneert het eindpunt 4xx-5xx statuscodes afhankelijk van de opgetreden kwestie.
Als het verzoek succesvol is, retourneert het eindpunt 200 statuscode met een leeg lichaam.
Raadpleeg bij twijfel het hoofdstuk "Problemen oplossen" hieronder.
Volgende stappen
Zie voor het maken van aangepaste apparaattypen en het configureren van sensoren van derden in Workplace Custom Device Types
FAQ
Expand | ||
---|---|---|
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 Spacewell 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.
|
Expand | ||
---|---|---|
| ||
Technically, Workplace can accept data with timestamps from 5 years in the past and 1 year in the future. But of course this data will not be included in any calculations or live data view. Only time slots for the previous day are calculated. So, even we store the data, it will not be visible anywhere. So best practice is to just send data with a (near) real time timestamp. |
Expand | ||
---|---|---|
| ||
In Workplace, it’s possible to disable an External Data Source, but you can’t delete. Deletion would impact devices that have a link with this External Data Source. |
Troubleshooting
Expand | ||
---|---|---|
| ||
Make sure the following configuration is in place:
|
| ||
Afhankelijk van het soort sensor kan het zijn dat ze niet regelmatig hartslagen of gegevens verzenden. Als ze gegevens verzenden en dan alleen een bericht sturen als de waarde verandert, kan het zijn dat je met stukjes en beetjes gegevens zit (bijvoorbeeld 1 tijdslot van 15 minuten met gegevens over de temperatuur, en de rest van de dag niets), wat verwarring kan veroorzaken als je de dashboards probeert te lezen. Om dit te omzeilen kunt u ervoor kiezen om Spacewell de gegevens te laten kopiëren, per generiek eindpunt / apparaattype niveau voor elke gewenste hoeveelheid tijd. Bijvoorbeeld voor het sensortype "Generieke PIR" kunnen we een "kopie in verdere tijdslots" instellen en deze waarde zou geldig zijn voor alle Generieke PIR-sensorwaarden die bij ons binnenkomen voor je huurder. Natuurlijk worden de gegevens alleen gekopieerd totdat er weer nieuwe gegevens binnenkomen. Zodat als een waarde op maandag om 9 uur 's ochtends binnenkomt en de configuratie zegt "7 dagen kopiëren", en op woensdag om 8 uur 's ochtends komt er een nieuwe waarde binnen, dan wordt vanaf woensdag om 8 uur 's ochtends de nieuwe waarde 7 dagen meegenomen, of totdat er een nieuwe waarde binnenkomt.
Neem contact op met je Account Manager om dit op te zetten. |
Expand | ||
---|---|---|
| ||
Het is mogelijk om de externe gegevensbroninformatie opnieuw te gebruiken (verificatietoken + URL). Zodat als apparaten hetzelfde gedrag hebben, maar gekoppeld zijn aan verschillende externe gegevensbronnen, het mogelijk is om slechts 1 eindpunt in Studio in te stellen en de 2 externe gegevensbronnen gegevens naar datzelfde eindpunt in Workplace te laten sturen.
|
Expand | ||
---|---|---|
| ||
Technisch gezien kan Workplace gegevens accepteren met tijdstempels van 5 jaar in het verleden en 1 jaar in de toekomst. Maar deze gegevens worden natuurlijk niet meegenomen in berekeningen of live gegevensweergaven. Alleen tijdstippen van de vorige dag worden berekend. Zodat, zelfs als we de gegevens opslaan, ze nergens zichtbaar zijn. De beste manier is dus om gegevens te verzenden met een (bijna) realtime tijdstempel. |
Expand | ||
---|---|---|
| ||
In Workplace is het mogelijk om een Externe gegevensbron uit te schakelen, maar je kunt deze niet verwijderen. Verwijdering zou gevolgen hebben voor apparaten die een koppeling hebben met deze Externe gegevensbron. |
Problemen oplossen
Expand | ||
---|---|---|
| ||
Zorg ervoor dat de volgende configuratie aanwezig is:
|
Expand | ||
---|---|---|
| ||
Zorg ervoor dat de volgende configuratie aanwezig is:
|
Expand | ||||
---|---|---|---|---|
| See “Legacy Generic End-Point Set-up” chapter below
| |||
Zie het hoofdstuk "Generieke eindpuntinstelling voor oudere versies" hieronder. |
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
| |
Om veiligheidsredenen: Als een gebruiker zich aanmeldt met een account voor meerdere huurders, kan hij geen wijzigingen aanbrengen in externe gegevensbronnen. |
Generieke eindpuntinstelling
In het verleden waren sommige externe gegevensbronnen via een iets ander formaat verbonden met Spacewell. Hierdoor is er alleen een beperking voor de legacy / oude generieke eindpunten:
De oude / legacy Generic Endpoints worden in Studio getoond met het label 'Gemaakt door Spacewell'.
De gebruiker kan geen acties ondernemen (Vernieuw Autorisatie token, Inschakelen / Uitschakelen worden allemaal grijs weergegeven)
Gebruiker kan alleen URL/autorisatietoken bekijken en kopiëren.
Neem contact op met je Account Manager om het autorisatietoken in/uit te schakelen of te vernieuwen.
Zoek op
Live Search |
---|