Get Sensor Details

This API reports information for an individual sensor at every five-minute interval. The data for the last five minutes of the sensor is reported.

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/sensor/v3/details/{fixture_id}

Parameters

Request 
em_ip_address The Enlighted Manage (EM) IP address or host name
fixture_id Sensor identifier. Use the Sensor ID returned by the Get Sensor Details by Floor, API, or in EM, select Facility > Floor in the left panel, Floor Plan tab, and double-click the sensor icon in the floor plan to obtain the Sensor ID.
Response 
id Sensor identifier
name Sensor name. For example, Sensorxxxxxx
power The average load of the fixture in watts for the last five-minute interval
temperature Temperature in Fahrenheit
lightLevel

Returns the light level (0-100%) information of the fixture

0% - Light level is set to off
100% - Light level is set to full-on

lastCommunicationTime

Time of last communication from the sensor (YYYY-MM-DD 24HH:MM)

Sample Code

Using the sensor ID returned by the Get Sensor Details by Floor API,  request data such as power, temperature, and light level settings from the sensor with ID ‘28’. For example, request data for the last five minutes for the sensor with ID ‘28’.  

Get https://192.80.3.2/ems/api/org/sensor/v3/details/28

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
{
"sensor":[
{
  "id": "28",
  "name": "Sensor00ce56",
  "power": "69.07",
"temperature": "74",
  "lightLevel": "50"
"lastCommunicationTime": "2015-07-21 15:21"

}
]
}

Get Sensor Details by Floor

Returns sensor details for all sensors on the floor for a given period at every five-minute interval. For example, if the duration is from 10:00 am to 10:10 am, data is sent at every five-minute interval. The API retrieves data for a maximum period of one hour. 

The Fixture ID that is returned is used as the primary identifier in other API calls.

Request

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

Parameters

Request 
em_ip_address or hostname Enlighted Manage (EM) IP address or hostname
floor_id Floor identifier. Use the Floor ID returned in the Get All Floors API, or in Manage, select Facility > Floor > in the left panel, and click the Settings tab to obtain the Floor ID.
from_date

Start date to display energy consumption data  
Format: (yyyyMMddHHmm) year/month/day/hour/minutes

to_date End date to stop displaying energy consumption data
Format: (yyyyMMDDHHmm) year/month/day/hour/minutes
Response 
Id** Fixture identifier (**used as the primary identifier in other API calls)
power The average load of the fixture in watts during the last five-minute interval
temperature Temperature in Fahrenheit
lightLevel Ambient light level reading at the sensor (lux)
avgDimLevel Average fixture dim level represents light level where there is sufficient light for the occupants. If the sensor is not connected to any lighting fixture, the API call returns a value of -1.
lastCommunicationtime
Time of last sensor communication (YYYY-MM-DD 24HH-MM)
captureTime Five-minute time duration represented as (yyyy-MM-dd HH:mm) year-month-day-hour-minutes

Sample Code

Request sensor details for all sensors on the first floor with Floor ID ‘1’ from 10 am through 11:30 am on Feb. 12, 2019. Data will be sent at every five-minute interval, which will be 10:05 am and 10:10 am, and so on. The Fixture ID returned for each sensor is used as the primary identifier in other API calls.

Get https://192.80.3.2/ems/api/org/sensor/v2/stats/floor/1/201902120100/201902120200

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
{
 "sensor": [
    {
      "id": "28", **Fixture ID**
"power": "27.98",
"temperature": "78",
"lightLevel": "773"
"lastCommunicationTime": "2019-02-12 10:10"
"avdDimLevel": "85"
"captureTime": "2019-02-12 10:05"
},
{
"id": "29", **Fixture ID**
"power": "12.62",
"temperature": "74",
"lightLevel": "593"
"lastCommunicationTime": "2019-02-12 10:00"

"avdDimLevel": "85"
"captureTime": "2019-02-12 10:05"

},
]
"sensor": [
{
"id": "1327",
"power": "27.98",
"temperature": "74",
"lightLevel": "99"
"lastCommunicationTime": "2019-02-12 10:10"

"avdDimLevel": "85"
"captureTime": "2019-02-12 10:10"

},
{
"id": "1377",
"power": "12.62",
"temperature": "70",
"lightLevel": "462"
"lastCommunicationTime": "2019-02-12 10:10"
"avdDimLevel": "75
"2019-02-12 10:10"
…..
]
}

 

Get Sensor Location by Floor

Refer to the Get List of Fixtures by Floor.

Get All Fixtures by Area

The API returns the location for all fixtures in an area on a floor. The data is returned as X, Y coordinates of the measured and scaled-down distance from the lower-left corner of the uploaded floor plan.

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/fixture/v1/location/list/area/{area_id} 

Parameters

Request 
em_ip_address or hostname The Enlighted Manage (EM) IP address or hostname
area_id Area identifier. Use the Area ID returned in 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 
id Sensor identifier
name Sensor name. For example, Sensorxxxxxx
xaxis Scaled reference of the distance measured in the horizontal dimension from the lower-left corner of the uploaded floor plan.
yaxis Scaled measurement of distance in the vertical dimension from the lower-left corner of the uploaded floor plan
macaddress Sensor’s MAC address  
groupid Profile group identifier. The ID of the profile associated with the fixture.

Sample Code

Request the x- and y-axis coordinates for all sensors in the area with ID ‘9’.

Get https://192.80.3.2/ems/api/org/fixture/v1/location/list/area/9

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
 {
  "fixture": [
    {
      "id": "361",
      "name": "Sensor00c017",
      "xaxis": "966",
      "yaxis": "391",
      "macaddress": "0:c0:17",
      "groupid": "185",
    ..
    },
    {
      "id": "1364",
      "name": "Sensor0629dd",
      "xaxis": "270",
      "yaxis": "90",
      "macaddress": "6:29:dd",
      "groupid": "196",
      ..
    },
    {
      "id": "835",
      "name": "Sensor013ec0",
      "xaxis": "756",
      "yaxis": "462",
      "macaddress": "1:3e:c0",
      "groupid": "55",
      ..
    }
  ]

 

Get Sensor Profiles

The API returns the existing and applicable profiles that can be assigned to the sensor. The list of applicable profiles displayed is derived from the profile template as the existing profile. The profile group ID returned is used as the primary identifier in other API calls.

Request

GET https:/{em_ip_address_or_hostname}/ems/api/org/fixture/v1/getFixtureApplicableProfiles/{fixture_id} 

Parameters

Request 
em_ip_address or hostname The Enlighted Manage (EM) IP address or hostname
fixture_id Fixture or sensor identifier. Use the Fixture ID returned by the Get Sensor Details by Floor API or in EM, select Facility > Floor in the left panel, Floor Plan tab, and double-click the fixture icon in the floor plan to obtain the Fixture ID.
Response 
id The fixture or sensor identifier
name Sensor name. For example, Sensorxxxxxx
currentProfile Displays the name of the existing profile assigned to the sensor. 
groupId** Profile group identifier. The ID of the profile associated with the fixture.
(**used as the primary identifier in other API calls)
applicableProfiles Lists profiles derived from the same profile template as the current profile.

Sample Code

Using the Fixture ID returned by the Get Sensor Details by Floor API, request the profile name assigned to the sensor. As shown in the response below, Open Office Max 35 is the profile assigned to fixture with ID ‘28’.  In addition to the profile assigned to the fixture, the API also returns the list of applicable profiles and the corresponding profile Group ID derived from Open Office Max 35. The Group ID is used as the primary identifier in other API calls.

Get https:/192.80.3.2/ems/api/org/fixture/v1/getFixtureApplicableProfiles/28

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
 {
  "id": "28", **fixture-id**
"name": "Sensor00ceed", **fixture name**
"currentProfile": "Open Office Max 35", **profile name**
“groupId”: “27” **groupID**
"applicableProfiles": **list of applicable profiles**
[
{
"name": "Open Office Max 35",
"groupId": "27"
},
{
"name": "Open Office Max 70",
"groupId": "28"
},
{
"name": "Open Office Max 50",
"groupId": "29"
},
{
"name": "default.Open Office_Normal",
"groupId": "46"
},
{
"name": "default.Open Office_AlwaysOn",
"groupId": "47"
},
{
"name": "default.Open Office_Dim",
"groupId": "48"
}
]
}

Assign Profile

Assigns a profile to the fixture. The fixture will operate with the new behavior.   

Request

POST https://{em_ip_address_or_hostname}/ems/api/org/fixture/v1/op/assignProfile/{fixture_id}/{group_id}

Parameters

Request 
em_ip_address or hostname The Enlighted Manage (EM) IP address or hostname
fixture_id The fixture or sensor identifier. Use the Fixture ID returned in the Get Sensor Details by Floor API or in EM, select Facility > Floor in the left panel, Floor Plan tab, and double-click the fixture icon in the floor plan to obtain the Fixture ID.
group_id Profile group identifier to which the fixture needs to be assigned (returned in Get Sensor Profiles API)
Response 
status 0 – Profile assigned successfully to the sensor
-1 – Profile not assigned to the sensor
Msg Error message description. For example, “either fixture or group does not exist. Please provide valid inputs”.

Sample Code

The sample code shows how to assign a profile to a fixture. Use the Fixture ID returned by the Get Sensor Details by Floor and Group ID returned by the Get Sensor Profiles to assign a new profile to the fixture. For example, use the profile Open Office Max 70 with GroupId ‘27’ to assign it to the fixture with ID ‘28’. The response indicates that the profile has been assigned successfully to the fixture.

Post https://192.80.3.2/ems/api/org/fixture/v1/op/assignProfile/28/27

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"
}

Get Sensor Energy Consumption

Reports energy consumed in watt-hour for the last 15 minutes by the fixture.

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/fixture/v1/energy/{fixture_id}

Parameters

Request 
em_ip_address or hostname The Enlighted Manage (EM) IP address or hostname
fixture_id The fixture or sensor identifier. Use the Fixture ID returned in the Get Sensor Details by Floor or in EM, select Facility > Floor in the left panel, Floor Plan tab, and double-click the fixture icon in the floor plan to obtain the Fixture ID.
Response 
energy Reports energy consumed in watt-hour for the last 15 minutes by the lighting fixture

Sample Code

Send a request to the EM using the Fixture ID ‘28’ returned by the Get Sensor Details by Floor API to return the energy consumed in watt-hour for the last 15 minutes.

Get https://192.80.3.2/ems/api/org/fixture/v1/energy/28

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": "50.96"
}

Get Sensor Energy Consumption by Area

Returns the aggregate energy consumed in watt hour by all fixtures in the area for the last 15 minutes.

Request

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

Parameters

Request 
em_ip_address or hostname The Enlighted Manage (EM) IP address or hostname
area_id Area identifier. Use the Area ID returned in 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 Reports aggregate energy consumed in watt-hour for the last 15 minutes by the lighting fixtures in the area

Sample Code

Send a request to the Manage using the Area ID ‘9’ returned by the Get all Areas API to return the energy consumed in watt-hour for the last 15 minutes by all fixtures in the area.

Get https://192.80.3.2/ems/api/org/fixture/v1/energy/area/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": "250.96"
}

Manual Override for a Fixture

Allows you to manually override the fixture or sensor profile settings and dim the light in the fixture to an absolute level for a period of time in minutes.  

Request

POST https://{em_ip_address_or_hostname}/ems/api/org/{org}/fixture/v1/op/dim/{mode}/{amount}?time=60

<fixtures>
  <fixture>
    <id>27</id>
  </fixture>
</fixtures>

Parameters

Request
em_ip_address or hostname The Enlighted Manage (EM) IP address or hostname
fixture_id The Fixture or sensor identifier. Use the Fixture ID returned in the Get Sensor Details by Floor or in EM, select Facility > Floor in the left panel, Floor Plan tab, and double-click the fixture icon in the floor plan to obtain the Fixture ID.
mode Set mode option
abs – Sets the mode to absolute light level dimming
amount The percentage ranges from 0-100% light levels (must be a whole number)
time The manual override duration time (must be a whole number). The default time is set to 60 minutes.
Response 
status

0 – Light dimmed successfully
1 – Light has not dimmed

Sample Code

Manually override the sensor profile settings and dim the light to 50% for the fixture with ID ‘27’ for a period of 60 minutes. The status shows that the fixture light was set to dim successfully.

Post https://192.80.3.2/ems/api/org/21/v1/op/dim/abs/50?time=60
<fixtures>
<fixture>
<id>27</id>
</fixture>
</fixtures>

HTTP/1.1 200
Server: Apache-Coyote/1.1
Content-Type: application/json
Content-Length: 7582
Date: Sat, 21 Jul 2015 17:06:51 GMT
{
  "status": "0"
}

 

Auto Mode for a Fixture

Sets the sensors to Auto mode. In this mode, the level of occupancy in the area determines the fixture dim level.

Request

POST https://{em_ip_address_or_hostname}/ems/api/org/fixture/v1/op/auto

 <fixtures>
  <fixture>
    <id>27</id>
  </fixture>
</fixtures>

Parameters

Request
em_ip_address or hostname The Enlighted Manage (EM) IP address or hostname
fixture_id The fixture or sensor identifier. Use the Fixture ID returned in the Get Sensor Details by Floor or in EM, select Facility > Floor in the left panel, Floor Plan tab, and double-click the fixture icon in the floor plan to obtain the Fixture ID.
Response 
status

0 – Auto mode successful; lights are dimmed based on occupancy
1 –  Auto mode unsuccessful

Sample Code

Sets the sensor with ID ‘27’ to auto mode. The response is successful which means lights are dimmed based on occupancy.

POST https://192.80.3.2/ems/api/org/21/v1/op/auto
<fixtures>
<fixture>
<id>27</id>
</fixture>
</fixtures>

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"
}

Get Fixture Dim Level by Floor

This API returns the 'current' dim level of fixtures on a floor. The API uses pagination with the ‘page’  query parameters to paginate through the items in a collection. Pagination reduces the overall payload size and increases the API performance.

The sensors in Manage are classified into the following four types; only emergency and fixtured sensors may have dim levels:

  1. Emergency sensors: Sensors designated as emergency fixtures in Manage 
  2. Desk sensors: Sensors designated as desk sensors 
  3. Fixtureless sensors: Sensors designed as fixtureless, including desk sensors
  4. Fixtured sensors: Sensors that are not designated as fixtureless; exclusive of 'fixtureless' and inclusive of ‘emergency’ sensors

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/sensor/dimLevel/list/floor/{floor_id}?class={class}&page={page_number}

Parameters

Request 

em_ip_address or hostname

Manage server IP address or hostname

floor_id

Floor identifier. Use the Floor ID returned in the Get All Floors API, or in Enlighted Manage (EM), select Facility > Floor in the left panel, and click the Settings tab to obtain the Floor ID.

class

  • 'emergency' (only returns sensors designated as emergency fixtures in Manage)
  • 'desk' (only returns sensors designated as desk sensors in EM)
  • 'fixtureless' (only returns sensors designed as fixtureless in EM, will be fully inclusive of desk sensors)
    • returns ‘-1’ as dimLevel
  • 'fixtured' (only returns sensors that are not designated as fixtureless, completely exclusive of fixtureless, completely inclusive of ‘Emergency’).

page

The page for which data will be retrieved. Twenty (20) records are returned per page.

Response 

Id**

Fixture identifier

dimLevel

Most recent dim level of the fixture, updated every 600 seconds (5 minutes); 0-100%

page

The page currently being returned; integer

records

Total number of resources recorded across all pages; integer

total

Total page count to return all resources for the request; no max, integer

Sample Code

Request the current dim level details for fixtures on the first floor with Floor ID ‘1’. The first floor has 115 fixtures, and the user requests the fourth page of 5 pages. The API returns dim level for 20 fixtures on the floor.

Get https:// 192.80.3.2/ems/api/org/sensor/dimLevel/list/floor/1?class=fixtured&page=4

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/xml
Content-Length: 837
Date: Sat, 21 Jul 2015 17:06:51 GMT
{
"sensor":[
{
"dimLevel": "37",
"id": "80",
},
{
"dimLevel": "85",
"id": "79",
},

{
...
}
],
"page": "4",
"records": "115",
"total": "6"
}