Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Next »

Difficulty: expert

Content

Learning Objectives

After reading this article, you’ll be able to:

  • use GET Sensor Values API in Workplace


This page provides more information about the GET Sensor Values API, which allows you to export the sensor values that are stored in Workplace for your devices.

For more information about Workplace APIs in general (best practices on how to reach out, test, validate and troubleshoot APIs), see Rest API.

image-20250123-110431.png

GET Sensor Values API presents 3 fields in order to specify which data you want to retrieve: Device ID, From- and To-Date/Time fields.

This page contains some tips & tricks on how to best work with these fields.

From-To Date/Time fields

  • Provide specific date-time information following ISO 8601 format (for example: 2025-02-16T10:00:00+01:00) to get concrete data for that time frame

  • Fill in “latest” in the From field and leave To field empty to just get the latest value that is available in the Workplace database

This API cannot return range greater than one day, so limit the time span between From-To request to max 24 hours

Device ID field

In Device ID field, provide Device ID following the format “prefix|Device ID|suffix”, which refers to

  • the original source of the data (before it came into Workplace),

  • the unique device identifier as it’s known in the Workplace database and

  • the exact sensor type that you want to receive data for.

As there are many components and potential deviations in using the GET SensorValues API, make sure to test at least 1 device ID in the Workplace API Test to validate your request.

Prefix

The prefix refers to the original source of the data (before it came into Workplace):

Device ID

The Device ID refers to the unique device identifier as it’s known in the Workplace database. In most cases, this is the Device ID that is mentioned in the Studio Device Overview (and Device Export). Yet sometimes it’s different, which is why we suggest to always check the device ID that is mentioned in the Studio Device Label URL (see https://spacewell.atlassian.net/wiki/spaces/KB/pages/492422/Sensor+Management#Device-Info).

As a rule, we can state that if Studio shows a device ID that adheres to one of the next categories, then it’s best to check the URL of the device:

  • if device ID in Studio Device Overview contains pipe (|) or colon (:)

  • if the device data comes in through Generic Endpoint (see External Data Sources)

Depending on the browser, you can immediately verify the prefix+device ID to use in the GET API request with what is listed in the URL behind “https://studio.cobundu.com/…/devices/” or the browser might encode the pipe icon as “%7C” and then you’ll need to work or read around it.

 Example of how a Device ID is represented in the URL

In this example, we’re looking at a VergeSense device, which in the Studio Device Overview (and Device Export) is listed with Device ID “spacewell|Spacewell-Arnhem|Floor 1|1.01”.

image-20250123-120822.png

This “pretty” device ID is constructed by Workplace based on the information that is provided by VergeSense. But the real device ID as it’s known by the Workplace Database is different if we check the URL in the Device Label (see https://spacewell.atlassian.net/wiki/spaces/KB/pages/492422/Sensor+Management#Device-Info).

In the URL, we see that the Database Device ID is “B6B662F080F2FEA967F903B8A3D8807B”.

image-20250123-121514.png

In the above screenshot, you might have noticed that the URL behind “https://studio.cobundu.com/…/devices/” reads “vergesense|B6B662F080F2FEA967F903B8A3D8807B”. This indeed is the prefix & device ID as we need them in the GET Sensor Values API.

Unfortunately, not every Browser uses the pipe icon, as you can see below:

image-20250122-145147.png

Check out https://en.wikipedia.org/wiki/Percent-encoding for more details on proper encoding of special characters.

Suffix

Use the suffix part of your request to specify for which exact sensor type you want to receive data. If you have a comfort sensor and want to fetch the data for humidity and temperature, then you will have to send 2 requests to the API: one for “prefix|Device ID|humidity” and one for “prefix|Device ID|temperature”.

Use this table to define the suffix for your request:

Sensor Type enabled in Workplace

suffix to use in SensorValues API

Temperature

temperature

CO2

co2

Humidity

humidity

VOC

voc

Light %

light-pct

Radon

radon

Pressure

pressure

Presence

pir

Headcount

headcount

Footfall (in)

in

Footfall (out)

out

Pulse

door

Battery

battery

If you’re unsure which Sensor Type is enabled in Workplace for your sensor, check Devices Overview or Devices Advanced Export (see https://spacewell.atlassian.net/wiki/spaces/KB/pages/492422/Sensor+Management#General). Also the Device Label screen provides information about the enabled sensors for this device.

image-20250123-122742.png

As there are many components and potential deviations in using the GET SensorValues API, make sure to test at least 1 device ID in the Workplace API Test to validate your request.

Examples

 Example of “prefix|Device ID|suffix” to use in SensorValues API: Browan Motion

→ compose together to retrieve data via SensorValues API: tracknet|E8-E1-E1-00-01-09-27-25|pir

image-20250123-125131.pngimage-20250123-125325.png
 Example of “prefix|Device ID|suffix” to use in SensorValues API: Xovis
  • Xovis is a proprietary device. According to the instructions above, we need to use “xovis” as a prefix

  • device ID according to Device Overview: 00:6E:02:00:C2:E8-1002 → looks fishy with the colon icons… let’s check the Device Device Label URL (see https://spacewell.atlassian.net/wiki/spaces/KB/pages/492422/Sensor+Management#Device-Info)

  • prefix + device ID according to URL: xovis|006E0200C2E8-1002

  • suffix: “in” and “out” to use to check for Footfall (in) and Foutfall (out) values

→ compose together to retrieve data via SensorValues API: xovis|006E0200C2E8-1002|in and xovis|006E0200C2E8-1002|out

image-20250122-155256.pngimage-20250122-155627.png

Troubleshooting

Check out the best practices highlighted in https://spacewell.atlassian.net/wiki/spaces/KB/pages/72613940/Rest+API#How-to-use-Workplace-API


Search

  • No labels