How-To: OpenZWave - Removing a dead node with mqtt.publish

I have seen the topic of how to remove dead nodes from a stubborn Z-Wave controller addressed in many different ways. I though I would present a way to do the procedure from the comfort of Home Assistant, using the mqtt.publish service - via the developer tools panel.

Note: If you have an MQTT client you can follow along with the client by subscribing to the OpenZWave/1/event/# topic on your broker. You can do this also by looking at the OpenZWave admin Events panel in Home Assistant.

First we make the controller test the node, in this example node 46, at least three times. Call the mqtt.publish service with the following parameters:

topic: OpenZWave/1/command/testnetworknode/
payload: '{ "node": 46, "count": 3 }'
retain: false
qos: 2

If you’re following the event topic you will see something along these lines:

...
...
OpenZWave/1/event/testnetworknode/: {
    "status": "ok",
    "TimeStamp": 1602971205
}
OpenZWave/1/event/notification/: {
    "Node": 46,
    "Event": "Notification_Code_NoOperation",
    "TimeStamp": 1602971210
}
OpenZWave/1/event/notification/: {
    "Node": 46,
    "Event": "Notification_Code_NodeDead",
    "TimeStamp": 1602971210
}
...
...

Once it stops - usually with the Notification_Code_NodeDead - we are ready to move to the next step: let’s verify that the node has been marked as dead. Send the following configuration using mqtt.publish, again: replace 46 with the node you want to dispatch of:

topic: OpenZWave/1/command/hasnodefailed/
payload: '{ "node": 46 }'
retain: false
qos: 0

If you’re following the events you should see - if everything went fine - the following result:

...
...
OpenZWave/1/event/hasnodefailed/: {
    "status": "ok",
    "TimeStamp": 1602971238
}
OpenZWave/1/event/hasnodefailed/: {
    "Node": 46,
    "State": "Ctrl_State_Starting",
    "TimeStamp": 1602971238
}
OpenZWave/1/event/notification/: {
    "Node": 46,
    "Event": "Notification_Code_NodeDead",
    "TimeStamp": 1602971238
}
OpenZWave/1/event/hasnodefailed/: {
    "Node": 46,
    "State": "Ctrl_State_NodeFailed",
    "TimeStamp": 1602971238
}
...
...

Now that the controller is sure this node is failed we can proceed and drop it from the controller using the following mqtt.publish payload, replacing 46 with the id of the node pining for the fjords:

topic: OpenZWave/1/command/removefailednode/ 
payload: '{ "node": 46}'
retain: false
qos: 0

The events should look something along these lines:

....
....
OpenZWave/1/event/removefailednode/: {
    "status": "ok",
    "TimeStamp": 1602971250
}
OpenZWave/1/event/removefailednode/: {
    "Node": 46,
    "State": "Ctrl_State_Starting",
    "TimeStamp": 1602971250
}
OpenZWave/1/event/removefailednode/: {
    "Node": 46,
    "State": "Ctrl_State_InProgress",
    "TimeStamp": 1602971250
}
OpenZWave/1/event/removefailednode/: {
    "Node": 46,
    "State": "Ctrl_State_Completed",
    "TimeStamp": 1602971258
}
....
....

When you see Ctrl_State_Completed in the messages as the state you can pat yourself in the back: you have done it! Without downloading anything, moving stick around and right from Home Assistant’s very own web interface. You may need to close and reopen the OpenZWave admin panel to see the change reflected.

As you can imagine this could be implemented in OpenZWave as a single service - IE: ozw.remove_zombie – or as your own service in Home Assistant. The possibilities are endless.

Thank you for reading this far. This was also a way for me to keep this thing in a place where I can find it when - in about 30 days - I will have to do it again and I don’t remember how I did it in the first place.

16 Likes

Thanks. This helped me to remove the phantom devices from my system. Now I just need to figure out why my Aeotec Sensor is mis-reporting the humidity and temperature values.

Thank you for this write up. Huge help.


Five stars !!

That is brilliant, all the other methods I read around the web were involving

  • firing a virtual Windows machine and moving the stick to this machine
  • flashing a special SD card for the Raspberry containing software to do that
    and other hair pulling methods.

This one should be included in the Open Z-Wave documentation.

Bravo