Skip to content

Area Occupancy for a Floor

The Get Area Occupancy returns the occupancy status (occupied or unoccupied state) for all areas on a floor from the Enlighted area sensors. An area is a grouping of sensors with an Area ID. The API response is a single data point for all sensors in the area.

The sensors in the area will start reporting occupancy data after they are activated as zonal sensors. Refer to the article Enable Zonal Sensors to enable them as zonal sensors to get occupancy data.

The request will return occupied or unoccupied for all areas on the floor. For example, if Floor 1 in a building has two areas, the API will return occupied or unoccupied for all areas on Floor 1 identified with Area ID. If you need to see the IDs of all areas, you can query those by using the Get All Areas request.

For the sensors to report occupancy data, you will need the Sensor and API licenses based on the number of sensors configured in the system. Refer to the License Types and Product Codes.

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/facility/v1/getOccupancyStateOfFloorAreas/{floor_id}

Parameters

Request

Name Description
em_ip_address_or_hostname The 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.

Response

Name Description
id Area identifier.
name Area name as described in Manage.
description Area description as described in Manage. The field will be empty if there is no description entered in Manage.
zonesensorenable The area has been activated as a zone sensor area. The area starts reporting consolidated occupancy status.
true – Sensors in the area are enabled as zone sensors.
false – Sensors in the area are disabled as zone sensors.
occupancyState 0 – Area unoccupied
1 – Area occupied
-1 – Fault. Sensors are not reporting occupancy.

Note: The response will always include an additional area with ID field ALWAYS "0" and the name "Unassigned". The occupancyState will be "1 - Area occupied" if ANY sensor on that floor does not belong to an area and is "occupied". If all such sensors are "vacant", the value will be "0 - Area unoccupied".

Sample Request

Send a request to return the occupancy state for all areas on Floor 1. For example, if Floor 1 in the Main building has two areas: Hardware and Software, the details of the areas and their corresponding Area IDs and occupancy state for all areas on Floor 1 is returned in the response.

GET https://{192.80.3.2}/ems/api/org/facility/v1/getOccupancyStateOfFloorAreas/1

Sample Response

{
  {
  "id": "9",
  "name": "Hardware",
  "description": "hw eng",
  "zonesensorenable": "true",
  "occupancyState": "1",
  },
  {
    "id": "27",
    "name": "Software",
    "description": "sw eng",
    "zonesensorenable": "false",
    "occupancyState": "1",
  },
  {
    "id": "0",
    "name": "Unassigned",
    "description": "Unassigned area",
    "occupancyState": "1",
  }
}

Community

Connect and Collaborate with Industrial Professionals and Join the Community!

Click to load comments