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¶
Request¶
Name | Description | Data Type | Format Example |
---|---|---|---|
em_ip_address_or_hostname | Manage’s IP address or hostname | string | hostname |
floor_id | Floor identifier. Use the Get All Floors API. Alternatively, in Energy Manager, select Facility > Floor > in the left panel, and click the Settings tab to obtain the Floor ID. | integer | 12 |
from_date | Display energy consumption data for the start time period | string | yyyyMMddHHmm |
to_date | Display energy consumption data for the enabled time period | string | yyyyMMddHHmm |
Response¶
Name | Description | Data Type | Format Example |
---|---|---|---|
id | A unique identifier for the fixture | integer | 15 |
power | The average load of the fixture in watts during the last five-minute interval | integer | 70.81 |
occupancy | This value needs to be converted from decimal to binary format. The binary is 64 bits integer value and each bit corresponds to 5 seconds 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 second periods. For example, the value in decimal 1152860189653680128 converts to 00001111 1111111111001000 00111011 11111111 11111111 01000000 00000000 in binary. 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 zeros to the start of the string. For another 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 | integer | 188658598246027468 |
temperature | Temperature in Fahrenheit | integer | 68 |
captureTime | Five-minute time duration | string | YYYY-MM-dd hh:mm |
Sample Request¶
The example below shows getting data from Floor 2 from 10 hours 05 minutes to 10 hours 10 minutes. The API returns granular 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 5-minute intervals.
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"
}
]
}