I find the C4 automation to be totally superior to anything else for AV control, and Indigo to be superior for lighting (at about 1/3 the price). I wanted Indigo to know when the TV in a specific room is on, the source, if paused, etc. Here's a simple driver I wrote that allows this to work. It simply allows a control4 director (home controller) to change Indigo variables using IWS. It requires Control4 2.3+. It takes a little work, but you can do some cool stuff. Note, you must not have authentication on in IWS for this to work. Since I couldn't attach .c4i files or .zip files, here is the plaintext driver inline. Just save it to a .c4i file and load it in composer.
- Code: Select all
<devicedata>
<copyright>Copyright 2008 CT. All rights reserved.</copyright>
<creator>CT</creator>
<manufacturer>Perceptive Automation</manufacturer>
<name>Set Indigo variables driver</name>
<model>Indigo IWS</model>
<created>01/04/2008 12:30 PM</created>
<modified>05/27/2013 11:31 AM</modified>
<version>1</version>
<top>
</top>
<bottom>
</bottom>
<front>
</front>
<back>
</back>
<left>
</left>
<right>
</right>
<control>lua_gen</control>
<controlmethod>other</controlmethod>
<driver>DriverWorks</driver>
<states />
<combo>True</combo>
<OnlineCategory>others</OnlineCategory>
<proxies qty="1">
<proxy>Indigo_IWS</proxy>
</proxies>
<config>
<power_management_method>AlwaysOn</power_management_method>
<power_command_delay>0</power_command_delay>
<power_delay>0</power_delay>
<power_command_needed>False</power_command_needed>
<documentation>
Driver to set variables on Indigo IWS from C4 events \n\n
1) Add driver to project \n
2) Enter the IP Address and port of your IWS server \n
3) Enter the Indigo variable name you want to change\n
4) In composer programming, execute Set Indigo Variable from any event\n
5) In Set Indigo Variable, set the variable as needed. (Note that you'll need to re-drag the command if you want to chagne the value).\n
6) When event fires, Indigo variable will be set from C4 director (via IWS)\n
/n
NOTES: \n
- You cannot have a password on your IWS server \n
- No invalid chars (spaces) in value \n
\n
Version 1 = Driver Release \n
TODO: \n
- User / pass \n
- don't send blank variables
</documentation>
<script><![CDATA[--------------- Driver Functions --------------
-------------- Called by Director -------------
function ExecuteCommand(strCommand, tParams)
if (strCommand == "Set Indigo Variables") then
for ParamName, ParamValue in pairs(tParams) do
GenerateURL ("Indigo Variable", ParamValue)
print("Sending URL: " .. URL)
C4:urlGet(URL)
end
end
if strCommand == "LUA_ACTION" then
if (tParams.ACTION == "GENERATE_URL") then
GenerateURL("Indigo Variable", "TestValue")
print("Sending URL: " .. URL)
C4:urlGet(URL)
end
end
end
---------------- Utility -----------------
function GenerateURL (IndigoVarName, IndigoVarValue )
URL = "http://" .. Properties["IWS IP Address"] .. ":" .. Properties["IWS Port"] .. "/variables/" ..Properties[IndigoVarName] .. "?_method=put&value=" .. IndigoVarValue
end
-------------- Init --------------
URL = ""
-------------- End Init ----------
-------------- Unused ------------
function ListParams()
if (tParams ~= nil) then
for ParamName, ParamValue in pairs(tParams) do
print("Variables:" .. ParamName, ParamValue)
end
end
end]]></script>
<actions>
<action>
<name>Generate Test URL</name>
<command>GENERATE_URL</command>
</action>
</actions>
<commands>
<command>
<name>Set Indigo Variables</name>
<description>Set variables in indigo</description>
<params>
<param>
<name>Variable 1</name>
<type>STRING</type>
<readonly>False</readonly>
<default>
</default>
</param>
</params>
</command>
</commands>
<properties>
<property>
<name>IWS IP Address</name>
<type>STRING</type>
<readonly>False</readonly>
<default>192.168.1.1</default>
</property>
<property>
<name>IWS Port</name>
<type>STRING</type>
<readonly>False</readonly>
<default>8176</default>
</property>
<property>
<name>Indigo Variable</name>
<type>STRING</type>
<readonly>False</readonly>
<default>C4RoomStatus</default>
</property>
</properties>
</config>
</devicedata>
Let me know if there are any issues.
Next on my list is a virtual lightswitch driver for control4 that will allow you to instantiate lights in C4 that are actually controlled by Indigo. Getting C4 to know state when they are changed in indigo or locally is a little challenging, but I think it's possible.