Trouble configuring z-wave Aeotec USB key

Hi everybody, I’m trying to configure the Aeotec Z-stick Gen5 and I can’t get it to work.
I have homeassistant installed in a docker on a QNAP NAS and it is up and running.
When I added the following line to the configuration
zwave:
usb_path: /dev/ttyUSB0

and installed the USB key, I got this error:

2017-08-27 21:09:56 ERROR (MainThread) [homeassistant.setup] Error during setup of component zwave
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/openzwave/option.py”, line 78, in init
raise ZWaveException(u"Can’t find device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
openzwave.object.ZWaveException: “Zwave Generic Exception : Can’t find device /dev/ttyUSB0 : [‘NoneType: None\n’]”

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/app/homeassistant/setup.py”, line 194, in _async_setup_component
component.setup, hass, processed_config)
File “/usr/local/lib/python3.6/asyncio/futures.py”, line 332, in iter
yield self # This tells Task to wait for completion.
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 250, in _wakeup
future.result()
File “/usr/local/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/zwave/init.py”, line 263, in setup
config_path=config[DOMAIN].get(CONF_CONFIG_PATH))
File “/usr/local/lib/python3.6/site-packages/openzwave/option.py”, line 81, in init
raise ZWaveException(u"Error when retrieving device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
openzwave.object.ZWaveException: ‘Zwave Generic Exception : Error when retrieving device /dev/ttyUSB0 : [‘Traceback (most recent call last):\n’, ’ File “/usr/local/lib/python3.6/site-packages/openzwave/option.py”, line 78, in init\n raise ZWaveException(u"Can\‘t find device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))\n’, ‘openzwave.object.ZWaveException: “Zwave Generic Exception : Can\'t find device /dev/ttyUSB0 : [\‘NoneType: None\\\\n\’]”\n’]’
2017-08-27 21:10:18 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 182, in _step
result = coro.throw(exc)
File “/usr/src/app/homeassistant/components/discovery.py”, line 124, in scan_devices
results = yield from hass.async_add_job(_discover, netdisco)
File “/usr/local/lib/python3.6/asyncio/futures.py”, line 332, in iter
yield self # This tells Task to wait for completion.
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 250, in _wakeup
future.result()
File “/usr/local/lib/python3.6/asyncio/futures.py”, line 245, in result
raise self._exception
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/discovery.py”, line 150, in _discover
netdisco.scan()
File “/usr/local/lib/python3.6/site-packages/netdisco/discovery.py”, line 69, in scan
self.daikin.scan()
File “/usr/local/lib/python3.6/site-packages/netdisco/daikin.py”, line 32, in scan
self.update()
File “/usr/local/lib/python3.6/site-packages/netdisco/daikin.py”, line 46, in update
sock.bind(("", UDP_SRC_PORT))
OSError: [Errno 98] Address already in use
2017-08-27 22:15:58 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal error on transport TCPTransport (error status in uv_stream_t.read callback)
OSError: [Errno 113] No route to host

I can’t figure out what the problem is, can anybody help?

Thanks!

Did you add “–device=/dev/ttyUSB0” in docker run command?
This would cause “USB not found error”

Also looks like docker is trying to bind to used port on host or in container.
/daikin.py”, line 46, in update
sock.bind(("", UDP_SRC_PORT))
OSError: [Errno 98] Address already in use

Thanks for helping!
To be honest I don’t know where I should add that to the run command, in qnap there is just a button to start the container…
Also how I can find which port is causing the problem?

Thanks again for the help

I found instructions to add the -device… to the run command and now I have some different error

2017-09-01 02:39:31 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved Traceback (most recent call last): File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 182, in _step result = coro.throw(exc) File “/usr/src/app/homeassistant/components/discovery.py”, line 124, in scan_devices results = yield from hass.async_add_job(_discover, netdisco) File “/usr/local/lib/python3.6/asyncio/futures.py”, line 332, in iter yield self # This tells Task to wait for completion. File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 250, in _wakeup future.result() File “/usr/local/lib/python3.6/asyncio/futures.py”, line 245, in result raise self._exception File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 55, in run result = self.fn(*self.args, **self.kwargs) File “/usr/src/app/homeassistant/components/discovery.py”, line 150, in _discover netdisco.scan() File “/usr/local/lib/python3.6/site-packages/netdisco/discovery.py”, line 69, in scan self.daikin.scan() File “/usr/local/lib/python3.6/site-packages/netdisco/daikin.py”, line 32, in scan self.update() File “/usr/local/lib/python3.6/site-packages/netdisco/daikin.py”, line 46, in update sock.bind(("", UDP_SRC_PORT)) OSError: [Errno 98] Address already in use 2017-09-01 10:13:35 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal error on transport TCPTransport (error status in uv_stream_t.read callback) OSError: [Errno 113] No route to host

I still don;t see z-wave

It’d help a lot if you followed the guidance in the big blue box at the top (of every page on this site) for formatting your post. Reading a wall of text is hard.

That said, there’s your problem:

There’s probably more data in your log, possibly even in the blob you posted, that’ll help identify what’s going on.

I read the instructions but still not clear on how i’m supposed to format a log file. I have read about code, lists links and such but there was nothing i could see about log files.

Thanks a lot for pointing to the OSError, but just saying that’s your problem doesn’t really help me much.I can read it myself but I don’t know what to do about it and what the meaning of it is.

Post your log to something like pastebin, hastebin, or similar, then it’ll be correctly formatted. Small snippets (a dozen lines or so) can be posted here by using the </> button to format it correctly.

The OSError, with a correctly formatted log, tells us that something else is using a port that HA is trying to use. With a correctly formatted log we’ll be able to help you find out what’s going on. We’ll probably need your configuration.yaml file too (remember to remove any passwords and anything else you consider sensitive).

Thanks, I am assuming that hastebin and similars are free downloads?

They’re websites, try Google :wink:

https://hastebin.com/
https://pastebin.com/

OK, that’s my try at it, it’s the link to the hastebin where I copied the log file, next I will add the configuration file
https://hastebin.com/nigujaxogi.sql

First problem found:

Can't find device /zwaveusbstick

In your configuration file, that needs to be the actual path to your stick, which will start /dev/ and may be /dev/ttyUSB0.

This is the link to my configuration

https://hastebin.com/sedocamiwu.makefile

When I set the path for it I did after following the instructions at the best I could understand.
I did run the lsusb command to find out

Interesting, your configuration file disagrees with the error message:

zwave:
  usb_path: /dev/ttyACM0

So, the question is, what do the following commands show:

ls -l /dev/ttyACM*
ls -l /dev/ttyUSB*

I take it you read these instructions?

Yes I did, but I had a problem with the command:

$ sudo apt-get install libudev-dev

I will run those commands again because I don’t remember exactly, i did try them on several occasions

You didn’t answer my question:

So, the question is, what do the following commands show:

ls -l /dev/ttyACM*
ls -l /dev/ttyUSB*

As I said I needed to run them again and I have to do it on another PC because for some reason Putty doesn’t work on this.

https://hastebin.com/hotifeyoya.pl

I also stopped and restarted the docker and now the log file is this:

https://hastebin.com/akazegezeg.sql

Part of your problem is that the group for the device is admin instead of homeassistant, or another group that homeassistant is a member of.

Try sudo chgrp homeassistant /dev/ttyACM0

Your other problem is going to be harder to diagnose, because you’re running it in Docker, on a NAS. Is there anything using port 8123 elsewhere on the NAS?

Thanks again, i tried the command but it told me unknown group homeassistant.
Is there a place where I should have set the group?
As far as the port, I had two other containers that I have removed just to see if anything would change, but nothing different happened.

Try: sudo id homeassistant. It’ll list the groups that homeassistant is part of, and then we can set one of those.

Once this is resolved, I’d suggest a fresh thread just about the port issue, mentioning Docker in the title. That way hopefully you’ll attract the attention of somebody who knows Docker.