Difference between revisions of "X10 Integration"
(uninstall section) |
m (update device count) |
||
Line 2: | Line 2: | ||
There is <b><big>unofficial</big></b> support for integration with X10 using the mochad package. | There is <b><big>unofficial</big></b> support for integration with X10 using the mochad package. | ||
− | <font color="red"><big>Usual disclaimer, use at your own risk. This has been tested on | + | <font color="red"><big>Usual disclaimer, use at your own risk. This has been tested on 3 devices so far to my knowledge, and I am not responsible if it breaks yours.</big></font> |
== Installation == | == Installation == |
Revision as of 05:22, 13 November 2014
There is unofficial support for integration with X10 using the mochad package.
Usual disclaimer, use at your own risk. This has been tested on 3 devices so far to my knowledge, and I am not responsible if it breaks yours.
Contents
Installation
You may install it manually by compiling from source, copying over the binaries, etc, or you can use opkg. Links are posted at the end for the manual method, I will simply state the opkg method here.
You can probably do most if not all of this from the OpenWRT web interface, but the method I am describing here requires ssh access and basic shell knowledge.
You may use my host as the package repo for opkg (just please don't hose it ^_^): http://remote.thejanky.org/mirrors/almondplus/packages/ To use this, edit /etc/opkg.conf in your favorite editor and replace the first url, as that one doesn't point anywhere. If you want to use the other unofficial repo, you can switch it back after you do this installation.
Then install some dependencies and mochad.
opkg update
opkg install libusb-1.0 usbutils
opkg install mochad
Udev does not currently have an init script, so we have to make one and start it:
cat <<EOF >/etc/init.d/udev
#!/bin/sh /etc/rc.common
START=38
start() {
/sbin/udevd --daemon
/sbin/udevadm trigger
/sbin/udevadm settle
}
EOF
chmod +x /etc/init.d/udev
/etc/init.d/udev enable
/etc/init.d/udev start
Finally, enable and start mochad:
/etc/init.d/mochad enable
/etc/init.d/mochad start
Using Mochad
To interact with mochad directly, you send commands via TCP on port 1099. The commands are of the form:
SYSTEM DEVICE COMMAND [PARAMETERS]
Systems
- AP - Almond Plus controlled devices
- RF - X10 RF module
- PL - X10 Powerline module
- LL - LimitlessLED module
Devices
All devices for each system should be supported.
- AP - Device id (numerical, 1, 2 ...)
- X10 RF/PL - X10 Device specification, House Code & Unit Code (e.g. A4, C6)
- LL - LimitlessLED group number (1-3)
Commands
- AP - The current list of supported commands (a bit out of date, should be updated with more soon):
To see your current device list with device IDs, look at /DeviceList.xml on your A+.
- X10 RF/PL - See mochad documentation (mostly what you would expect, "ON", "OFF", etc)
Example Commands
# Turn A+ device 1 on
echo "AP 1 on" | nc localhost 1099
# Turn A+ device 2 off
echo "AP 2 off" | nc localhost 1099
# Get switch status of A+ device 1 (ugly, I know)
echo "AP 1 get_val 1" | nc localhost 1099
Controlling Almond+ using X10 RF Controllers
If you want to be able to control LimitlessLED or Almond+ devices using X10 RF Controllers, you will need to modify the /etc/mochad.conf. This file specifies mappings from X10 device codes to Almond+ device and LLED group IDs.
To see your current device list with device IDs, look at /DeviceList.xml on your A+.
Uninstalling
You should be able to uninstall with opkg. You may have to delete the conf file manually (/etc/mochad.conf).
References
Related forum topics: http://forum.securifi.com/index.php/topic,1913.0.html http://forum.securifi.com/index.php/topic,615.msg7006.html#msg7006
Original Mochad project: http://sourceforge.net/projects/mochad/
My fork: https://sourceforge.net/u/armattillo/mochad/ci/master/tree/