Host /dev Symlink Not Visible to Hass.io Container

EDIT: I started bash inside the container and took a look at what /dev showed in there. The container does not have the symlink inside of it, just the actual device. I know I can’t set up a udev rule inside the container as it would not persist so I’m still unsure how to get this working.

Home Assistant is failing to connect to my Z-Stick G5 when I point it to /dev/zwave which is a symlink to the device that the Z-Stick mounts as. If it mounts as /dev/ttyACM0 and I put that in my config I have no problems with Z-Wave.

The Home Assistant log shows the following when trying to use /dev/zwave

2017-09-28 19:41:29 ERROR (MainThread) [homeassistant.setup] Error during setup of component zwave
Traceback (most recent call last):
  File "/usr/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/zwave : ['NoneType: None\\n']"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 194, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.6/asyncio/futures.py", line 331, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 244, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 244, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/zwave/__init__.py", line 269, in setup
    config_path=config[DOMAIN].get(CONF_CONFIG_PATH))
  File "/usr/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/zwave : [\'Traceback (most recent call last):\\n\', \'  File "/usr/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/zwave : [\\\'NoneType: None\\\\\\\\n\\\']"\\n\']'

And just to be sure that this error is not because the device really doesn’t exist on startup, I tried restarting Home Assistant after ensuring that /dev/zwave exists.

Some more info:

╭─austin@hass  /usr/share/hassio/homeassistant
╰─$ lsb_release -d
Description:	Debian GNU/Linux 9.1 (stretch)
╭─austin@hass  /usr/share/hassio/homeassistant
╰─$ dpkg -s docker-ce | grep Version
Version: 17.06.2~ce-0~debian
╭─austin@hass  /usr/share/hassio/homeassistant
╰─$ udevadm info /dev/zwave
P: /devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb1/1-2/1-2.1/1-2.1:1.0/tty/ttyACM0
N: ttyACM0
S: serial/by-id/usb-0658_0200-if00
S: serial/by-path/pci-0000:02:00.0-usb-0:2.1:1.0
S: zwave
E: DEVLINKS=/dev/zwave /dev/serial/by-path/pci-0000:02:00.0-usb-0:2.1:1.0 /dev/serial/by-id/usb-0658_0200-if00
E: DEVNAME=/dev/ttyACM0
E: DEVPATH=/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb1/1-2/1-2.1/1-2.1:1.0/tty/ttyACM0
E: ID_BUS=usb
E: ID_MODEL=0200
E: ID_MODEL_ENC=0200
E: ID_MODEL_FROM_DATABASE=USB1.1 UHCI Controller
E: ID_MODEL_ID=0200
E: ID_PATH=pci-0000:02:00.0-usb-0:2.1:1.0
E: ID_PATH_TAG=pci-0000_02_00_0-usb-0_2_1_1_0
E: ID_PCI_CLASS_FROM_DATABASE=Serial bus controller
E: ID_PCI_INTERFACE_FROM_DATABASE=UHCI
E: ID_PCI_SUBCLASS_FROM_DATABASE=USB controller
E: ID_REVISION=0000
E: ID_SERIAL=0658_0200
E: ID_TYPE=generic
E: ID_USB_CLASS_FROM_DATABASE=Communications
E: ID_USB_DRIVER=cdc_acm
E: ID_USB_INTERFACES=:020201:0a0000:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=0658
E: ID_VENDOR_ENC=0658
E: ID_VENDOR_FROM_DATABASE=Sigma Designs, Inc.
E: ID_VENDOR_ID=0658
E: MAJOR=166
E: MINOR=0
E: SUBSYSTEM=tty
E: TAGS=:systemd:
E: USEC_INITIALIZED=4086507
1 Like

This may be docker issue.

I use docker and experienced same. Device not found as /dev/zwave
I can’t remember if I tried but mounting that folder “-v /dev/zwave:/dev/zwave” then defining it as device “–device=/dev/zwave” may work (sorry, a little off topic since I don’t think this possible for hass.io)

Yeah I ended up seeing a Docker issue regarding how /dev is handled in containers. The solution was pretty much what you said, use -v /dev:/dev to ensure that you see everything from inside the container (I don’t know if mounting the symlink directly into the container is a good idea because I don’t know what happens if you physically remove the device).

A solution to this for Hass.io would be nice, but it actually seems like I won’t need it now. The Z-Stick stopped flipping back and forth between ACM0 and ACM1 when I toggled the v6.5 USB drivers off in ESXi.

1 Like