Z-Wave JS UI Driver: Failed to open the serial port Cannot lock port (ZW0100)

New HA user. Can’t get Z-Wave up and running. I initially did the Z-Wave add-in integration, but realized what I wanted was more function/control, so I added Z-Wave JS UI. I’ve been trying to get that to work with my Aeotec Z-Wave Stick Gen5+ (‎ZW090) with the version 1.02 firmware on my 4GB Raspberry Pi with no luck.

I’ve tried stopping the Z-Wave JS add-in, I’ve tried disabling it, but that doesn’t seem to help.

I’m getting these messages:

Driver: Failed to open the serial port: Error Resource temporarily unavailable Cannot lock port (ZW0100)
Error: Driver: Failed to open the serial port: Error Resource temporarily unavailable Cannot lock port (ZW0100)

I don’t know if this is the issue but when I look at /dev/AMA0, it shows owner as root but group as “audio” and not “tty”.

Not sure what to do to get this working.

You can’t run both add-ons at the same time. The integration will try to keep the official add-on running at all times. Either uninstall the integration and the add-ons, and start over with ZUI only, or follow the docs to switch:

I’m a little fuzzy on terms like integration vs add-ons. I’ve uninstalled the Z-Wave JS add-on. Not sure how or where to uninstall the integration. I keep going from screen to screen trying to find stuff and it’s very confusing as to where to disable things, etc. Right now, I’m only running the Z-Wave JS UI and it’s still telling me the port is locked.

I tried following the instructions to switch from JS to JS UI, unchecked using the Supervisor, but when I go to add the Z-Wave JS integration back in, it stops at the point where it’s asking for to connect to the URL ws://localhost:3000. It says can’t connect. I’ve also tried, still no dice.

1 Like

Maybe the glossary will help:

  1. https://www.home-assistant.io/docs/glossary/#integration
  2. https://www.home-assistant.io/docs/glossary/#add-on

In this case, the add-ons are communicating with the Z-Wave controller and hosting a server, and the Z-Wave integration talks to a server running in the add-on, instead of directly to the controller.

I’ve uninstalled the Z-Wave JS add-on. Not sure how or where to uninstall the integration.

Did you not install the integration in the first place to get to this point? Integrations are added/removed/configured in Settings → Devices & Services. Presumably, you installed the integration and said that you wanted to use the Supervisor add-on, and if you did that, HA will not stopping re-installing it, even if you uninstall it. To break this cycle requires either uninstalling the integration, or re-configuring it.

Those are both the wrong URLs for the ZUI add-on. Be sure to read the accompanying documentation when you install an add-on, which is visible from the add-on page itself, and for ZUI also here: https://github.com/hassio-addons/addon-zwave-js-ui/blob/cbe714b48d81d09702bfbb79317264460bb5e38b/zwave-js-ui/DOCS.md#setting-up-the-home-assistant-z-wave-js-integration

In the next dialog it will ask for the server. Enter: ws://a0d7b954-zwavejs2mqtt:3000

FYI, this configuration is also mentioned in the integration docs: https://www.home-assistant.io/integrations/zwave_js/#installing-and-configuring-the-z-wave-integration-in-home-assistant (emphasis mine)

If you’re running full Home Assistant with supervisor, you will be presented with a dialog that asks if you want to use the Z-Wave JS Supervisor add-on. You must uncheck this box if you are running the Z-Wave JS server in any manner other than the official Z-Wave JS add-on, including using Z-Wave JS UI add-on.

If you’re not running the supervisor or you’ve unchecked the above-mentioned box, you will be asked to enter a websocket URL (defaults to ws://localhost:3000). It is very important that you fill in the correct (Docker) IP/hostname here. For example for the Z-Wave JS UI add-on this is ws://a0d7b954-zwavejs2mqtt:3000.

1 Like

I was positive. I had a GEN 5+, but just to be sure I used a USB hub. And voilà! It now detected the correct stick, and added it to my system. There are still some issues, but I will create a new post for them as I have time.

Thank you very much for your assistance. It’s greatly appreciated!


1 Like

I am in the same situation. I installed the Z-Wave JS add-on, and set up my network and devices, and now would like to use the Z-Wave JS UI now that I have found out about it.

I have added the same keys used in the JS integration into the JS UI integration, set the port and the server is set to ws://core-zwave-js/

Can I just stop the one add-on and start the UI add-on; will the devices still be connected or will I need to go through the process of adding them again?

I stopped the Z-Wave JS add-on, and it looks like the JS UI add on is working properly.

Edit: I was mistaken, devices were showing up on the UI, but all my dashboards and automations didn’t. I disabled the JS UI add on for now, and everything is back to where it was.

I’ll need to figure out more on how to properly set this up when I have more time. Any suggestions welcome.

I posted the instructions to switch above. Here they are again.

1 Like


To clarify, I disable the current JS integration, and then after configuring the JS UI add-on, I don’t enable it, I have to go through the “Add Integration” process?

I had just re-enabled it before, I’m guessing that was the issue.

You should follow all of the steps that are listed, otherwise it won’t work. Especially step 4, which re-configures the server to connect to.

Ugh, still no luck. Not sure what I did wrong (I’m sure I had the correct address, that’s the only thing I can assume was the issue), but I did find your other writeup on this, I’ll try that again this weekend.

I love Home Asssiant and I support the team. But why is Zwave so fragnmented? Why can’t we have one native Zwave inegration that just works? Screw all these confusing add-ons.
Sorry to vent, but my entire zwave network is offline after the Zwave JS UI update 1.13. Backups won’t fix this, so I’m haing to rebuild the Zwave network…and I got this port error.

This thread has the instructions for fixing the “lock port” error. Did you try them?

I did get it resolved. Your post in partitcular was helpful. Thank you.

1 Like

Glad to hear that. If you have such problems in the future, take a look at the HA logs and add-on logs first (if you didn’t first) before going the nuclear route. There were a couple of issues, now fixed, revealed by driver updates. No idea if that happened in this case, but the logs would tell us.

In Step 4, What is: Enter the correct address for the community add-on in the URL field in the next step.?
What is the “correct address”?
Can you give me an example?

By default when adding the Z-Wave JS UI Integration (and unchecking the Z-Wave JS Supervisor add-on) the popup has: ws://localhost:3000
Is that the “correct address”? apparently not as I get a Failed to Connect message.

I have to agree this is much more difficult than I had hoped and I’ve spent a few hours trying to get this started up and I keep running in circles.

I suggest:

  1. after clicking on the Add Integration and searching for Z-Wave, then selecting Z-Wave
  2. in addition to the checkbox for Use the Z-Wave JS Supervisor add-on
    a radio button allows the Z-Wave JS UI add-on to be installed instead.
    And have a note or when hovering over each one it says the UI version is for advanced users.

After more running in circles, I tried: ws://a0d7b954-zwavejs2mqtt:3000
which worked. How can we make this the default instead of localhost?

The URL for the community add-on is documented many places, including multiple times in this very thread, just scroll up a bit.

As a reminder to anyone else stumbling into this thread, when you install an add-on, but sure to read the add-on docs first. This setting is mentioned clearly in the Z-Wave JS UI add-on docs.

The same instructions are in the Z-Wave integration docs.

Many people do not use add-ons, and others use the official add-on, so that value as a default is not correct either. I can only speak for myself, but I don’t think core integrations should hard-code things related to community add-ons. The effort would be better spent on HA being able to auto-discover the add-on and presenting it as a choice, instead of requiring manual entry.

The default URL for the configuration dialog is set here:

Anyone can submit a PR to the project. Getting it accepted is another story, so you can try your luck if you like.

This thread was very helpful, partly because it came up above the official docs in a google search, and partly because it made me reassess my incorrect assumptions about what Z-Wave JS UI is.

While I’m as guilty as anyone when it comes to only skimming official documentation, from reading this thread it’s not only me, and I’m sure the correct answer to this is for me to pay more attention (and that will be my takeaway!).

But mainly what threw me off track originally was the naming; I see one addon called “Z-Wave JS”, which is referred to as a server, and the very top of the installation instructions have you install this by default. I did this.

Then I see references to “Z-Wave JS UI” which looks pretty cool, and I immediately interpret this name (obviously incorrectly) as “the UI addon to Z-Wave JS”. What it really means is “Z-Wave JS With UI”.

Once I got past all that, and followed @freshcoast’s instructions, turns out it is pretty cool, and works well. So kudos to the community devs for producing yet something else amazing.

All that leads me to my actual question; was there a reason this wasn’t just done as a pure UI addon to the existing server, rather than replicating the entire thing?

Z-Wave JS UI is an independent application written by a developer that has no affiliation with Home Assistant. The project has also existed much longer, prior to HA being involved with Z-Wave JS (previously being zwavejs2mqtt and before that zwave2mqtt, those projects focusing on being an MQTT bridge). Many people prefer the UI it provides, and integration with the Z-Wave JS server is there to support HA users. It also interfaces directly with the Z-Wave JS driver, so there’s no need for it to be limited by the websocket API.

If anyone wants to write their own UI using the Z-Wave JS server (websocket server), they would be free to do that. But that’s what HA already is, there’s little reason for an add-on UI.

1 Like