Open Source Platform
for interconnected virtual worlds

How to Connect Home Automation - X10

From RexWiki

Contents

What is X10Manager

X10Manager is software which communicates with X10 home automation system through power socket and with reX via http connection. The idea is to establish connection between real life hardware and virtual world objects. You can exp. switch of/off your lamp on your desktop and the lamp object in virtual world will also turn on/off. It works as well in to another way so you can exp. touch an object in rex and the real life lamp turns on.

How to connect a computer to X10 system

Connect GM11 module to power outlet and connect the module to PC via serial connection cable. If your computer doesn't have serial port you can use usb to serial port adapter.

How to startup X10Manager

Start X10Manager in command prompt by typing X10Manager.exe <com port> <http port> [client address]

Where <com port>       is the serial port where the GM11 module is connected.
      http port>       is the http port number where reX should send X10 commands
     [client address]  if given the X10Manager will forward all messages from X10 system to this address
                       This is basically your rex server http address with a port number for X10 connection

for example X10Manager.exe com3 20000 http://localhost:30001


Connects X10Manager with GM11 module with serial port 'com3' and starts listening socket 20000 for incoming X10 messages from rex. It also will send all X10 messages received from X10 system to http//localhost:30001.
X10Manager is now ready to communicate with reX server and X10 system. You can get full list of console commands by typing "help" in X10Manager console. You can quit the X10manager by typing 'q' and hit the enter.
Note: On Windows Vista make sure that you open command prompt as Administrator.

How to configure rex server

In X10Connection class ( \bin\ScriptEngines\PythonScript\RXCore\rxX10.py ) change address and port number to correspond your reX server address and port for X10 connection. Make also sure that X10Manager server address is correct.

How to connect an object with real life hardware

  • Create an object
  • Set rex class name to sampleX10.Lamp
  • write the X10 device address to objects name field


After this your object state will change in every time you touch it. The color of object will change with objects state. You can create multiple objects with different device addresses.

How to modify object behaviour

The functionality is done with pyhton scripts so please check the chapter 3 first if you are unfamiliar with python scripts and reX.
See Lamp class in file \bin\ScriptEngines\PythonScript\Samples\sampleX10.py. In this class you have to define the switch on/off logic and state change behaviour.