Reporting Z-Wave routing performance (AutoRoute & ManualRoute variables)

Hi

I’ve been scanning the wiki and the forum for information on Vera’s z-Wave routing and while there are a number off interesting posts one that stood out was the post on the wiki about debugging that pointed to you being able to see the routing performance via the ‘AutoRoute’ variable - however I can not see that variable listed on the UI (no is doesn’t seem to be hidden)

So looking at the wiki page → http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions#ZWaveDevice1

Unless I’m mistaken (I probably am) there should be a service call “urn:micasaverde-com:serviceId:ZWaveDevice1” and a variable called AutoRoute and another one called ManualRoute that I could extract

So I wanted to start off by extracting the AutoRoute variable values to an external file, but I think because they cannot be found it won’t work.

local devID = 122 local autoroute = luup.variable_get("urn:micasaverde-com:serviceId:ZWaveDevice1", "AutoRoute",devID) local filename = '/nas/xyz.txt' local outf = io.open(filename, 'a') outf:write(os.date('%Y-%m-%d %H:%M:%S '..os.time()..'\n')) outf:write("This is a the routing performance of the Everspring plug socket.") outf:write(autoroute .. "\n") outf:close()

Do those two variables exist?

I have no problem requesting to get the variable via the http api for AutoRoute.

http://<vera_ip>:3480/data_request?id=variableget&serviceId=urn:micasaverde-com:serviceId:ZWaveDevice1&DeviceNum=<device_id>&Variable=AutoRoute

  • Garrett

Thanks @garrettwp,

Stupidly after running it via the http api I realised I had been using the wrong DeviceID - doh!

I saw some code from @Ap15e and would appreciate some help to use it to modify my script above so it will list all my z-wave devices and their auto route values.

[code]
– Vera - Dead Battery Devices
– local filename = ‘/etc/cmh/dead_devices.log’

local filename = ‘/nas/xyz.txt’

local outf = io.open(filename, ‘a’)

outf:write(os.date(‘%Y-%m-%d %H:%M:%S ‘…os.time()…’\n’))

for k,v in pairs(luup.devices) do

if (v.device_num_parent == 1) and (not v.invisible)
then

Capabilities = luup.variable_get(‘urn:micasaverde-com:serviceId:ZWaveDevice1’,‘Capabilities’, v.udn)

if tonumber(string.match(Capabilities,‘([%d]*),’)) < 128
then

 WakeupInterval = luup.variable_get('urn:micasaverde-com:serviceId:ZWaveDevice1','WakeupInterval', v.udn)

 LastWakeup     = luup.variable_get('urn:micasaverde-com:serviceId:ZWaveDevice1','LastWakeup', v.udn)

 if (WakeupInterval ~= nil) and (LastWakeup ~= nil)
  then

   age = os.time() - tonumber(LastWakeup)

   if age > tonumber(WakeupInterval) 
    then

     outf:write(v.description..' is dead for '..math.floor(age/3600+0.5)..
                ' hour(s), WakeupInterval is '..WakeupInterval..' seconds\n')

    end


  end

end   

end

end

outf:close()[/code]

I tried the following but no joy.

[code]local filename = ‘/nas/xyz.txt’

local outf = io.open(filename, ‘a’)

outf:write(os.date(‘%Y-%m-%d %H:%M:%S ‘…os.time()…’\n’))

for k,v in pairs(luup.devices) do

if (v.device_num_parent == 1) and (not v.invisible)
then

autoroute = luup.variable_get(“urn:micasaverde-com:serviceId:ZWaveDevice1”, “AutoRoute”,v.udn)

then

outf:write(v.description .. ' has this route and performance 'autoroute .. "\n")

end
end
outf:close()[/code]

Try this:

[code]local filename = ‘/nas/xyz.txt’

local outf = io.open(filename, ‘a’)

outf:write(os.date(‘%Y-%m-%d %H:%M:%S ‘…os.time()…’\n’))

for k,v in pairs(luup.devices) do
if (v.device_num_parent == 1) and (not v.invisible) then
autoroute = luup.variable_get(“urn:micasaverde-com:serviceId:ZWaveDevice1”, “AutoRoute”,v.udn)
if autoroute ~= nil then outf:write(v.description … ’ has this route and performance ’ … autoroute … “\n”) end
end
end

outf:close()[/code]

Thanks Rex

It only lists 7 of my z-wave devices when I must have close to 20?

If you run it or something similar does it list all of your nodes ?

Also how would I add the node’s ID number before the v.description ?

E.g

outf: write('Node number ’ v.device … ’ known as ’ v.description… ’ has this route and performance '. …autoroute “\n”)

It lists all the parent Z-Wave devices on my system that have data in the autoroute variable. This excludes all the battery-operated units.

I have modified the code to list all Z-Wave devices and to include the node:

[code]local filename = ‘/nas/xyz.txt’

local outf = io.open(filename, ‘a’)

outf:write(os.date(‘%Y-%m-%d %H:%M:%S ‘…os.time()…’\n’))

for k,v in pairs(luup.devices) do
if (v.device_num_parent == 1) and (not v.invisible) then
autoroute = luup.variable_get(“urn:micasaverde-com:serviceId:ZWaveDevice1”, “AutoRoute”,v.udn) or “”
outf:write("Node: " … v.id … " Name: " … v.description … " has this route and performance: " … autoroute … “\n”)
end
end

outf:close()[/code]

Thanks again Rex,

it’s strange that not all z-wave devices report their autoroute values/performance. They all have neighbours listed, so I wonder why they do not show their routing performing - any ideas?

Also it would be pretty cool if this info could be more visually represented, so it could show people how their mesh network is performing and which routes are good and bad etc.

it's strange that not all z-wave devices report their autoroute values/performance. They all have neighbours listed, so I wonder why they do not show their routing performing - any ideas?
Those of mine that have no [i]autoroute[/i] values are all battery-operated devices. Presumably they didn't respond during the heal process.
Also it would be pretty cool if this info could be more visually represented, so it could show people how their mesh network is performing and which routes are good and bad etc.
Based on the results from my network, I wouldn't use it for any sort of guidance. Most of my devices show that all routes fail - despite working just fine. This includes one that is just three metres of open air from Vera. Go figure...

:slight_smile: Yes, it would be really helpful if MCV would describe the contributors to marking a route as bad (i.e. [tt]x[/tt]'ing it out); it somehow seems ‘trigger happy’.