Do Z-Wave devices have to be installed to add ZWave integration? (Logs included - is this a bug?)

The HA install that was working before things went bad? Well, we all make mistakes. Long story short, that SD card went through the laundry.

@finity : Itā€™s a bug.

I was going to report it and the reporting page had a link if I was unsure how to categorize it, so I clicked it, it took me to the Discord chats, which I didnā€™t know about, and they sent me to the ZWave chat room. I have it working now. I set up ZWaveJS2MQTT and it appears the bug is in the USB discovery functions.

well there you go.

Iā€™m really surprised but I guess someone always has to be the first one to find it.

So where was the bug exactly?

in the zwavejs2mqtt add-on only or in every version of zwavejs?

And to make it work you needed to specify the USB path manually?

I updated to the latest version of zwavejs2mqtt docker image and it didnā€™t kill my zwavejs completely, only a sensor or two. So maybe having it previously installed wasnā€™t affected by the bug and it only affected brand new installs using discovery for the stick?

Glad you got it working tho.

Apparently in USB discovery.

Looking at the stack trace, it starts in web_protocol.py, which makes me think itā€™s happening when something regarding the UI is called. My guess is thatā€™d be when I clicked ā€œSubmitā€ to start the process. Then, after going through a number of subroutines, it reaches config_flow.py, which is in components/zwave_js, and that calls utils.py in components/usb.

My guess is that the install process calls the ZWaveJS add-on at some point and when it tries to communicate with the device, or find it, thereā€™s an issue. The odd thing is this happens not just with ZWaveJS, but with ZWaveJS2MQTT as well, so itā€™s not just the ZWaveJS add-on. Also, I can start both add-ons (I only have had one installed at a time) and, from the logs, it looks like they both are able to connect to the Z-Stick.

In ZWaveJS, I was given two choices, the full device path and /dev/ttyACM0. The guy who was helping me in chat told me that device is the GPIO in a Pi, so itā€™s the wrong choice. Usually the ZWave controller is ttyUSB0. On ZWaveJS2MQTT, it only gave the ttyACM0 device as a choice. Once I knew that was wrong, I cut and pasted the full device path in the settings and the add-on worked fine.

On Pi-H (House Pi), I had an install working that I had set up a few weeks to a month or so ago that had no problems installing the ZWave integration. (Iā€™m not good at keeping track of time.) Even after updates, it continued to work well. Then I shut it down and tested it with SD cards for 8.1, 8.5, and 9.0. (By the way, I found URLs to images other than the current one get a 404 error.) It wouldnā€™t work with any of those, but I put the original SD card with the working install I had used in and itā€™s working.

Based on what Iā€™m seeing, my conclusions, for now (and these are coming from someone who does NOT know the code at all) are:

  1. The function with the bug is used in USB discovery, not in normal USB communication.
  2. Because of #1, itā€™s a problem for people installing ZWave, but not for people using it.
  3. The bug may need a specific configuration, such as being on a Pi and the Aeotec Z-Stick 7 to fail. Or maybe just that Z-Stick, and maybe just older versions of it and recent versions of it might not have an issue.

Also, since it may only be an issue in installing, and in specific cases, it might have only impacted a minimal number of people. Also, it might have been a problem for new users testing HA and thinking, ā€œWell, darn, ZWave wonā€™t even add, forget it,ā€ instead of them deciding to report it. The HA forum has been a helpful place, but I have forums I wonā€™t go to for help because they are rough on people who donā€™t know the project inside and out. Thereā€™s one forum Iā€™ve stopped going to because of one user who keeps trying to prove heā€™s right and thatā€™s more important to him than making sure someone gets a solution. (Iā€™ve talked to the admins - they want me to report individual posts. Iā€™ve pointed out to them I spent years working in treatment and can cite a number of times, including that jerk, where abuse isnā€™t ONE incident, but a pattern of them and one post, alone, isnā€™t the problem. They donā€™t get it - so I avoid that forum.)

I have a few things to deal with today and yesterday, to help me think through this, I wrote up a summary that I could use for a bug report, if thatā€™s what the people in the HA/zwave chat thought was the case. Once I have time, Iā€™ll file the report.

What I find interesting is that today, after telling both systems to update before I went to bed, one is offline, and the other, the remote I just set up, is telling me it has updates for ZWaveJS and ZWaveJS2MQTT. Iā€™m wondering if someone in the zwave chat room read what I was talking about and found the error. (I linked to this discussion in the chat, so theyā€™d see the logs and the issues.)

1 Like

Just thought Iā€™d reply with that Iā€™m getting the same error. Brand new flash of Supervisor, brand new z-wave stick (Aeotec 7). Going to try to piece through some of the troubleshooting youā€™ve done to see if I can get things working.

Edit: I seem to have gotten it working through the following steps:
Add the ZW JS Server using the Add-on store
Try to start, it errored, had me select the correct USB device. Saved, left everything else unchanged.
At that point, it started the ZW server.
Adding the integration through the Integrations page then worked normally.

What seemed to be breaking it was using the search in add a device rather than the store. (I really donā€™t have the patience left to try another wipe and reinstall to confirm).