Page 1 of 1

List all devices in z-wave network

Posted: 18 Dec 2019 21:01
by benwindheim
I'm developing a module that relies on dynamically growing and shrinking the amount of door locks it's working on. Is there a way to list all devices of a certain type, or just all devices connected to a Z-Way controller from the index.js of my module?
Specifically, I'm looking to get the device ID of all door locks connected to my Razberry.

Code: Select all

zway.devices[1].data.neighbours
gives me

Code: Select all

[ object ZDataHolder ]
but I haven't gotten anything useful out of that.
Thanks!

Re: List all devices in z-wave network

Posted: 18 Dec 2019 23:26
by benwindheim
Partially solved:

Code: Select all

 zway.devices[1].data.neighbours.value 
returns node id routing list for z-way controller.
Now how do I derive Device Type given the NodeID?

EDIT solved: Better approach found in manual -

Code: Select all

vDevList = this.controller.devices.filter(function(x) {
	return x.get("deviceType") === "doorlock"
});

Re: List all devices in z-wave network

Posted: 25 Dec 2019 01:36
by PoltoS
Yes, this is the correct one!