Skip to content
Siemens Developer Portal

Detailed Fine-Grain Sensor Data

Returns movement data of all people within a building or space based on triggered sensor events for all sensors on a floor every five minutes for a specified time period. The data is returned every five minutes during the given period. For example, for the interval from 10:00 (hh:mm) to 10:1 (hh:mm), the movement data of people triggered by sensor events is returned every five minutes, which will be 10:05 and 10:10. The time range can span a maximum of one hour for a given API call.

For the sensors to report data, you will need licenses based on the number of sensors. You will need the Sensor and API licenses to get fine-grain sensor data. Refer to the License Types and Product Codes. Read Request License to purchase licenses if you have not, and enable sensors to provide motion-bit data via API.

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/sensor/stats/floor/{floor_id}/{from_date}/{to_date}

Parameters

Name Description
Request
em_ip_address_or_hostname Manage’s IP address or hostname
floor_id Floor identifier. Use the Get All Floors API, or in EM, select Facility > Floor > in the left panel, and click the Settings tab to obtain the Floor ID.
from_date Display energy consumption data for the start time period Format: (yyyyMMddHHmm) year/month/day/hour/minutes
to_date Display energy consumption data for the enabled time period Format: (yyyyMMddHHmm) year/month/day/hour/minutes
Response
id A unique identifier for the fixture
power The average load of the fixture in watts during the last five-minute interval
occupancy The value is in decimal format and needs to be converted to binary format. The binary is 64 bits integer value with each bit corresponding to 5 sec. in the last 5-minute interval. Out of 64 bits, the first four most significant bits are not used. The remaining subsequent 60 bits represent the recent 5 sec. periods.
For example, the value in decimal 1152860189653680128 converted into a binary would be 00001111 1111111111001000 00111011 11111111 11111111 01000000 00000000. The first 4 bits (0000) are not used. The remaining string of subsequent 60 bits represents the occupied state for a five-minute interval, with each bit representing the recent five-second period. If you prefer to verify a binary integer and its value is less than 64 bits, add the required number of 0's to the start of the string.
For example, the binary equivalent of the decimal value 422212465065984 would be 11000000 00000000 00000000 00000000 00000000 00000000 0. To make the string to 64 bits, add the required number of zeros 00000000 00000001 10000000 00000000 00000000 00000000 00000000 00000000.
1: Occupied; 0: Unoccupied.
temperature Temperature in Fahrenheit
captureTime Five-minute time duration (YYYY-MM-dd hh:mm) year/month/day/hour/minutes

Sample Request

The example below shows getting data from Floor 2 from 10 hours 05 minutes to 10 hours 10 minutes. The API returns fine-grain data such as the Fixture ID, power in watts, occupancy status, temperature, and time from all sensors on Floor 2 for the specified duration, returning data at a 5-minute interval.

GET https://192.80.3.2/ems/api/org/sensor/stats/floor/2/202009281300/202009281400

Sample Response

{ 
  "sensor": [
    {
      "id": "1327",
      "power": "27.98",
      "occupancy": "1152860189653680128",
      "temperature": "78",
      "captureTime": "2021-09-28 13:00"
    },
    {
      "id": "1377",
      "power": "12.62",
      "occupancy": "422212465065984",
      "temperature": "74",
      "captureTime": "2021-09-28 13:00"
    },
    {
      "id": "367",
      "power": "70.81",
      "occupancy": "188658598246027468",
      "temperature": "70",
      "captureTime": "2021-09-28 13:00"
    },  
    {
      "id": "354",
      "power": "69.10",
      "occupancy": "1024568984031723712",
      "temperature": "74",
      "captureTime": "2021-09-28 13:00"
    },
    {
      "id": "483",
      "power": "68.12",
      "occupancy": "1148417902826749951",
      "temperature": "72",
      "captureTime": "2021-09-28 13:00"
    }
  ]
}

Community

Connect and Collaborate with Industrial Professionals and Join the Community!

Click to load comments