I have zero experience with AppleScript, let alone writing scripts for Indigo, so I'm hoping the experts on this forum can help. In particular, how do I obtain the ack code sent by an Insteon device? How do you specify hex values in AppleScript -- the 0x prefix doesn't work and I can't find any good AppleScript documentation online.
After fine-tuning this code, my next step will be to set the X10-to-Insteon translation table.
George
- Code: Select all
--First crack at a script to set the X10 filter on the EZX10RF module
--by George Musser
--27 Jan 08
set addressEZ to "0C.AF.7D" -- Insteon address of EZX10RF module
tell application "IndigoServer"
--set high byte of memory address for subsequent commands
send insteon raw cmd1 40 cmd2 0 to address addressEZ
--set the registers
--cycle through the 2-byte registers associated with each X10 house code
repeat with memoryLocation from 6 to 7 -- as a test case, use house code B
--specify the low byte of the address
send insteon raw cmd1 43 cmd2 memoryLocation to address addressEZ
--here we should look for an ack (in this case, 0x2B followed by the current register value) but I don't know how to do that; the Indigo Event Log lists the ack code
--poke in a 0 value, which turns off filtering for all the unit codes
--to enable a unit code, poke a 1 bit at the bit corresponding to the unit
--e.g. 4 corresponds to unit code 3
send insteon raw cmd1 41 cmd2 0 to address addressEZ
--in this case, the ack should be the poked value
end repeat
end tell