Using "Replace Device" for Z-wave devices

I saw the post from @masto you’ve linked on your other topic and thought I’d share my understanding of how the replace and general exclusion works. I had written up about this on another topic last year but can’t remember where exactly.

General Exclusion

A few things to note about general exclusion:

  • When you run a General Exclusion, if the device ID is found in the controller’s internal DB it will remove the device. If the ID is also found in the platform’s DB it will delete the device from the platform (and from any associated SmartApps)
  • General exclusion doesn’t have to happen from the hub, you can do it from a secondary controller/hub and it will still work. As long as the hub received the event from the device that it “left” the network (i.e. excluded) it will remove the device and all it’s settings from the platform and the DB
  • Another thing many folks don’t realize, some device when factory reset also end up excluding themselves from the network. If that event is received by the controller/hub it will have the same impact as doing a general exclusion for the device
  • If you force remove a device from the Classic ST app and the device isn’t communicating at the time, it could end up leaving a ghost ID in the controller (it will be removed from the platform but the controller has ghost ID left in it). This can be removed by following this process.

Replace

This works when replacing an existing device with a new device (that’s already excluded and ready for inclusion). In general, you can’t “replace” an existing device with itself (I’ll explain a workaround for this later). This is because “replace” basically starts an inclusion process (pairing) and when a new device joins (completes the pairing process), ST updates its database to reference the newly joined device in place of the existing device. Infact, if you were to do a general exclusion of the “existing” device after “replacing” it, you’ll find that it ends up doing very funky things to your “replaced” device and may even delete it from ST (as I learnt the hard way) since as JD points out below, they share the same device ID.

The main reason you can’t replace the existing device with itself is because the existing device is already paired with the controller, hence when you start the “replace” process (i.e. inclusion) the existing device cannot pair itself again with the controller as it needs to be excluded first. Now there’s a little trick I figured out on how to get the existing device to replace itself based on the above and here are the steps:

  1. You need to first exclude the existing device in a very specific way, key points to note here:
    • The problem here is that you can’t use the main/paired hub to exclude it using the general exclusion process because when it excludes the device, it will also delete all references to it from the ST platform/DB and so you can’t replace it now since it won’t exist.
    • You need a secondary controller (like another hub) to run the general exclusion process to exclude the existing device. Now keep in mind that the main controller/hub to which the device is currently paired CANNOT be online when this happens. That’s because when you run general exclusion for the device, the main hub also picks up that exclusion event on the Z-Wave radio and deletes the device from the ST platform/DB (even though it didn’t initiate the general exclusion) - I also learnt this the hard way. BTW, this behavior with the hub picking up on exclusion events over the radio can also been with some devices which, when they are factory reset, send an exclusion event over the radio and the hub then proceeds to automatically delete the device from the platform’s DB even through it didn’t initiate a general exclusion
  2. So in light of the above on how the process works, now it’s just a matter of a few steps to replace a device with itself:
    • First take the main hub offline (power it down, removing the network cable won’t help since it’s still listening to the z-wave radio)
    • Then start a general exclusion process on a secondary controller/hub
    • Exclude the device which you want to replace with itself
    • Now power up the main hub
    • Start the ST app device “replace” process, since the device is excluded it won’t respond to ST’s health check requests and ST will think it’s offline and allow you “replace” it. Click Replace, this will put the hub into pairing mode
    • Start the inclusion (pairing) process on your device, (since it’s excluded) it will now join the hub and ST will replace the device with itself

Some folks may find they start the “replace” process and the unplug/replug/reset the device and it “replaces” itself, that’s incorrect. The “replace” is an inclusion, what happens is when you power cycle the device/reset it, it basically fixes itself and starts communicating. Some of the original Z-Wave GE Z-Wave paddles and switches are notorious for this problem, they overheat/hang/stop working. Power cycling them or pushing the air gap button resets them and they start working for a while again.