Get all BLE Fixtures by Floor

The API returns the sensor location for all BLE sensors on the 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. The API also returns the sensor model number.

The product codes and their descriptions are described below.

Product Code Description
SU-4S-H High Bay Smart Sensor with Bluetooth
SU-4S-LRW Ruggedized Sensor with Bluetooth - White
SU-4S-HRW High Bay Ruggedized Sensor with Bluetooth - White
SU-4E-01 Compact Sensor with Bluetooth
FS-D22 Two-wire Fixture Mount Sensor with Bluetooth
CS-D2 Two-wire Compact Sensor with Bluetooth

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/fixture/blefixture/list/floor/{floor_id}

Parameters

Request
em_ip_address: The Enlighted Manage (EM) IP address or hostname
floor_id: Floor identifier. Use the Floor ID returned in the Get All Floors API, or in EM select Facility > Floor > in the left panel, and click the Settings tab.
Response
id: Sensor identifier.
name: Sensor name. For example, Sensorxxxxxx.
x-axis: Scaled reference of the distance measured in the horizontal dimension from the lower-left corner of the uploaded floor plan.
y-axis: Scaled reference of the distance measured in the vertical dimension from the lower-left corner of the uploaded floor plan.
groupid: Profile group identifier. The ID of the profile associated with the fixture.  
macAddress: MAC address.
modelNo: Sensor product code. See product codes table above.

Sample Code

Using the Floor ID '1' returned by the Get All Floors API, request EM to return the x- and y-axis of the scaled-down distance from the lower-left corner of the floor plan for all BLE sensors on Floor 1. 

GET https://{em_ip_address_or_hostname}/ems/api/org/fixture/blefixture/list/floor/2 

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/xml
Content-Length: 7582
Date: Sat, 25 Feb 2012 17:06:51 GMT
 {
  "fixture": [
    {
      "id":   "361",
      "name":   "Sensor00c017",
      "xaxis":   "966",
      "yaxis":   "391",
      "groupid":   "185",
      "modelNo": "SU-4E-01",
      "macaddress":   "0:c0:17"
      ,
      …
    },
    {
      "id":   "1364",
      "name":   "Sensor0629dd",
      "xaxis":   "270",
      "yaxis":   "90",   
      "groupid":   "196",
      "modelNo": "SU-4E-01"
      "macaddress":   "6:29:dd"
      ..
    },
    {
      "id":   "835",
      "name":   "Sensor013ec0",
      "xaxis":   "756",
      "yaxis":   "462",
      "groupid":   "55",
      "modelNo": "SU-4E-01”,
      "macaddress":   "1:3e:c0"
      ..
    }
  ]
}

Set BLE Mode of Sensor

The API sets the BLE mode of the sensor.

Request

POST https://{em_ip_address_or_hostname}/ems/api/org/fixture/op/assignblemode/{blemode}

<fixtures> 
   <fixture>

         <id>nn</id>
   </fixture>
   <fixture>
        <id>mm</id>
  </fixture>

</fixtures>

Parameters

Request 
em_ip_address: The Enlighted Manage (EM) IP address or host name.
blemode: Sensor BLE mode:
OFF – BLE mode is off.
SCAN – The sensor scans for BLE signals.
BEACON – The sensor sends out BLE signals.
id: A unique identifier of the sensor.
Response 
status: nnn – Number of sensors where the BLE mode was updated successfully.
-1 – Error message.
msg: Error message description.

Sample Code

Set the BLE Mode of the sensor for two fixtures to OFF. The response indicates that two fixtures have been updated successfully. If there is an error, the error message is displayed.

   POST https://192.80.30.2/ems/api/org/fixture/op/assignblemode/OFF
   <fixtures>
       <fixture>
            <id>27</id>
        </fixture>
           <fixture>
                <id>28</id>
          </fixture>
    </fixtures>

HTTP/1.1 200: OK
  {
    "status": "2", 
  }

 or

  HTTP/1.1 200: OK
    {
      "status": "-1",
      "msg": "Error..."
    }