NAV
lua

License, Copyright, and Trademark

The content contained in this repository is the intellectual property of Snap One, LLC, (formerly known as Wirepath Home Systems, LLC), and use without a valid license from Snap One is strictly prohibited. The user of this repository shall keep all content contained herein confidential and shall protect this content in whole or in part from disclosure to any and all third parties except as specifically authorized in writing by Snap One.

License and Intellectual Property Disclaimer

The content in this repository is provided in connection with Snap One products. No license, express or implied, by estoppal or otherwise, to any intellectual property rights is granted by this document or in this repository. Except as provided in Snap Oneʼs terms and conditions for the license of such products, Snap One and its affiliates assume no liability whatsoever and disclaim any express or implied warranty, relating to the sale and/or use of Snap One products including liability or warranties relating to fitness for a particular purpose, merchantability, or infringement of any patent, copyright or other intellectual property right. Snap One products are not intended for use in medical, lifesaving, or life sustaining applications.

Information regarding third-party products is provided solely for educational purposes. Snap One is not responsible for the performance or support of third-party products and does not make any representations or warranties whatsoever regarding the quality, reliability, functionality or compatibility of these products. The reader is advised that third parties can have intellectual property rights that can be relevant to this repository and the technologies discussed herein, and is advised to seek the advice of competent legal counsel regarding the intellectual property rights of third parties, without obligation of Snap One.

Snap One retains the right make changes to this repository or related product specifications and descriptions in this repository, at any time, without notice. Snap One makes no warranty for the use of this repository and assumes no responsibility for any errors that can appear in the repository nor does it make a commitment to update the content contained herein.

Copyright

Copyright 2024 Snap One, LLC. All rights reserved.

The above copyright notice applies to all content in this repository unless otherwise stated explicitly herein that a third-party’s copyright applies.

No part of this publication may be reproduced, photocopied, stored on a retrieval system, or transmitted without the express written consent of the publisher.

Trademarks

Snap One and Snap One Logo, Control4 and the Control4 logo, and DriverWorks are trademarks or registered trademarks of Snap One, LLC. Other product and company names mentioned in this repository may be the trademarks or registered trademarks of their respective owners.

 Derivative Works

To the extent that you create any “Derivative Work” (meaning any work that is based upon one or more preexisting versions of the work provided to you in this repository, such as an enhancement or modification, revision, translation, abridgement, condensation, expansion, collection, compilation or any other form in which such preexisting works may be recast, modified, transformed or adapted, explicitly including without limitation, any updates or changes to Snap One, LLC’s software code or intellectual property) such Derivative Work shall be owned by Snap One, LLC and all right, title and interest in and to each such Derivative Work shall automatically vest in Snap One, LLC. To the extent any Derivative Work does not automatically vest in Snap One, LLC by operation of law, you hereby assign such Derivative Work to Snap One, LLC with full title guarantee. Snap One, LLC shall have no obligation to grant you any right in any such Derivative Work.

Contact Us

Snap One, LLC 11734 S. Election Road Salt Lake City, UT 84020 USA

http://www.control4.com

Introduction

Contact Proxy Overview

This area of the Proxy and Protocol Guide contains information for a developing a Contact driver. Contacts are unique in how they are handled within Control4's architecture. Contact drivers do not rely upon a proxy as most traditional drivers do. In the most simple use case, a contact driver is added to a project to provide icons on devices running Navigator for the contacts' state (open and close) or a change to that state. An example of this type of driver can be seen in the contactsingle_contactswitch.c4i file. In a typical ComposerPro installation, this driver can be found in the following directory:

C:\Program Files\Control4\Composer###\Drivers\Virtual

Opening this driver in a text editor and reviewing several of the driver components is helpful in order to understand how a simple contact driver is used. To begin with, line 46 of this driver defines its proxy type. The value entered here is the filename of the driver without the .c4i file extension:

<proxy>contactsingle_contactswitch_c4</proxy>

The filename of the driver is used in the proxy tag because this driver does not reference a defined Control4 proxy. This is a required convention for all “Combo-drivers”. Populating the proxy tag in this manner is required for the driver to work.

The next section of code to review is the states section where icons are included. Beginning with line 49 we can see that this driver has two states: Open and Closed. These states are supported by icons that are loaded onto the controller upon installation of ComposerPro. The icons to the right represent the default icon for a contact switch:

<states>
   <state>
    <id>1</id>
    <small>devices_sm\contactsingle_contactswitch_open.gif</small>
    <large>devices_lg\contactsingle_contactswitch_open.gif</large>
   </state>
   <state>
     <id>2</id>
     <small>devices_sm\contactsingle_contactswitch_close.gif</small>
     <large>devices_lg\contactsingle_contactswitch_close.gif</large>
   </state>
</states>

Default icons vary based on the type of contact being represented by the driver. In the example to the right, if we look at the states section from the contactsingle_gate_c4i file (located in the same directory) we'll see different icons being used:

<states>
   <state>
    <id>1</id>
    <small>devices_sm\contactsingle_gate_open.gif</small>`
    <large>devices_lg\contactsingle_gate_open.gif</large>`
   </state>
   <state>
    <id>2</id>
    <small>devices_sm\contactsingle_gate_close.gif</small>`
    <large>devices_lg\contactsingle_gate_close.gif</large>`
   </state>
</states>

Next, to the right we can examine the connection section of this driver we see the following:

<connections>
   <connection>
     <id>1</id>
     <facing>6</facing>
     <connectionname>Contact Sensor</connectionname>
     <type>1</type>
     <consumer>True</consumer>
     <audiosource>False</audiosource>
     <videosource>False</videosource>
     <linelevel>False</linelevel>
     <classes>
      <class>
       <classname>CONTACT_SENSOR</classname>
      </class>
    </classes>
   </connection>
</connections>

All of the stock contact drivers use a connection type of 1. This is a control connection type and a requirement for the driver.

Finally, the last piece of driver code which needs to be considered is the control tag. If we look at the control value for the contact driver we see the following:

<control>control4_contactsingle</control>

Populating the control tag with the control4_contactsingle value in this manner is required for the driver to work.

Control4 provides stock contact drivers for the following devices:

If the device that you would like to include in a ComposerPro project falls under one of the device types listed above, it can easily be supported through one of the stock contact drivers delivered through ComposerPro. This assumes, that your driver needs consist of a simple communication protocol which will reflect contact state on UI devices using stock icons. Driver needs that fall outside of the scope of this document are currently not supported through the Contact driver architecture.

What’s New

What’s New in 3.4.2

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.4.2.

What’s New in 3.4.1

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.4.1.

What’s New in 3.4.0

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.4.0.

What’s New in 3.3.2

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.3.2.

What’s New in 3.3.1

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.3.1.

What’s New in 3.3.0

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.3.0.

What’s New in 3.2.3

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.2.3.

What’s New in 3.2.2

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.2.2.

What’s New in 3.2.1

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.2.1.

What’s New in 3.2.0

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.2.0.

What was New in 3.1.2

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.1.2.

What was New in 3.1.0

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.1.0.

What was New in O.S.3

There were no modifications to the Contact Proxy in conjunction with O.S. Release 3.0.0.

Contact Notifications

CLOSED

Contact has closed.

Signature

CLOSED ()

Parameters

None

Returns

None

OPENED

Contact has opened.

Signature

OPENED ()

Parameters

None

Returns

None

STATE_CLOSED

Contact remains in the closed state.

Signature

STATE_CLOSED ()

Parameters

None

Returns

None

STATE_OPENED

Contact remains in the opened state.

Signature

STATE_OPENED ()

Parameters

None

Returns

None

lua