Getting Node Name from Node ID

Posted on
Fri Nov 02, 2018 1:40 pm
CliveS offline
Posts: 761
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Getting Node Name from Node ID

I am trying to find the code to get a device Node Name when all I have is the Node ID.

In the debug logs I can see line 1 has the Node ID and line 4 has the Node Name, but what python code can get me from ID to Name

Z-Wave Debug RCVD requestMeterLevel: 01 14 00 04 00 05 0E 32 02 21 34 00 00 0F 47 00 00 00 00 00 00 89
Z-Wave Debug . . requestMeterLevel: node 005, endpoint None, meterType 01, raw value 3400...
Z-Wave Debug . . requestMeterLevel: 391.1 W (float: 391.100000)
Z-Wave Debug received "Living Room TV Switch" power load to 391.1 W

I can get output like

Multi Sensor
Multi Sensor Node 152: 01 0A 00 04 00 98 04 30 03 FF 0C AD
Multi Sensor Node 152: Motion is On
Multi Sensor

but would like to grab the name and insert it like this

Multi Sensor
Multi Sensor Node 152: 01 0A 00 04 00 98 04 30 03 FF 0C AD
Multi Sensor Node 152: Kitchen Neo Motion is On
Multi Sensor

Any ideas?

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Fri Nov 02, 2018 3:55 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting Node Name from Node ID

Brute force:

Code: Select all
device_names = [d.name for d in indigo.devices.iter(filter="indigo.zwave") if d.address=="NODEIDHERE"]


I made it list comprehension because some node numbers will have multiple indigo devices (i.e. multi sensors).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Nov 02, 2018 5:04 pm
CliveS offline
Posts: 761
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Getting Node Name from Node ID

Thanks Jay,

Almost their but I get

Node 145: 01 0A 00 04 00 91 04 30 03 FF 0C A4
Node 145: [u'Living Room Neo Lux', u'Living Room Neo Motion'] Motion is On

Node 145: 01 10 00 04 00 91 0A 71 05 00 00 00 FF 07 00 01 08 F5
Node 145: 01 0A 00 04 00 91 04 30 03 00 0C 5B

Node 145: 01 0A 00 04 00 91 04 30 03 00 0C 5B
Node 145: [u'Living Room Neo Lux', u'Living Room Neo Motion'] Motion is Off

Is their a way to filter further as I know that is a motion sensor?

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Sun Nov 04, 2018 11:47 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Getting Node Name from Node ID

Not sure this is the best way but you could try:
Code: Select all
device_names = [d.name for d in indigo.devices.iter(filter="indigo.zwave") if d.address=="NODEIDHERE"] and d.globalProps['com.perceptiveautomation.indigoplugin.zwave']['zwDevSubIndex'] == 0
That's assuming the the Neo Motion is the first device listed when you edit it i.e. the Lux is the second device. :)

Posted on
Sun Nov 04, 2018 3:57 pm
CliveS offline
Posts: 761
Joined: Jan 10, 2016
Location: Medomsley, County Durham, UK

Re: Getting Node Name from Node ID

Thanks for the idea but I get

Node 99: 01 0A 00 04 00 63 04 30 03 FF 0C 56 -- []
Node 145: 01 0F 00 04 00 91 09 71 05 00 00 00 FF 07 08 00 E8 -- []
Node 145: 01 0A 00 04 00 91 04 30 03 FF 0C A4 -- []
Node 156: 01 09 00 04 00 9C 03 20 01 FF B3 -- []
Node 156: 01 11 00 04 00 9C 0B 71 05 00 00 00 FF 07 07 01 07 00 F0 -- []

I think I will go back to basics and try a different approach once I have the rest of the code working

CliveS

Indigo 2023.2.0 : macOS Ventura 13.6.3 : Mac Mini M2 : 8‑core CPU and 10‑core GPU : 8 GB : 256GB SSD
----------------------------------------------------------------------------------
The best way to get the right answer on the Internet is not to ask a question, it's to post the wrong answer

Posted on
Mon Nov 05, 2018 10:46 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Getting Node Name from Node ID

autolog wrote:
Not sure this is the best way but you could try:
Code: Select all
device_names = [d.name for d in indigo.devices.iter(filter="indigo.zwave") if d.address=="NODEIDHERE"] and d.globalProps['com.perceptiveautomation.indigoplugin.zwave']['zwDevSubIndex'] == 0
That's assuming the the Neo Motion is the first device listed when you edit it i.e. the Lux is the second device. :)


Slight typo (misplaced closing bracket), it should be:

Code: Select all
device_names = device_names = [d.name for d in indigo.devices.iter(filter="indigo.zwave") if d.address=="NODEIDHERE" and d.globalProps['com.perceptiveautomation.indigoplugin.zwave']['zwDevSubIndex'] == 0]

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests