Hassio Addon for Heyu and x10 - trouble working with HA x10 component

Hello,

I am very new to HA, Hassio, and Docker, so my apologies in advance if this question is off-base. As others have mentioned in the past, I have some x10 components I’d like to use with HA. Because I was getting the familiar FileNotFoundError: [Errno 2] No such file or directory: 'heyu': 'heyu', I did some research and found this entry from Nitroedge, so I thought I would try my hand at making a local addon to add Heyu capability.

Based on that thread, I created this Dockerfile:
ARG BUILD_FROM
FROM $BUILD_FROM

ENV LANG C.UTF-8

WORKDIR /build
RUN apk -U add curl build-base
&& curl -LsSO http://www.heyu.org/download/heyu-2.11-rc1.tar.gz
&& tar xzf heyu-2.11-rc1.tar.gz
&& cd heyu-2.11-rc1
&& ./configure --sysconfdir=/config
&& make
&& make install

RUN mkdir -p /usr/local/var/tmp/heyu
&& mkdir -p /usr/local/var/lock
&& chmod 777 /usr/local/var/tmp/heyu
&& chmod 777 /usr/local/var/lock

COPY run.sh /
RUN chmod a+x /run.sh
CMD [ “/run.sh” ]

… and this config.json file:
{
“name”: “Heyu x10 CLI”,
“version”: “0.0.1-SNAPSHOT-3”,
“slug”: “heyu”,
“description”: “Heyu add on to work with x10 component”,
“startup”: “application”,
“arch”: [ “armhf” ],
“boot”: “auto”,
“map”: [ “config:rw” ],
“devices”: [ “/dev/ttyUSB0:/dev/ttyUSB0:rwm” ],
“hassio_role”: “default”,
“options”: {},
“schema”: {}
}

…and this run script:
#!/bin/sh

chgrp dialout /dev/ttyUSB0 1>&2

if [ ! -f /config/heyu/x10.conf ]; then
pwd
ls -al 1>&2
echo “x10config.sample and x10.sched.sample have been copied to your config directory.” 1>&2
echo “Please use them to create x10.conf and x10.sched and re-run.” 1>&2
exit;
fi

heyu start 1>&2
heyu engine 1>&2
#heyu upload 1>&2
#heyu setclock 1>&2

echo “Turn on A5” 1>&2
heyu fon a5 1>&2
echo “Turn off A5” 1>&2
heyu foff a5 1>&2
echo “Test complete” 1>&2
#heyu monitor 1>&2

Additionally, I have some x10 component settings in my configuration.yml file.

The issue is that even though the addon does install and start - in fact, it even switches device A5 on and off - the x10 component is still not working. I am still getting the ‘no such file: heyu’ error. I have tried many rounds of uninstalling/reinstalling, restarting, and rebooting, to no avail. It seems that the HA system is not getting access to the heyu command (which should be in /usr/local/bin), for whatever reason. Is there a permissions or configuration issue going on here? Or perhaps Docker misconfiguration?

Thanks in advance for any help you may have to offer -

  • Ned

I don’t have any advice, but I’m trying to get this working now.

First weekend with HA/Hassio and it looks promising. I’m currently running a VirtualBox image of Hass.io on the family desktop. I’m new to Docker and VMs so this has been an educational weekend so far. Not new to X10, though.

I’ve been reading up on how Dockers make sockets, applications, and other communication available between them. Like you said, it may just be a simple permission or one line command to make it available. Can you drop the root prompt in Hassio-CLI (“login”) and run the heyu commands from there? That’s where I was going to start, but I’m not there yet.

I’m going to try Kevin Eye’s heyu docker image first and get a light on and off then try the rest of the HA /addon part working.

Good luck. I’ll post any results I have here too.

Hi Ned,
I got something to install. Trying to figure out where it put my config files so I can debug. Basically, I followed a different Dockerfile setup offered in an older thread based on Kevin Eye’s Docker build.

Based on what I’ve been reading, this straight build of heyu would run entirely in the container with no way to communicate outside to the Hass.io “controller?”. The calling container (again, the Hass.io controller) could call the heyu stuff and it can access the serial port, but Home Assistant can’t call heyu because they are isolated in the Docker containers.

The Kevin Eye Heyu Docker gets around some of this with a shell2http call which can forward the result of a shell script to a port (and vice versa) which can be let through the Docker isolation. So if I can verify this is working, then it will mean making symlinks or some other Linux magic to fake the heyu call from HA through this port setup.

So no success yet, but I’m happy to get the add on compiling and installing. Small victories here.