Issuing the command "powerlinc help" shows the following help text:
usage: powerlinc [-d] [-v][ ...] powerlinc [ help | listen | test | prog= ] -d turn on debugging output -v turn on verbose output -q quiet, turn off all non-error output is [ ... ] is [ ... ] is Hn or Hn,p,q... where H is a housecode A-P and n,p,q are unit codes 1-16 is [ on off bright dim statreq ddim=n ] where n is percent brightness 0-100 prog= issue command sequence for module programming, where is [ clear setramp defonlevel addscene delscene rampscene ] test issue hardcoded test pattern (for debugging only) listen loop listening on serial port and report traffic seen help show this message EXAMPLE: powerlinc e7,8 on e7 dim dim dim
Here are a few examples of using the "powerlinc" script...
Turning module "C1" (housecode C, unitcode 1) off, turning it on, setting it to a particular dim level, then making it brighter by one level and then dimmer by two levels:
powerlinc C1 off powerlinc C1 on powerlinc C1 ddim=50% powerlinc C1 bright bright powerlinc C1 dim dim dim
Note: you must issue one more dim/bright than the number of levels to change, so to brighten by one level, issue two consecutive "bright" commands, and to dim by two levels, issue three "dim" commands.
You can specify a bunch of units, then commands, more units, more commands...
powerlinc C1 D4 off E5 ddim=35%
Note on direct dim: the "ddim" command above uses the standard X10 protocol's "direct dim", and not the extended X10 protocol. This will work with Smarthome modules. Other manufacturers' modules may need the extended protocol; you'll need to check and experiment.
You can issue a status request to 2-way-capable modules. This command uses the standard X10 protocol's status request command:
powerlinc E5 statreqAnswers something like:
E5 E-statreq E5 ddim=35%
The 1132B reports on any X10 traffic it sees on the wire. To listen and report:
powerlinc listenReports something like:
E7 E-off E3 E-on(and continues until interrupted.)
The Smarthome modules are programmed by sending sets of house/unit codes out onto the line as commands. For more information, refer to the owner's manual that comes with your modules. For example, to add a secondary code (scene membership) of C1 to module B9 at "on level" 30%, I would use these commands in my script, and they would issue the following X10 codes:
Typing this command: | issues these codes: |
---|---|
powerlinc prog=clear | O16 N16 M16 P16 M16 |
powerlinc B9 ddim=30 | B9 B-(level=9 ddim-high) |
powerlinc prog=addscene | M16 N16 O16 P16 |
powerlinc C1 on | C1 C-on |
Use "-v" to see the data bits and bytes as they are sent and received. Here's an example command and its output:
# powerlinc -v e5 statreq powerlinc: issue_x10_standard_address hc=E, u=5 powerlinc: >>> 1 byte powerlinc: 1 0 0 0 0 0 0 1 0 (0x02) Ready? powerlinc: <<< 2 bytes powerlinc: 1 0 0 0 0 0 1 1 0 (0x06) ACK powerlinc: 2 0 0 0 0 1 1 0 1 (0x0D) EOT powerlinc: >>> 6 bytes powerlinc: 1 1 0 0 0 0 0 0 0 (0x80) Send ext x10 powerlinc: 2 0 0 0 0 0 1 0 0 (0x04) bytecount=4 powerlinc: 3 1 1 1 0 0 1 0 1 (0xE5) literal bits powerlinc: 4 0 1 1 0 0 1 0 1 (0x65) literal bits powerlinc: 5 0 1 1 0 0 1 0 0 (0x64) literal bits powerlinc: 6 0 0 0 0 0 0 0 0 (0x00) literal bits powerlinc: <<< 5 bytes powerlinc: 1 0 1 0 0 0 1 0 1 (0x45) EXT_CMD_UNDOC powerlinc: 2 0 1 0 0 0 0 0 1 (0x41) housecode='E' powerlinc: 3 0 1 0 0 0 0 1 0 (0x42) unit='5' powerlinc: 4 0 0 1 1 0 0 0 1 (0x31) repeat='1' powerlinc: 5 0 0 0 0 1 1 0 1 (0x0D) EOT powerlinc: E5 powerlinc: issue_x10_standard_command hc=E, cmd=statreq, level=NOLEVEL powerlinc: >>> 1 byte powerlinc: 1 0 0 0 0 0 0 1 0 (0x02) Ready? powerlinc: <<< 1 bytes powerlinc: 1 0 0 0 1 0 1 0 1 (0x15) NAK powerlinc: >>> 1 byte powerlinc: 1 0 0 0 0 0 0 1 0 (0x02) Ready? powerlinc: <<< 1 bytes powerlinc: 1 0 0 0 1 0 1 0 1 (0x15) NAK powerlinc: >>> 1 byte powerlinc: 1 0 0 0 0 0 0 1 0 (0x02) Ready? powerlinc: <<< 2 bytes powerlinc: 1 0 0 0 0 0 1 1 0 (0x06) ACK powerlinc: 2 0 0 0 0 1 1 0 1 (0x0D) EOT powerlinc: >>> 6 bytes powerlinc: 1 1 0 0 0 0 0 0 0 (0x80) Send ext x10 powerlinc: 2 0 0 0 0 0 1 0 0 (0x04) bytecount=4 powerlinc: 3 1 1 1 0 0 1 0 1 (0xE5) literal bits powerlinc: 4 0 1 1 0 1 0 1 0 (0x6A) literal bits powerlinc: 5 1 0 1 0 1 0 0 0 (0xA8) literal bits powerlinc: 6 0 0 0 0 0 0 0 0 (0x00) literal bits powerlinc: <<< 15 bytes powerlinc: 1 0 1 0 0 0 1 0 1 (0x45) EXT_CMD_UNDOC powerlinc: 2 0 1 0 0 0 0 0 1 (0x41) housecode='E' powerlinc: 3 0 1 0 1 1 1 1 1 (0x5F) func='statreq' powerlinc: 4 0 0 1 1 0 0 0 1 (0x31) repeat='1' powerlinc: 5 0 0 0 0 1 1 0 1 (0x0D) EOT powerlinc: E-statreq powerlinc: 6 0 1 0 0 0 1 0 1 (0x45) EXT_CMD_UNDOC powerlinc: 7 0 1 0 0 0 0 0 1 (0x41) housecode='E' powerlinc: 8 0 1 0 0 0 0 1 0 (0x42) unit='5' powerlinc: 9 0 0 1 1 0 0 0 1 (0x31) repeat='1' powerlinc: 10 0 0 0 0 1 1 0 1 (0x0D) EOT powerlinc: E5 powerlinc: 11 0 1 0 0 0 1 0 1 (0x45) EXT_CMD_UNDOC powerlinc: 12 0 1 0 0 1 0 0 1 (0x49) level=9/31 powerlinc: 13 0 1 0 1 0 1 0 1 (0x55) func='ddim-high' powerlinc: 14 0 0 1 1 0 0 0 1 (0x31) repeat='1' powerlinc: 15 0 0 0 0 1 1 0 1 (0x0D) EOT powerlinc: ddim=29%
2004 (c) Anne Bennett <anne.powerlinc@porcupine.ca>