ph_insteon PowerHome formula function
Description
Send a standard length Insteon command.
Syntax
ph_insteon ( id, cmd1, cmd2 )
Argument Description
id String. The ID of the Insteon device to send commands to.
cmd1 Integer. The command 1 value. { decimal 17-20 or "i" value tags (see Usage below) can be used}
cmd2 Integer. The command 2 value. {0=off; 255=max brightness}
Return value
Integer. Returns a 0 if successful. Returns - 100 if the ID cannot be found. -1 is returned if the controller is not available, -2 is returned if the controller does not support Insteon.
Usage
Use this funciton to send Insteon commands directly to a single device. Valid commands are 17 for on, 18 for fast on, 19 for off, 20 for fast off, 21 to brighten, 22 to dim, and 25 for status. You can also use the enumerated values: ion, ifaston, ioff, ifastoff, ibright, idim, istatus. Set cmd2 to 0 for all cmd1 values except on (17). When sending an "on" command, set the cmd2 value to an integer between 0 and 255 for the level to go to.
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_insteon("MID CHANDELIER",ifaston,0) --> NOTE: With 'ifaston' the cmd2 value can be anything.
• ph_insteon("MID CHANDELIER",17,0.25*255) --> NOTE: Math can be used in the cmd2 field. Thus 0.25*255 equals 25% brightness.
• ph_insteon("[LOCAL4]",ifastoff,0)
• ph_insteon("{LAST-LITE}",ion,[LOCAL1]*2.55)