Defining and Using Contexts
FoR SMartServer 3.3 and prior releases, the LOCATIONS widget is called the Map Widget.
For SmartServer 3.4 - 3.6, see Defining Contexts (Release 3.4 - 3.6).
For SmartServer 3.3 and prior, see Defining Contexts (Release 3.3 and Prior).
You can create contexts to organize devices within the SmartServer IoT to mirror their locations within the physical site to facilitate effective system planning and navigation. A context is a digital representation of a real world region, area, or space. You will use the CMS Planning widget (introduced in SmartServer 2.8) to view, create, organize, edit, and delete contexts. Other CMS widgets use the context information to organize your devices by the contexts you define. For example, you can organize sequence of operations, dashboards, and connections by contexts. See the SmartServer IoT Node-RED Tutorial for a getting started tutorial on creating a sequence of operation and applying it to a context within the system.
For each context you create, you select a context type which can be a region, campus, building, floor, room, or area. A campus may be a region, such as Northern California, a site such as the Olympic Village, or a campus such as the University of California. An area may, for example, be an area in a campus, such as a parking lot or street, or an area on a floor such as a VAV zone. An area can also be created within a region. You can associate other system entities such as datapoints, devices and users with these contexts to provide a physical location reference to these entities. For example, you can use contexts to identify select specific devices or user interfaces such as the following:
- All temperature sensors in an area
- All the Node-RED sequences that connect temperature sensors in an area to the VAV controller in the area
- All the analytics dashboards showing device status for a campus
If you set or change your SmartServer's location by assigning a context, or by manually setting the location, then the SmartServer's timezone may also be changed accordingly. Changing the SmartServer's timezone does not affect the SmartServer's location.
This topic consists of the following sections:
Setting up Contexts
Contexts have the following simple properties in order to build up an actual site:
- All contexts types (except area context) are hierarchical and a device belonging to a context also belongs to its parent contexts.
- Area contexts are the exception and are location-based. With SmartServer 4.2 and higher, devices within an area belong to that area, as well as any other context it is assigned to.
- Area contexts can exist in a region, campus, or floor context where an area can physically be defined/drawn.
- The location of a campus, region, area within a region or a campus, and a building is defined on the map by clicking the Pick Geoposition button () and using the polygon tool.
- Floor, rooms, and areas are represented as a shape on an imported floor plan. If the area is the child of a region, then you have to define the area on the map by clicking the Pick Geoposition button () and using the polygon tool.
The Planning widget is used to create contexts and also to assign devices to specific contexts. It is encouraged that all workflow begin with defining context before devices are provisioned if the project requires mapping devices to a physical site.
With SmartServer 3.4 and higher, you can clear locations for a device by unassigning the the device from a context. See Viewing and Managing Devices Assigned to a Context below. With SmartServer 3.3 or prior, you can clear locations for a device, which causes the device to be unassigned from any contexts and removes it from the map. See Clearing Device Location in Configure Your SmartServer (Release 3.3 and Prior).
Contexts are not supported in Independent Management Mode (IMM) using the IzoT Net Export (iNex) tool. Running the iNex tool deletes devices and then re-adds them in the SmartServer CMS, which causes the context assignments to be removed.
Creating a Context
The CMS creates a top-level World context by default that includes the Earth's surface. A user with suitable permissions can create campus, building, or area contexts directly in the World context, and can also create segment controllers and edge devices directly in the World context. This may be used, for example, for outdoor lighting systems where segment controllers and lighting controllers may be defined directly in the World context without a campus, building, or area. Alternatively, this may be used to create an area context for a region, which in turn contains segment controllers and lighting controllers for an outdoor lighting system.
Region Context
To create a region context, perform the following steps:
- Open the SmartServer CMS.
- Open the Planning widget.
- Click the Create Context button () on the Planning widget.
The Create Context view appears. - Enter the context parameters as appropriate, including:
- Name – name for the region.
- Type – Region. This type is the parent context that houses all other types of contexts and can contain campus, building, and area contexts as children. It is the highest level entity in the context hierarchy. This type supports four geolocation latitude/longitude coordinates.
- Description – optional description.
- Import Image – allows you to optionally import an image. Importing images for users with a Field Tech role is not supported.
- Custom Fields (Tag / Value) – optional tag/value pairs.
Click the Pick Geoposition button () to set the geolocation.
The Pick Geoposition view opens.
Use the rectangle tool ( polygon tool ( to define the area on the map. )
) or the
Use the + button to zoom in and the - button to zoom out on the map. You can modify the geoposition by first clicking the Edit button ( ), and then clicking and dragging the handles or marker. Save or cancel edits by selecting the appropriate option .Click OK.
The Create Context view reappears.- Optionally, import an image of the area.
Click Save.
The Planning widget appears with the region you created.
Campus Context
To create a campus context, perform the following steps:
- Hover over the region context and select the Create Child Context button ().
The Create Child Context view appears. - Enter the context parameters as appropriate, including:
- Name – name for the campus.
- Type – Campus. This type is the parent context that houses other types of contexts and can contain only building and area contexts as children. It defines a physical facility and is comprised of multiple buildings. This type supports four geolocation latitude/longitude coordinates.
- Description – optional description.
- Import Image – allows you to optionally import an image. Importing images for users with a Field Tech role is not supported.
- Custom Fields (Tag / Value) – optional tag/value pairs.
Click the Pick Geoposition button () to set the geolocation.
The Pick Geoposition view opens. The region you created will appear on the map where the area was defined.
Use the rectangle tool (
) to define the area on the map.
Use the + button to zoom in and the - button to zoom out on the map. You can modify the geoposition by first clicking the Edit button ( ), and then clicking and dragging the handles or marker. Save or cancel edits by selecting the appropriate option .Click OK.
The Create Child Context view reappears.- Optionally, import an image of the area.
Click Save.
The Planning widget appears with the campus you created.
Building Context and Setting Location
To create a building context as described in the steps that follow, first set the location and then save the settings. Next, you can optionally add an image and define the related fields by editing the building context.
- Hover over the campus context and select the Create Child Context button ().
The Create Child Context view appears. - Enter the context parameters as appropriate, including:
- Name – name for the building.
- Type – Building. This type is the next level of hierarchy after campus that contains only Floor and Area context types. It defines a physical building and is comprised of one or more floors. This type supports single geolocation latitude/longitude coordinates and street address.
- Description – optional description.
- Click the Pick Geoposition button (
The Pick Geoposition view appears. ). Use the polygon tool (
) to define the area on the map.
Use the + button to zoom in and the - button to zoom out on the map. You can modify the geoposition by first clicking the Edit button ( ), and then clicking and dragging the handles or marker. Save or cancel edits by selecting the appropriate option .- Click OK.
The Create Child Context view appears. - Click Save.
The Planning widget appears with the building you created. - To optionally import an image of the building, hover over the building context and select the Edit button ().
The Edit Child Context view appears. Optionally, import the building image by clicking the Import Image area and selecting the image from your computer. For devices to appear where they are expected on the map, continue with the steps below setting Base Point, True North Angle, and Drawing Scale.
- Optionally, set the Base Point: x / y reference for measuring distances and positioning contexts and devices in relation to the drawing. The base point is specified as the pixel x,y coordinates of the starting point of the drawing coordinate system. The default base point is 0, 0 representing the upper-left point, which is the first point in the image. For the building context, this field is not used for calculations.
- Optionally, set the True North Angle, which is specified as true north angle - project north angle. That is, if the project north angle is oriented straight up, and with that orientation true north is 90 degrees, then the angle to true north is 90 (90 - 0). The default true north angle is 0 degrees. This value may be fractional. For the building context, this field is not used for calculations.
- Optionally, set the Drawing Scale, which is the number of pixels per linear meter (number of pixels / linear meters). This value may be fractional. The default is 3 pixels per meter. For the building context, this field is not used for calculations.
- Optionally, set the Geographic Location: Latitude / Longitude, or click the Set Location (real-world location of the base point in latitude and longitude coordinates. For the building context, this field is not used for calculations.
- Click OK.
The Create Child Context view appears. - Optionally, set the Custom Fields (Tag / Value) pairs.
- Click Update.
The Planning widget appears with the building you created.
Floor Context
To create a floor context, perform the following steps:
- Hover over the building context and then select the Create Child Context button ().
The Create Child Context view appears. - Enter the context parameters as appropriate, including:
- Name – name for the floor.
- Type – Floor. This type is the subsequent context type that contains room and area context types and contains the floor plan image. It defines a physical floor in a building and is comprised of one or more rooms. A floor context type nested below the building are geolocated relative to the building context type they are nested below. A floor and room context type nested below the building are geolocated relative to the building context type they are nested below. The room and area context types defined below the floor context type are relative to their position assigned on the floor plan image.
- Description – optional description.
- Click the Import Image Floor area and upload the selected floor plan image from your computer. For devices to appear where they are expected on the map, continue with the steps below setting Base Point, True North Angle, and Drawing Scale.
- Set the Base Point: x / y reference for measuring distances and positioning contexts and devices in relation to the drawing. The base point is specified as the pixel x,y coordinates of the starting point of the drawing coordinate system. The default base point is 0, 0 representing the upper-left point, which is the first point in the image.
- Set the True North Angle, which is specified as true north angle - project north angle. That is, if the project north angle is oriented straight up, and with that orientation true north is 90 degrees, then the angle to true north is 90 (90 - 0). The default true north angle is 0 degrees. This value may be fractional.
Example:- Consider the following location on the map (the arrow points to true north):
https://www.google.com/maps/@37.2921622,-121.9884976,475m/data=!3m1!1e3 The floor plan appears as follows (the arrow points to true north):
Measure the angle (green arrow) between true north (red arrow) and current "north" (black line). Always calculate the true north angle in a counter-clockwise direction.
For this example, the true north value is 132.25 degrees.
- Consider the following location on the map (the arrow points to true north):
- Set the Drawing Scale, which is the number of pixels per linear meter (number of pixels / linear meters). This value may be fractional. The default is 3 pixels per meter.
Example:- Measure the size of the building (360.20m for this example).
Determine the pixel size of the image (662 for this example). For a Windows PC, the pixel size is displayed with the image file. For a Mac, right-click the image file and select Get Info.
- Calculate the drawing scale.
For this example: 662 / 360.20 = 1.84 pixels per meter.
- Measure the size of the building (360.20m for this example).
- Set the Geographic Location: Latitude / Longitude, or click the Set Location (real-world location of the base point in latitude and longitude coordinates.
- If you click the Set Location button, then the following view appears:
Zoom in on the map to set the building location. The latitude and longitude fields are set based on the building coordinates.
Use the + button to zoom in and the - button to zoom out on the map. You can modify the geoposition by first clicking the Edit button ( ), and then clicking and dragging the handles or marker. Save or cancel edits by selecting the appropriate option .
) button. These fields define the - If you click the Set Location button, then the following view appears:
- Optionally, set the Custom Fields (Tag / Value) pairs.
- Click Save.
The Planning widget appears with the floor you created.
Room or Area Context
An area is a context type that is defined by its scope (campus or floor plan) and meets the following criteria:
- Has three or more vertices (the sides defined by the vertexes do not overlap).
- Contains all devices that are within the boundaries defined by the vertices. Containment with an area does not preclude containment with any other areas or contexts, as shown in the figure below.
- Exists only in a campus or a floor.
- Cannot be nested within other areas, buildings, or rooms (areas are not hierarchical).
- In a campus, all areas are at the same hierarchy as other buildings and campus-level areas.
- In a floor, all areas are at the same hierarchy as other rooms and floor plan-level areas, even if an area’s boundaries covers a room completely (as shown in the figure below).
See Applying Contexts and Devices to Flows for more information and refer to the steps below to create a room or area context type.
To create a room or area context, perform the following steps:
- Hover over the floor context and select the Create Child Context button (