Get Switch Groups

Switch Groups control turning on or off a group of fixtures . This API returns all Switch Groups on a floor in the building. The response includes the Switch Group ID and Switch Name for each Switch Group. The Switch Name and ID  are used as the primary identifiers in other API calls.

Request

GET https://{em_ip_address_or_hostname}/ems/api/org/switchgroups/list/{facility}/{fid}

Parameters

Request 
em_ip_address or hostname The Enlighted Manage (EM) IP address or hostname.
facility The facility type can be either a floor or a company.  
fid Company or Floor ID. By default, the Company ID is always ‘1’. For Floor ID, 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 to obtain the Floor ID.
Response 
id Switch Group identifier in EM
name Switch name (**used as the primary identifier in other API calls)
description Description of the switch group
floor

id: Floor identifier

name: Name of the floor

description: Floor description

floorPlanUrl: Floorplan image name

installedSensors: Number of sensor installed in that floor

installedFixtures: Number of fixtures installed in that floor

siteId: Site identifier

calcMethod: Energy savings are calculated based on the sensor’s baseline energy or contract baseline energy

  • SENSOR_BASED – Savings based on the sensor’s baseline energy
  • CONTRACTUAL – Savings based on contract baseline energy. The contract baseline energy is calculated using the annual baseline energy savings stipulated in the customer’s signed agreement for the campus at the time of installation.

tenant: Tenant identifier and name

contractBaseline: Baseline energy savings for the groups

iconScaleFactor: Icon size

ceilingHeight: Ceiling height of the building

elevation: Vertical distance above or below the ground floor

tagEventFrequency: Communication frequency of the device to Sensor or Manage

batteryEventFrequency: Communication frequency to fetch Battery Level of the devices

parentFloorId: Parent floor identifier.

Sample Code

Using the Floor ID returned in the Get All Floors API, request for the list of all switch groups on the floor. The Switch Group ID and Switch name for all switch groups on Floor 1 is returned. For example, if Floor 1 has two switch groups, the Switch Group ID and Switch name are returned as shown below. The Switch name is used as the primary identifier in other API calls.

Get https://192.80.3.2/ems/api/org/switchgroups/list/floor/1
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
[
{
   "id": 7,
   "name": "594_SWG",
   "description": "Switch Group room area",
   "floor": {
       "id": 1,
       "name": "Floor 01",
       "description": "First floor",
       "floorPlanUrl": "floorplan.jpg",
       "installedSensors": 10,
       "installedFixtures": 15,
       "siteId": 1,
       "calcMethod": "SENSOR_BASED",
       "tenant": {
           "tenantId": 1,
           "name": "Tenant 1 "
       },
       "contractBaseline": 0.00,
       "iconScaleFactor": 4,
       "ceilingHeight": 9.0,
       "elevation": 10.2,
       "tagEventFrequency": 2,
       "batteryEventFrequency": 2,
       "parentFloorId": null
   }
}
{
   "id": 8,
   "name": "595_SWG",
   "description": "Conference room area",
   "floor": {
       "id": 2,
       "name": "Floor 01",
       "description": "First floor",
       "floorPlanUrl": "floorplan.jpg",
       "installedSensors": 10,
       "installedFixtures": 15,
       "siteId": 1,
       "calcMethod": "SENSOR_BASED",
       "tenant": {
           "tenantId": 2,
           "name": "Tenant 2 "
       },
       "contractBaseline": 0.00,
       "iconScaleFactor": 4,
       "ceilingHeight": 9.0,
       "elevation": 10.2,
       "tagEventFrequency": 2,
       "batteryEventFrequency": 2,
       "parentFloorId": null
   }
}

]
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Article is closed for comments.