Get all Areas

In the Enlighted Manage (EM), the organization hierarchy includes campuses, buildings, floors, and areas. An area on a floor is a grouping of a subset of devices including Gateways, Sensors, Enlighted Room Control (ERCs) switches, Plug Loads, etc., on a floor. Areas are assigned on a floor based on usage or a specific purpose profile of the area in EM.

This API returns details of all areas on a floor. The Area ID returned for each area is used as the primary identifier in other API calls.

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/area/v2/list/{floor_id}

Parameters

Request
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
Id** Area identifier (**used as the primary identifier in other API calls)
name Area name as described in the EM
description Area description as described in the EM. The field will be empty if there is no description entered in the EM.
zonesensorenable

The area has been activated as a zone sensor area. The area starts reporting consolidated occupancy status information from individual sensors. Note that the zone sensor license must be purchased and available for the sensors to report occupancy information. Otherwise, occupancy data is not reported by the sensors.

true – Sensors in the area are enabled as zone sensors.
false – Sensors in the area are disabled as zone sensors.

Sample Code

Send a request to return the list of all areas on the first floor with ID ‘1’. For example, if the first floor has two areas: Hardware and Software, the details of the areas along with their corresponding Area IDs ‘9’ and ‘27’ will be returned as shown below. The Area IDs are used as the primary identifiers in other API calls.

Get https://{192.80.3.2}/ems/api/org/area/v2/list/1

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/xml
Content-Length: 7582
Date: Sat, 21 Jul 2015 17:06:51 GMT
{
"area": [
{
   "id": "9", **Area ID**
  "name": "Hardware",
  "description": "hw eng",
  "zonesensorenable": "true",
},
{
  "id": "27", **Area ID**
  "name": "Software",
  "description": "sw eng",
  "zonesensorenable": "false",
}
]
}

 

Get Area Energy Consumption

Returns the aggregate energy consumption in watt-hour for all devices in the area for the last 15 minutes. 

For example, if the request is between 10:05:00 and 10:19:59 am, energy data is sent for the period from 9:45 to 10:00 am. Likewise, if the request is between 10:20:00 and 10:34:59, data is sent for the period from 10:00 to 10:15 am. The data is aggregated from all fixtures in the area at 5-minute intervals and is rounded to the nearest last 15-minute interval set. 

Request

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

Parameters

Request 
em_ip_address or hostname The Manage (EM) IP address or hostname
area_id Area identifier. Use the Get All Areas  API, or in EM, select Facility > Floor > Area in the left panel, and click the Settings tab to get the Area ID.
Response 
energy-lighting Reports aggregate energy consumption in watt-hour for the last 15 minutes for all lighting fixtures in the area
energy-plugload Reports aggregate energy consumption in watt-hour for the last 15 minutes for all plugloads in the area 

Sample Code

For example, the  Get all Areas API returned two areas: Hardware area with ID ‘9’ and Software area with ID ‘27’. Send a request to the EM to return the watt-hour for all devices in the area for the last 15 minutes for Area ID '9'.

Get https://192.80.3.2/ems/api/org/area/v1/energy/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
{
  "energy-lighting": "5580.96"
  "energy-plugload": "380.63"
}

 

Set Area Emergency

During an emergency, this command automatically sets the lighting level of all fixtures in the area to a maximum level of 100% (full-on), so the area is lit up.  

Request

POST https://{em_ip_address_or_hostname}/ems/api/org/area/v1/setEmergency/{area_id}?time=60

Parameters

Request 
em_ip_address or hostname: The Enlighted Manage’s (EM) IP address or hostname
area_id: Area Identifier. Use the Get All Areas API , or in EM, select Facility > Floor > Area in the left panel, and click the Settings tab to get the Area ID.
time: The emergency duration time. The default emergency time is set to 60 minutes.
Response 
status: 0 – Lights are on to a maximum level of 100% or full-on
1 – Lights are off

Sample Code

For example, the Get All Areas  API returned two areas: Hardware area with ID ‘9’ and Software area with ID ‘27’. Using the EM IP address and Area ID, set all lights in the area with ID '9' to turn on for 60 minutes.

Post https://192.80.3.2/ems/api/org/area/v1/setEmergency/9?time=60

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
{
  "status": "0"
}