zwave-js / node-zwave-js

Z-Wave driver written entirely in JavaScript/TypeScript
https://zwave-js.github.io/node-zwave-js/
MIT License
749 stars 599 forks source link

Multiple nodes showing up when adding device #5266

Closed tamorgen closed 1 year ago

tamorgen commented 1 year ago

Good morning, I’m trying to add a Zooz outdoor plug (Zen14) to my HA using Zwave-JS-UI. I scanned the QR code, plugged it in, and turned it on. All of a sudden I keep getting multiple nodes trying to add (up to 6 nodes now), and none of them complete. I’ve let it go for like 20 minutes now, and it’s just spinning at me being dumb. I’ve had this happen a few times, but just 1 or 2 extra inclusions, and they usually end up adding a final secure node.

I tried soft resetting Z-Wave-JS-UI, and I’ve tried restarting Home Assistant, but it just keeps spinning.

What is going on here?

I’m running HA 2022.10.5 (not upgrading to 11.1 until the bugs are worked out) OS 9.3 RaspPi 4. IMG_0034

tamorgen commented 1 year ago

How do I stop this? It's added a dozen nodes now, none completed.

jmgiaever commented 1 year ago

For what I'm aware, this is out of the scope of the driver. If the handshake fails it will, by protocol, continue with a new inclusion. It simply couldn't verify that the ongoing inclusion was valid/trustworthy.

This is most likely a connectivity issue in your network. Either packages for network wide inclusion isn't reaching the targets (device or controller) in time, or the distance between the device and controller (if direct connection) is to far away.

Can you try to move the device closer to the controller and see what happens?

For the entries that fails, you can just "remove failed" in ZUI, to free up the node IDs.

And.... The only way to get help for debugging this is to attach logs; DRIVER logs.

jmgiaever commented 1 year ago

How do I stop this? It's added a dozen nodes now, none completed.

Remove the entity from the provisioning list.

tamorgen commented 1 year ago

Okay, thank you. I’ll give that a try. One last question. Is there a way to reset the node entries, so all those unused nodes can be used for future devices? I know it doesn’t matter in the long run, but just curious.

jmgiaever commented 1 year ago

Another suggestion is to try to do a heal, if you have multiple powered devices and would expect this to work. Also make sure your dongle is on an USB cord, away from an USB input. There's a troubleshooting guide in the docs that you should read through.

When you "remove failed node" and those nodes disappear from the list of included nodes, they're automatically freed up and available to new/future nodes to be used.

tamorgen commented 1 year ago

I've done a heal recently, and my USB stick is quite a distance a way from my Raspberry Pi. I just tried adding it again, and including with the QR code, and then plugging it in within 5 feet of the USB stick, it's exhibiting the same behavior. It's adding it as unsecured (security none), multiple nodes, unknown manufacturer, and keeps spinning on Protocol Info. I thought the whole point in the SmartStart QR code is this sort of nonsense didn't happen.

Screen Shot 2022-11-04 at 7 16 29 PM

jmgiaever commented 1 year ago

Something must de disturbing the signals. Have you tried to to a shutdown+ unplugging your stick and doing it from a cold boot?

robertsLando commented 1 year ago

Okay, thank you. I’ll give that a try. One last question. Is there a way to reset the node entries, so all those unused nodes can be used for future devices? I know it doesn’t matter in the long run, but just curious.

You can also disable entities on provisioning entities table in order them are not added automatically

sgbirch commented 1 year ago

Something must de disturbing the signals. Have you tried to to a shutdown+ unplugging your stick and doing it from a cold boot?

I have a similar problem with multiple nodes showing up, usually nodes that are more than one hop away. I'm using conventional inclusion at the UI rather than QI scanning.

Can you expand on this a little? Do you want to shutdown HS, then unplug the dongle, then restart HS? At what point should the dongle be plugged in again?

I'm a bit new to this (you can probably tell), will a full backup of HS also backup the z-wave nodes so I can recover if things get lost during this process? I expect this has already been discussed in the forums ... if so, can you link me or tell me where to search?

My Zwave is an aeon 5.0 on an extension USB lead (to fix the buggy aeon hardware) and an rpi 4.0.

robertsLando commented 1 year ago

@sgbirch
Please attach zwave-js driver logs, this will help us to undestand what's going on

cc @AlCalzone

AlCalzone commented 1 year ago

When I've seen this before, it was the device crashing and seemingly factory resetting in the middle of the interview, but only when included via SmartStart. That then triggers another inclusion and so on...

As a workaround just do a normal manual inclusion. I guess also report this to Zooz but I'm not sure is this is something they can fix themselves. since the same thing seems to happen across manufacturers, it might also be an SDK bug.

makopov commented 1 year ago

Also make sure your dongle is on an USB cord, away from an USB input

Where is this documented? I have mine connected directly to the box and am having this same issue, however mine appears to be paired successfully but then it keeps adding the same one ever 20s.

AlCalzone commented 1 year ago

There: https://zwave-js.github.io/node-zwave-js/#/troubleshooting/connectivity-issues?id=general-troubleshooting

AlCalzone commented 1 year ago

While secure inclusion was temporarily broken in 10.11.0, we noticed that this can happen when a node in the provisioning list tries to get included, but then secure inclusion fails. Some nodes then reset themselves and try again, over and over.

We could consider disabling the provisioning entry in this case, but I'm not sure if that's a good solution either.

AlCalzone commented 1 year ago

The original issue was fixed in v11.0.0: https://github.com/zwave-js/node-zwave-js/blob/master/CHANGELOG.md#1100-2023-06-19--im-on-the-highway-to-hell-certification

This happens when including a device via SmartStart fails (e.g. due to communication issues or timeouts in the key exchange). The device then resets and tries again. We now remove the remains of the failed inclusion automatically.