Polisy Developers:ISY:API:Scene Support:Native Links

From Universal Devices, Inc. Wiki

Polisy_Developers : ISY : API : Scene Support : Native Links

Native Links

Devices can be controlled by one another using native links in ISY scenes (see ISY Scenes for other link types). A native link is a direct connection between two devices without having a middleman between them (e.g. ISY). In other words, a light switch with a native link to a lamp will continue to operate as expected even if the the ISY is powered off or removed from the system entirely because the devices are communicating directly with each other.

If a <links> section appears in the node definition for a node then the node supports native links in ISY Scenes. The <ctl> section indicates how the node can be used as a native controller in a scene, and the <rsp> section indicates how the node can be used a native responder in the scene.

A native link may be created between a controller and responder using any compatible link definitions. Link definitions are compatible if the controller and responder have the same protocol and the nodes are for the same node server (or ISY product family such as Insteon, Z-Wave, etc.)

In the example below, DimmerLampSwitch can be both a controller and a responder in a scene. The Thermostat can only be a responder because its ctl section is empty.

   <nodeDef id="DimmerLampSwitch" nls="109" eventMap="I_STD">
      ...
      <links>
         <ctl>
            <link linkdef="I_CTL_DIMMER" />
         </ctl>
         <rsp>
            <link linkdef="I_DIMMER" />
            <link linkdef="I_DIMMER_ADV" />
         </rsp>
      </links>
   </nodeDef>
   <nodeDef id="Thermostat" nodeType="143" nls="143" eventMap="I_STD">
      ...
      <links>
         <ctl />
         <rsp>
            <link linkdef="I_TSTAT" />
            <link linkdef="I_TSTAT_ADV" />
         </rsp>
      </links>
  </nodeDef>


Link Definitions

Link definitions are used to describe the support for native links. They are scoped to a node server and/or a product family supported directly by the ISY (e.g. Insteon, Z-Wave, etc.)

e.g.

  • <linkdef id="I_DIMMER" protocol="I_STD">
  • <linkdef id="ASSOC_CMD" protocol="ASSOC_CMD" cmd="true" />
id
The id of the linkdef
protocol
The protocol supported (may contain any alphanumeric text or underline)
cmd
If true then any direct command for a responder can be used in the link (default is false). The linkdef must not specify any parameters.

All link definitions defined for a responder with the same protocol as supported by the controller are available for native links between a controller and a responder.

For example, there are two link protocols for Insteon, I_STD, and I_STD_ADV. I_STD is used for controllers that do not support retries, and I_STD_ADV is used for controllers that do. Therefore, any Insteon controller that supports the I_STD protocol can link to any responder that supports I_STD as well. The example below shows definitions for responders that are dimmers or thermostats.

  <!--  LinkDefs for Responders --!>

  <!-- For dimmers where controller does not support retries -->
  <linkdef id="I_DIMMER" protocol="I_STD">
     <p id="OL" editor="I_OL"><init val="100.0" uom="percent" /></p>
     <p id="RR" editor="I_RR"><init val="0.2" uom="seconds" /></p>
  </linkdef>
  <!-- For dimmers where controller does support retries -->
  <linkdef id="I_DIMMER_ADV" protocol="I_STD_ADV">
     <p id="OL" editor="I_OL"><init val="100.0" uom="percent" /></p>
     <p id="RR" editor="I_RR"><init val="0.2" uom="seconds" /></p>
     <p id="CLNRT" editor="I_CLNRT"><init val="0" uom="25" /></p>
  </linkdef>
  <!-- For thermostats where controller does not support retries -->
  <linkdef id="I_TSTAT" protocol="I_STD">
     <p id="CLISPH" editor="I_CLISPH_DEG"><init val="70.0" uom="F" /></p>
     <p id="CLISPC" editor="I_CLISPC_DEG"><init val="74.0" uom="F" /></p>
     <p id="CLIFS"  editor="I_TSTAT_FAN_MODE"><init val="0" uom="99" /></p>
     <p id="CLIMD"  editor="I_TSTAT_MODE"><init val="74.0" uom="98" /></p>
  </linkdef>
  <!-- For thermostats where controller does support retries -->
  <linkdef id="I_TSTAT_ADV" protocol="I_STD_ADV">
     <p id="CLISPH" editor="I_CLISPH_DEG"><init val="70.0" uom="F" /></p>
     <p id="CLISPC" editor="I_CLISPC_DEG"><init val="74.0" uom="F" /></p>
     <p id="CLIFS"  editor="I_TSTAT_FAN_MODE"><init val="0" uom="99" /></p>
     <p id="CLIMD"  editor="I_TSTAT_MODE"><init val="74.0" uom="98" /></p>
     <p id="CLNRT"  editor="I_CLNRT"><init val="0" uom="25" /></p>
  </linkdef>

  <!--
       LinkDefs for Controllers

       NOTE: linkdef's referenced in the <ctl> section of the <links> section of a <nodedef>
             are currently only used to indicate the 'protocol' the controller supports
             Therefore in this example, we don't really need to distinguish between
             I_CTL_DIMMER and I_CTL_RELAY (we could just have I_CTL & I_CTL_ADV).

   -->

  <!-- Dimmer controller -->
  <linkdef id="I_CTL_DIMMER" protocol="I_STD" />
  <linkdef id="I_CTL_DIMMER_ADV" protocol="I_STD_ADV" />

  <!-- Relay controller -->
  <linkdef id="I_CTL_RELAY" protocol="I_STD" />
  <linkdef id="I_CTL_RELAY_ADV" protocol="I_STD_ADV" />

The following example shows how to define a link that can accept any command rather than just parameters with an implied command. For example, the Aeon minimote allows native links where you can specify any command that the responder can accept. This makes any command supported in the <accepts> section of the nodedef for a responder available for use in the link (except for commands explicitly defined as non-native).

  <!-- LinkDef that allows controller to directly send a different command to each responder -->
  <linkdef id="ASSOC_CMD" protocol="ASSOC_CMD" cmd="true" />