I need to unplug & re-plug my Z-Wave stick after a system reboot

Hi,

Very often -when I reboot Home Assistant OS- the Z-Wave JS UI does not detect my Aeotec Z-Stick Gen5+ USB anymore (Driver: Failed to open the serial port: Error: No such file or directory, cannot open /dev/serial/by-id/usb-0658_0200-if00 (ZW0100)).

The only solution I have found so far is to unplug my Z-Wave stick, and then plug it back in (in the same port). A few seconds later, the stick is detected again.

I am running Home Assistant OS in a Proxmox VM on an Intel NUC. I have done a pass-trough of the USB port to Home Assistant.

This is obviously very inconvenient, especially since it requires a manual (on site) intervention.

Any idea on what could be the cause (and solution)?

Why are you rebooting HA VM?
Do you mean restart HAOS?

Can you clarify exactly what you do?

Whatever you are doing does not allow serial port to be released by service so another service cannot connect it. Unplug/plug in kills previous connection so new connection can be made. Need to know exactly what your doing to understand cause.

Just a shot in the dark … problems such as you described are sometimes due to timing changes. HA setups always involve interactions among multiple processors - e.g., the one in a ZWave controller and the one (or more?) in the NUC. There’s also several OSes involved. It’s a complicated dance for all the pieces to get themselves up and going after a reboot or restart.

So if something changes in the setup, the timing of that dance may change. Something that used to, or sometimes still is, ready when some other piece tries to use it is now less likely to be ready. It may happen simply because some piece of software or hardware somewhere in your setup was changed and became faster, or slower, than it used to be. So the timing that used to work now occasionally fails.

Your description sounds like the stick sometimes isn’t yet quite ready when the HA system tries to open it, so the “open” fails, and the software treats that as a fatal error instead of retrying. Unplugging and replugging the stick causes it to “retry” and it works.

The fix is usually to modify the software to treat such errors as possibly temporary and retry at least a few times before giving up. But mere Users usually can’t make such changes.

So if it’s possible, finding some way to “slow down” the reboot operation may have a similar effect. Perhaps the NUC/Proxmox setup has some way to slow down its speed?

I’m not sure that this will help? I had a Pi 4 with HA (Home Assistant) and I moved its operating system (OS) onto a larger Kingston Drive about two years ago. I use the CONBEE II USB coordinator which I’d had plugged directly into the back of the Pi 4 USB Port, right next to the Kingston drive.

Initially it caused interference with my Zig-Bee devices configured this way. They dropped out or wouldn’t connect at all? I’m using ZHA to connect to my Zig-Bee devices, not MQTT. I have 28 devices connected, TRADFRI IKEA Bulbs, Aqara sensors and their “Cube” (LOVE IT), and various Amazon Zig-Bee plugs. My house is about two floors and upstairs to my bedroom is about 50ft through walls. My router is downstairs in my studio, in a corner of the house. So, lots of my Zig-Bee devices are rather far from my router.

The Pi is on my studio desk about 3ft from my main router, with the USB CONBEE plugged in, and now tethered off of a reliable 3ft USB extension cable. That’s to give you an idea of my set up. Anyway, when I initially plugged the Kingston drive right next to the CONBEE plugged directly on the USB all of my devices dropped out. To fix that I tethered the CONBEE onto a reliable USB cable away from the Kingston drive and everything connected immediately. I’ve had no problem since.

Could it be a hardware issue that is giving you difficulties? I’ve found the CONBEE II coordinator by Dresden Elektronik to be very reliable and again using ZHA rather than MQTT. By the sounds of you difficulties you may consider the hardware you are using. I had similar difficulty initially when I installed the Kingston drive right next to the CONBEE II coordinator. Once I moved it away from the Kingston drive, it hangs off the USB cable behind my studio desk, everything connected.

Could your problem be a USB cable? Some don’t work well as they only provide power rather than reliably transfer data. Maybe check that? Could it be the Z-Wave stick Zig-Bee controller? The CONBEE II I have works very well. I’ve included a picture of my Pi connected to the Kingston drive with a “tethered” USB cable to the coordinator. Hopefully this may give you some insight into your difficulties? Sorry this is all I can think of in relationship to a similar problem I initially had. I’m under suspicion that it may be your hardware rather than software? Sorry that you are having such difficulties. I don’t know if any of this you haven’t already tried but this is the best I can recommend. All the best and please let us know if you find a solution.

Maybe
https://danielbrennand.com/blog/proxmox-fix-usb-disconnect/

Various reasons, an upgrade, or I need to reboot my underlying Proxmox…

I mean restart HaOS indeed.

I would not know how to slow down it’s speed (temporarily).

My Z-Wave stick is the only device that is connected via an USB port on the front of my NUC. I do not use an USB extension cable, it is plugged in directly. There are other devices connected to the back of my NUC (HA Connect + a USB TPU, both using an USB extension cable).

That could make sense. I’ve implemented it as described, will report back if this is the solution (the problem does not occur at every reboot).

Thanks all for contributing!

Unfortunately, that didn’t solve the issue.
What I notice is:

  • If HAOS has been online for a while and I reboot it → my Z-wave stick is not detected anymore untill I unplug-reconnect.
  • If after reconnecting my Z-wave stick, I reboot again: no issue;

Need to determine if usb port power is turning off or maybe zwave stick is failing

Do you have another port you can use?

I know the error shows the device path, but just to double check. Did you configure the device path as /dev/serial/by-id, or did you use /dev/tty... / /dev/usb...?

Asking because what you’re experiencing is typical of the device path changing when multiple usb devices are plugged into the same host. The ZWave docs warn about this

It’s highly recommended to put in on an extension cable. Even if it doesn’t solve this issue it’ll improve the RSSI profile of your network.

These are my pass-through settings in Proxmox:

In Z-Wave JS UI, I have these settings:

So I think I used the correct settings, right?

I have now moved to another USB port, and I’ll report back if it makes any difference.

I’m sure it does, but currently I don’t experience any issues with strength of the radio signal. If my USB stick is connected, everything works stable and without interrupts.

It’s also documented that interference causes controllers to seize and need a hard reset. It’s also possible that during a restart there is a higher amount of CPU / power consumption causing increased noise / power fluctuations. This is why the most reliable setup is one with a powered USB hub and extension cord. Myself I use a powered non bus powered USB hub on a WiFi smart plug so I can do a remote reset on the stick. Depending on your USB hardware to may be able to script it to turn it off and back on.