# Trying to get failed nodes in order to heal zwave

**URL:** https://community.homey.app/t/trying-to-get-failed-nodes-in-order-to-heal-zwave/99163
**Category:** Flows
**Tags:** z-wave, javascript
**Created:** [December 28, 2023, 9:56am UTC](https://community.homey.app/t/trying-to-get-failed-nodes-in-order-to-heal-zwave/99163 "2023-12-28T09:56:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![TheKos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thekos/32/33969_2.png) [@TheKos](https://community.homey.app/u/TheKos)
#### Post date: [December 28, 2023, 9:56am UTC](https://community.homey.app/t/trying-to-get-failed-nodes-in-order-to-heal-zwave/99163/1 "2023-12-28T09:56:31Z")

</div>

I still suffer sometimes from failing zwave nodes, that I need to heal in the Developper Tools. The cause I think being interference on the Zwave frequency of other devices, I have discovered that my Harman Kardonn wireless soundbar is interfering with Zwave. They were quite close togehther, after creating a few meters space, my issues are less. Also turning the soundbar off helps. I am nog sure it is electronic interference, or just the big magnet in the subwoover.  
Anyway, regurarly healing the network is something I would like te automate via a script/flow.  
To get started, I copied some code I found on this forum, as starting point, being a bit of a nitwit I always need examples.  
I used the Homey.zwave.runCommand({ command: “getNetworkTopology”}). When testing the .js code in homeyscript it fires without errors, but it does nothing. I added a few debug console messages, but it does not even seem to get to the .then step: console.log (“nodes”) is not reached. But no output no error, I am lost what is going on in this code.  
My thougt was, knowing the failed nodes would be a good starting point for healing.  
Anyone would like to give me a push in the right direction ?

## The code I copied and added some debug logs is below :

// try to get failed nodes  
console.log (“start”)

Homey.zwave.runCommand({ command: “getNetworkTopology”})  
.then(async function(nodes)  
{  
console.log (“nodes”)  
var txt=‘aa’;  
var stats;  
await Homey.zwave.getState().then(function (s) { stats = s.zw\_state.stats; });  
_.forEach(nodes, function (node, key) {  
txt += ‘\n’ + key + ’ ’ + node.name;  
if (node.props.route != undefined && node.base == undefined) {  
txt += ‘\n\troute: ’ + key + ‘=\>’;  
for (var r = node.props.route.shift(); r != undefined; r = node.props.route.shift())  
if (r != 0) txt += r + ‘=\>’;  
txt += ’ 1’;  
}  
var stat = stats['node_’ + key + ‘\_network’];  
if (stat != undefined && stat.tx != 0) {  
txt += ‘\n\ttx: ’ + stat.tx + ’ err: ’ + stat.tx\_err + ’ (’ + Math.round(100\*stat.tx\_err/stat.tx) + '%) rx: ’ + stat.rx;

```
            }
    }
    .catch(error=>{ console.log(`FinalError:`, error);
    })
    );
    console.log(txt);
 });

```
