Heyu

From Omnia
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

heyu

Connect to controller through serial - CM11A interface

heyu info
heyu on a1
heyu dim A2 10
heyu bright A2 10
heyu off a1
heyu status b2

References:

state engine

start state engine:

heyu engine
heyu start  # same as engine
heyu restart
heyu enginestate  # 1 or 0
heyu onstate a1  # or "offstate"
heyu dimstate a1  # or "offstate"
heyu dimlevel a1
heyu stop

installation

mkdir -p ~/.src ; cd ~/.src
wget http://heyu.org/download/heyu-2.10.tar.gz
tar xf heyu-2.10.tar.gz
cd heyu-2.10
sh ./Configure
make
# ... note this will take several minutes!

sudo make install
# select '3' - In directory /etc/heyu  (for system-wide access)
# select '/dev/ttyUSB1'
# configure - auto started by make install
#./install.sh
# add user to dialout group (group write to /dev/ttyUSB1
sudo usermod -a -G dialout kenneth
# verify connection (may need to logout and back in)
heyu info

If you want to PREFIX, you have to manually hack the generated Makefile near the top:

BIN = /usr/local/bin
MAN = /usr/local/man/man1
MAN5 = /usr/local/man/man5

Uninstall:

make uninstall

References:

cm11a connection

dmesg:

usb 4-5: new full speed USB device using ohci_hcd and address 4
usb 4-5: configuration #1 chosen from 1 choice
drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303
pl2303 4-5:1.0: pl2303 converter detected
usb 4-5: pl2303 converter now attached to ttyUSB1
usbcore: registered new driver pl2303
drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver

info

heyu info
# heyu info
starting heyu_relay
04/11 08:52:08  Poll received unknown value (1 bytes), leading byte = a5
Heyu version 2.10
Configuration at /etc/heyu/x10.conf
Powerline interface on /dev/ttyUSB0
Firmware revision Level = 1
Interface battery usage = Unknown
Raw interface clock: Fri, Day 100, 07:52:07
(--> Civil Time: Fri 11 Apr 2014   08:52:07 MDT)
No schedule has been uploaded by Heyu.
Housecode = A
0 = off, 1 = on,               unit  16.......8...4..1
Last addressed device =       0x0000 (0000000000000000)
Status of monitored devices = 0x0000 (0000000000000000)
Status of dimmed devices =    0x0000 (0000000000000000)

init.d

init.d, based off of Jira startup script:

#!/bin/bash

BIN=/usr/local/bin/heyu

case "$1" in
    start)
        $BIN engine
        ;;
    stop)
        $BIN stop
        ;;
    restart)
        $BIN restart
        ;;
    status)
        $BIN enginestate
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
        ;;
esac

debian init.d:

#!/bin/bash

### BEGIN INIT INFO
# Provides: heyu
# Required-Start: $local_fs $syslog $remote_fs
# Required-Stop: $remote_fs
# Default-Start:  2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start heyu service
# Description: Monitor X10 commands
### END INIT INFO

BIN=/usr/local/bin/heyu

case "$1" in
    start)
        $BIN engine
        ;;
    stop)
        $BIN stop
        ;;
    restart)
        $BIN restart
        ;;
    status)
        $BIN enginestate
        ;;
    *)
        echo "Usage: $0 {start|stop|restart|status}"
        exit 1
        ;;
esac

monitor

Monitor

heyu engine
heyu monitor
04/11 20:51:43  sndc addr unit       1 : hu A1  (_no_alias_)
04/11 20:51:43  sndc func           On : hc A
04/11 20:51:48  sndc addr unit       1 : hu A1  (_no_alias_)
04/11 20:51:49  sndc func          Off : hc A
04/11 14:25:52  sndc addr unit       1 : hu A1  (_no_alias_)
04/11 14:25:53  sndc func       Bright : hc A bright %100 [210+]
04/11 14:27:02  sndc addr unit       1 : hu A1  (_no_alias_)
04/11 14:27:03  sndc func       Bright : hc A bright %100 [210+]
04/11 14:27:07  sndc func          Dim : hc A dim %01 [~2]

change cm11a housecode

Change CM11A Housecode

heyu reset [housecode]
heyu reset C
heyu info

issues

Unable to send address bytes

If you got the error, like this:

tarting heyu_relay
Unable to send address bytes

maybe the X10 computer interface is not connected properly. If you are using USB-RS232 converter, try to plug-unplug the converter to solve this "freezing" problem.

References:

keywords