Find device by address (z-wave)

Posted on
Wed Apr 18, 2018 11:59 am
brettlid offline
Posts: 55
Joined: Nov 28, 2017

Find device by address (z-wave)

Anyone know how to locate a device by using it's z-wave address other than iterating thru the entire device list.

Thanks

Posted on
Wed Apr 18, 2018 12:08 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Find device by address (z-wave)

Not really, but you can refine the iteration:

Code: Select all
for dev in indigo.devices.iter("indigo.zwave"):
  if dev.address == 1234:
    do something....

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Fri Apr 20, 2018 12:31 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Find device by address (z-wave)

All my Zwave plugins use six dicts at startup, two of which are:

devFromNode[node] = devID
nodeFromDev[devID] = node

That way, wherever I have the node ID of a device, eg an incoming Zwave Command, I can turn it instantly into a device ID, or vice-versa, without having to iterate Indigo.devices[] every time.

The other four are identical but convert to/from my own plugin device IDs.

That might help you?



Sent from my iPhone using Tapatalk Pro

Posted on
Fri Apr 20, 2018 5:58 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Find device by address (z-wave)

Good tip. Our main Z-Wave plugin library does something similar.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests