Docker -> Home Asistant -> openzwave

Hi,

after a lot of trouble with open zwave and open zwave control panel i tried docker, i should have tried that earlier. That was working very easy after i understand docker a little bit. :slight_smile:

But now my next problen, to use zwave i need to compile openzwave on the machine i use home assistant, i had problems here with ubuntu 14 and openzwave to get it working. So that i now want to use a home assistant docker image.
My question now is, is there a image with openzwave compiled or a tutorial how to install openzwave on docker ubuntu?

Or any help with installing openzwave in home assistant docker to use my zwave devices? I got the zwave config file from openzwave control panel out of that machine so i can use that file.

I’m not really sure what you’re asking here, but the official homeassistant docker image already has openzwave built in.

Sebastian

oh really? great i did not know that.

You are talking about this one, correct?
https://hub.docker.com/r/homeassistant/home-assistant/

Can you maybe tell me how to make an update of the home assistant docker image if there is one available

Yes, that’s the one.
You shouldn’t need to update the image - that’s kind of the point of Docker :wink:
If you’re looking to get your openzwave options.xml file into the docker image - I explained it here:

If you really need to update the Docker image, you can build your own image based on it, e.g. use a Dockerfile like:

FROM homeassistant/home-assistant:latest
VOLUME /config
WORKDIR /usr/src/app

RUN <whatever you like>

CMD [ "python", "-m", "homeassistant", "--config", "/config" ]

Sebastian

So i do not need to do anything to get the last version of home assistant when it is available?

I need the option and the configuration file when i am right, how can i get both out of docker?

When a new HA version is released, an updated Docker image is usually available shortly after.
To update, you then need to shut down your running container, delete it, do a docker pull homeassistant/home-assistant to update your locally cached Docker image to the latest version and finally start a new container from that image.

The config directory is located outside the docker image.
You can use the the -v parameter for docker run ... to mount it to /config inside the running container.
Same goes for the /usr/src/app/build/python-openzwave/openzwave/config/options.xmlfile inside container that contains your ZWave security key.
I keep “my” options.xml file with the rest of my ha configuration.

Sebastian

I now tried to start with adapted config my docker image but getting error message.

docker: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:359: container init caused \\\"rootfs_linux.go:53: mounting \\\\\\\"/home/skycryer/config/options.xml\\\\\\\" to rootfs \\\\\\\"/var/lib/docker/aufs/mnt/1b6303fda331c632c06c59dae19a7f30a05c28605f9787448b18bc8bf874fc9f\\\\\\\" at \\\\\\\"/var/lib/docker/aufs/mnt/1b6303fda331c632c06c59dae19a7f30a05c28605f9787448b18bc8bf874fc9f/usr/src/app/build/python-openzwave/openzwave/config/options.xml\\\\\\\" caused \\\\\\\"not a directory\\\\\\\"\\\"\"\n".

Is that because i referenced a file? The first part is not throwing an error on start.

But without both i also can not get home assistant to work. Maybe i miss something in the run call.

Here my run command

sudo docker run --name "hass" --device=/dev/ttyUSB0 -v /home/skycryer/config:/config -v /home/skycryer/config/options.xml:/usr/src/app/build/python-openzwave/openzwave/config/options.xml homeassistant/home-assistant

Strange, it looks basically identical to how I start hass:

docker --log-level=warn run -d \
-p 0.0.0.0:8123:8123 \
--name="hass" \
-v /home/me/.homeassistant/:/config \
-v /etc/localtime:/etc/localtime:ro \
-v /home/me/.homeassistant/options.xml:/usr/src/app/build/python-openzwave/openzwave/config/options.xml \
--net=bridge \
--device=/dev/ttyACM0 \
homeassistant/home-assistant

That “not a directory” part irritates me a bit, because apparently -v works with single files too.

One thing I spotted: you use “--name "hass"” but it should be “--name="hass"” - with an equal sign.
Not sure if that’s an error or if docker’s argument parser understands that format too.

Sebastian

changing to --name=“hass” does not change anything, maybe it is an access problem between the sudo i use to start the container and the user inside the container? But i can access and edit the files like configuration.yaml

I’m out of ideas, but it’s probably not a sudo issue.
Have a look at this, maybe something sounds familiar:

https://forums.docker.com/t/solved-error-for-httpd-oci-runtime-error-rootfs-linux-go-53-mounting-to-rootfs-caused-not-a-directory/17509/3

Sebastian