Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


 glp/0/{SID}/(rq|fb)/grp/{Handle}

...

The edge server reports a group's current configuration with the group configuration object in the feedback channel. The following example shows how you can make changes to individual devices or to an entire group (Notice that the members are listed as request channel topics.):

Example:
...fb/
grp/3/cfg = {
  desc: 'driveway lights', 
  members: [
     'glp/0/SID/rq/dev/cm/8/if/light/0',
     'glp/0/SID/rq/dev/lon/3/if/light/0',
     'glp/0/SID/rq/dev/lon/3/if/light/1'
  ],
  
}


1) To set the brightness of one of these lights, assign a new brightness value to the individual light:

.../rq/dev/cm/8/if/light/0 = {
  sp: { value: { b: 0.9 } }
}

2) To set the brightness of all group members, assign the new brightness value to the group:

.../rq/grp/3 = {
  sp: { value: { b: 0.9 } }
}

3) Actions are applied to the group’s do topic. To provision all members within the group, apply a the provision action object to the group:

.../rq/grp/3/do = {
  action: "provision"
}

Notice that this last step applies an action to a group that contains interface blocks. Interface blocks do not support actions, only the device objects that contain the interface blocks.  The edge server recognizes this special case: Actions applied to device interface blocks are automatically applied to the device that contains the interface block. 

The edge server prevents duplicate action in this automatic conversion. For example, the group shown in this example contains two light blocks, both within device .../dev/lon/3. The edge server applies the provision action to this device once.

...

The previous example illustrated how a group can be used to provision all its members. This example shows how the group itself can be provisioned:

Example:
.../rq/grp/3/do = {
  action: "self.provision"
}


The group actions are self.provision, self.deprovision, self.create, self.delete, self.add, self.remove, self.repair.  For example, the following sequence of self.createself.add, and self.provision actions constructs the group shown in our first example on this page:

Example:

.../grp/3/do = {
  action: "self.create",
  args: {
     desc: 'driveway lights'
  }
}

.../grp/3/do = {
  action: "self.add",
  args: {
     members: [
        'glp/0/SID/rq/dev/cm/8/if/light/0',
        'glp/0/SID/rq/dev/lon/3/if/light/0',
        'glp/0/SID/rq/dev/lon/3/if/light/1'
     ]
  }
}

.../grp/3/do = {
  action: "self.provision"
}

These three steps could also have been combined into one, using the optional arguments supported with self.create.

IAP vs Protocol Groups

Many control protocols, such as LonTalk or Control-M, support a protocol concept called “groups,” where each device typically is limited to G concurrent group memberships. N can be as little as 0, 1 (Control-M) or 15 (LonTalk), and will probably always be a finite number.

...

Field Name

Description

Group Data

The data assigned to this topic is assigned to all members.

 This topic supports the request channel.

Topic: glp/0/{SID}/rq/grp/{Handle}

Do

Method invocation for complex and often time-consuming tasks. Actions beginning with self. are applied to the group, all other actions are applied to the group members. All group actions except self.add and self.remove require no arguments.  self.add and self.remove expect an args object with a members list of members to be added or removed. 

Request channel.

Topic: .../do

Members

Reported in the feedback channel.

Field Name         

Type                     

Description                                                               

desc

string

Optional group description.

members

List of topics

List of group members.

Example:

[
 "glp/0/SID/fb/dev/lon/322/if/light/1",
 "glp/0/SID/fb/dev/lon/323/if/light/0",
 "glp/0/SID/fb/grp/lobby"

]

Topic: .../cfg

Status

Group status object, reported in the feedback channel.

Field Name           

Type                

Description

action

string

The name of the pending action, or null if none.

addr

string

Protocol-specific address

state

string

A state such as "created", "deleted", "provisioned", "unprovisioned".

Example: "provisioned"

Topic: .../sts

Implementation Data

Optional group implementation data. See Edge Server Replacement for more information.

Topic: .../impl

...