ph_insteonwithret PowerHome formula function
Description
Send a standard length Insteon command and waits for the return value. The value returned will be the CMD2 value in the standard Insteon return string.
Syntax
ph_insteonwithret ( id, cmd1, cmd2 )
Argument Description
id String. The ID of the Insteon device to send commands to.
cmd1 Integer. The command 1 value. Use standard 0 to 255 for Insteon Direct commands. Add 1000 to the cmd1 value to send Group Cleanup commands.
cmd2 Integer. The command 2 value.
Return value
Integer. Returns the CMD2 value from the Insteon acknowledgement if successful (a positive value). Returns - 100 if the ID cannot be found. -1 is returned if the controller is not found, -2 is returned if the command fails due to timeout, -3 is returned if the controller is not connected, -4 is returned if the command fails due to NAK..
Usage
Use this funciton to send Insteon commands directly to a single device and retrieve the answering response. This is useful for working with non-lighting devices such as the EZIO8.
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_insteonwithret ("MID CHANDELIER",16,0)
• ph_insteonwithret ("OUT GDR EZIO2X4", 73, 0 )
• ph_insteonwithret("DWN-STAT",107,4)