Get Area Occupancy

The sensors capture and stream occupancy data to Manage. The Get Area Occupancy API returns the current occupancy status of the area. The occupancy status is provided only when the sensors are enabled as zone sensors to report occupancy data. Refer to the article Enable Zonal Sensors.

For the sensors to start reporting occupancy data to Manage, you will need licenses based on the number of sensors and areas configured in the system. You will need the IoT sensor license and Real-time Area Occupancy API license (API-RTO-AREA) to get occupancy for an area. 

After you have purchased and uploaded the API License file in Manage, enable the sensors in the area as zone sensors before using the API to report area occupancy status. 

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/area/v1/occ/{area_id}

Parameters

Request 
em_ip_address or hostname   Manage’s IP address or hostname
area_id Area Identifier. Use the Get all Areas API, or in Manage, select Facility > Floor > Area in the left panel, and click the Settings tab to get the Area ID.
Response 
occupancyState 0 – Area unoccupied
1 – Area occupied
-1 – Sensors are not reporting occupancy
-2 – Zone sensor license is not available. Sensors monitoring the occupancy status of the zone are disabled.
-3 – Unknown area

Sample Code

Let's assume that the floor has two areas: The Hardware area with ID ‘9’ and the Software area with ID ‘27’. To find out the area occupancy in the Hardware area, specify Area ID ‘9’ in the API command. The API call returned the occupancy state '0' for the Hardware area. The occupancy state '0' represents the area is unoccupied.

Get https://192.80.3.2/ems/api/org/area/v1/occ/9

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json
Content-Length: 7582
Date: Sat, 21 Jul 2015 17:06:51 GMT
{
  “occupancyStatus”:
    {"occupancyState": "0"}
}
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.