Hass.io generic Linux install - how to map the USB port for the ZWave stick?

If I install Home Assistant on its own via Docker https://www.home-assistant.io/docs/installation/docker/ then I can set up a udev rule for my ZWave stick to map it to a static name, e.g. /dev/zwaveusbstick, and pass it through to the Docker container as described in that page with a paramater to the docker command in the systemd file (e.g. --device /dev/zwaveusbstick:/dev/zwaveusbstick).

However if installing the entire hass.io wrapper instead, using the generic Linux instructions, how can I then ensure that my static device name is passed through for HA to use? There is no docker command to add the parameter to.

You will have to find the actual path to the device. I recommend using the /dev/serial/by-id/ path instead of the /dev/ttyACM0 path, because the path would change from 0 to 1 on me sometimes on reboot. My devices section looked like this:

    devices:
      - /dev/serial/by-id/usb-0658_0200-if00:/zwaveusbstick

Source: https://github.com/brianhanifin/docker-compose-config

Thank you, but where do I put that entry?

I already have a link set up /dev/zwaveusbstick that dynamically points to whatever device the stick is (currently /dev/ttyACM0), using the advice given in the setup docuemntation about creting a static device name for it (udev rules).

If I set up the ZWave integration from the front end, it asks for the USB path, with /zwaveusbstick as the default. I enter /dev/zwaveusbstick but it is not found.

Why do I need the serial-by-id value (I’ve noticed that it is a hard link to /dev/ttyACM0 in exactly the same way as /dev/zwaveusbstick is, so why can’t I just use /dev/zwaveusbstick) and where do I put the devices: entry that you’ve given? I’ve tried in configuration.yaml but it gives me a configuration error. What I tried was:

devices:

  • /dev/zwaveusbstick:/dev/zwaveusbstick

But it produces:

Component error: devices - Integration ‘devices’ not found

Here is how I used it in my docker-compose file. I had to do that because my two USB devices would sometimes change order upon reboot. I found the by-id path was consistent so I used that instead. If your /dev/ttyACM0 path never changes, then use it. Have you tried

/dev/ttyACM0:/dev/zwaveusbstick

in place of:

/dev/zwaveusbstick:/dev/zwaveusbstick

1 Like

The /dev/ttyACM0 path can’t be used becuase it can change, that’s why I’ve got a dynamic link called /dev/zwaveusbstick that always points to the correct device, in exactly the same way as the device-by-id link does, except in a more readable way.

But I haven’t got a docker-compose file because this a generic hassio Linux install, not a docker HA install. There is no docker command. I believe that docker-compose is used to simplify thigns when the docker command becomes too unwieldy. I was able to map the USB device OK on another machine when I did a HA docker install, using a docker command line switch that does exactly the same thing as your docker-compose entry, but I don’t know how to do the same thing on the hassio install. The documentation doesn’t say how to do it, there is no docker command to put the switch onto, adn therefore no docker-compose command to execute.

Am I missing a step in setup? The documentation https://www.home-assistant.io/hassio/installation/ simply gives the command to the installer script and that’s it, it doesn’t mention setting anything else up.

In the hassio installer, every USB is passed through. You don’t do anything to pass it through.

I misunderstood. I thought you were asking about docker. Sorry about that. I’m going to bow out as I don’t fully comprehend this.

OK, thank you for your time anyway!

Next question then! The Add Z-Wave Integration dialog isn’t finding my /dev/zwaveusbstick link when I type it in having overtyped the default /zwaveusbstick. That’s why I thought it had to be passed through in a similar way to the docker installation. Is there any trick to this? The link is definitely there and linked to /dev/ttyACM0. Does hassio actually require the original /dev/ttyACM0 path or, alternatively, a link to it in the root directory as in the default path /zwaveusbstick?

Open the hassio menu, and browse to the system (I don’t know exactly where) but you should see hardware. What you see in that list is what’s usable.

OK, thanks to your hint and in fact what Brian said initially I think I’ve solved this.

The hardware list simply gives /dev/ttyACM0, it doesn’t show my /dev/zwaveusbstick alias. I think this shows that hassio installed via this method doesn’t get these aliases passed through. It’s possible to map it when you’re using HA Docker, but there’s no way to map it with the hassio install. It’s not satisfactory though because the ACM0 label can change.

I also noticed a single entry in the serial/by-id heirarchy which, if it hadn’t been for Brian’s reply, I wouldn’t have known what it was. This was indeed a link to ACM0, so I could use that I thought.

However, my Z-Wave integration had already been set up with /dev/zwaveusbstick and I couldn’t work out how to change it. I tried putting a corrected zwave entry in configuration.yaml and restarted HA but it still didn’t work. I thought I’d then try to remove the Z-Wave integration in order to start again, but I couldn’t find a way to do that.

In searching though the forums for hitns on how to remove the integration, I cam across a thread about people having problems deleting obsolete and orphaned nodes and renaming them, and the only way to do it was hack the “registry” in homeassistant/.storage. So I had a look there and there was indeed an entry for /dev/zwaveusbstick, so I edited that to the serial/by-id path, restarted HA, and it’s now worked. I’ve got the ZWave stick recognised.

I have to say that the documentation, while I recognise a lot of hard work has gone into it, is still unclear, confusing and contradictory with regard to the different ways of installing HAS and what it is possible to do in each method. There is even advice on how to create static device names, which is indeed what I followed in order to create /dev/zwaveusbstick, but obviously this doesn’t actually work in generic hassio install. I’ve been down several other rabbit holes in the last 4 weeks too, as a newbie trying to get HA installed, and following guides in the documentation that simply don’t work, then trashing the installation and starting again with a new method and on another computer to see if other things works. Basically, my conclusion is that HA is designed first and foremost if you’re using a NUC or a Pi as an appliance, and other methods of installation on other OS’s are littered with pitfalls and limitations. I’ve also discovered that the built-in Pico TTS integration doesn’t work with the docker methods.

I’ve now got one PC set up with a docker implementation of HAS and another with the generic hassio install, and wondering which one I should settle on for my proper system, which one has fewer limitations and disadvantages, and wondering which of the other integrations that I might want to use in the future won’t work in one or the other.

From our friends at Domoticz, here’s how to assign a fixed device name (Linux symbolic link) to your USB devices:

https://www.domoticz.com/wiki/Assign_fixed_device_name_to_USB_port

I just had to do this for my USB microphone with Rhasspy.
Many thanks to rhasspy user romkabouter for the link.

Yes, this is indeed what I did to create the /dev/zwaveusbstick alias (using udev rules) but the hassio generic install (using docker) doesn’t see it. The linked instructions create the link directly in the Pi OS in which hassio is running.

You are correct. In Rhasspy, we pass the host system directory /dev/snd/ into the Docker container so the devices are visible.