ph_x10btn PowerHome formula function
Description
Sends a full X10 standard command including addressing.
Syntax
ph_x10btn ( s, n, n )
Argument |
Description |
s
|
A string representing the ID of the X10 unit you wish to control.
|
n
|
The command you would like sent to the specified X10 ID. Valid values are 2 for on, 3 for off, 4 for dim, 5 for brighten, and 100 for absolute level. You may also use the enumerated types: xon, xoff, xdim, xbright, adim
|
n
|
The level you would like to use for commands 4, 5, and 100. Use a 0 for commands 2 and 3.
|
Return value
Integer. Returns a 0 if successful and 1 if an error occurred while retrieving information for the specified ID. This function requires that you have already defined an X10 device ID in the X10 Devices screen. In that screen, you will associate a controller with a particular housecode/unitcode. If you want to send raw X10 commands regardless of whether you’ve defined them in the X10 Device screen, use the ph_x10 function. This function is also handy when you want to set a light to a specific level. By setting the command to 100, PowerHome will attempt to set the lamp to the specified level. It will do this by using 1 of 3 available methods in the following order based upon the flag settings of the X10 device type. If the lamp supports extended commands, then a direct to level extended command will be generated. If the lamp supports preset dim, then the corresponding preset dim command will be sent. If extended and preset dim is not supported, then PowerHome will lookup the level it currently has stored and calculate the appropriate dimming or brightening necessary to set the light at the requested level.