Transfer USB devices with Supervised installation (Docker + Portainer)

Hi everybody!

I’m starting domotic with a Raspberry and Raspbian buster installed on it.
I installed HA as a Virtual Environment but finally decided to move to the supervised method - With homeassistant and hassio_supervisor dockers.
I replaced in the container the “/usr/share/hassio/homeassistant” folder by the old .homeassistant folder.
This allowed me to found my old configuration (account, Zwave devices, etc).

My problem is that the Z-Wave USB stick is not recognized.
When I go to Supervisor --> System --> Hardware I have the following serial devices :

* /dev/ttyAMA0
* /dev/serial/by-id/usb-0658_0200-if00
* /dev/ttyACM0

On my host system, I renamed my Zwave USB stick in the UDEV file “ttyUSB-ZWave+Stick-5G”.

My questions are :

  • Does the docker system change the devices name in the container compared to the host name ?
  • How can I tell the docker to “transmit” this USB device ?
    I saw that we can use a docker-compose file but I don’t know how.
    The container gets launched automatically and I didn’t achieve to use the code indicated in this page :
$ docker run --init -d --name="home-assistant" -v /PATH_TO_YOUR_CONFIG:/config \
   -e "TZ=Australia/Melbourne" --device /dev/ttyUSB0:/dev/ttyUSB0 \
   --net=host homeassistant/home-assistant:stable

I read some topics saying to use Portainer to manage dockers so I installed it and tried to change the launch commande by adding --device /dev/ttyUSB-ZWave+Stick-5G:/dev/ttyUSB-ZWave+Stick-5G but it didn’t worked :frowning:

Is there an easy way to do it ?
Also, for my information, should the ZWave USB stick be “transfered” to the Supervisor or the Homeassistant docker ?
Thanks in advance for your help!

Before playing around with docker-compose and portainer, did you do the obvious: remove modemmanager ?

The ModemManager is disabled but not uninstalled :

pi@raspberrypi:~ $ sudo systemctl status ModemManager
● ModemManager.service - Modem Manager
   Loaded: loaded (/lib/systemd/system/ModemManager.service; disabled; vendor preset: enab
   Active: inactive (dead)

Can it interfer even if it is deactivate ?
Should I uninstall it ?

Update your zwave config to use /dev/serial/by-id/usb-0658_0200-if00. The supervisor manages the device paths in the containers, you cannot add your own custom serial usb path.

1 Like

That’s it!!!
Thanks A LOT!
I struggled for hours on this problem, looking on how to change this and now it works :slight_smile:

Can you please confirm me that the device name won’t change if I reboot the host system or the homeassistant container ?
I plan to add an RFLink gateway. When I’ll connect it to the RPi, I suppose that I’ll only have to check in the supervisor the new serial device to know how it is named ?

For (maybe) future readers : I changed the USB device name in the config/.storage/core.config_entries file.

Thanks @francisp and @freshcoast for your help and quick answer!

The whole point of the serial/by-id paths are for persistent names, so no it won’t change after a reboot. It’s exactly the same as your custom udev rule.

It sounds like you could install your udev rule into the HA container, but when you upgrade HA and the container is re-created, you’ll lose the change. There isn’t a persistent way to keep it installed. So it’s just easier to use the supported paths.

The RFLink documentation shows an example of using a serial/by-id path, so you should be good with the same approach.

There’s no way in the UI to change z-wave configuration settings, so editing the .storage file was the right way. The other way is to override it in configuration.yaml.

Great, thanks a lot for the explanation, it looks a little bit clearer to me :slight_smile:
Have a nice day/evening!