This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Support Request on Lua Scripting
#2
There is probably some better ways but I did something like this (Function 1):
Code:
addresses = {
'1.1.3',
'1.1.5',
'1.1.6',
'1.1.7',
'1.1.9',
'1.1.18',
'1.1.19',
'1.2.1',
'1.2.2',
'1.2.3',
'1.2.4',
'1.2.5',
}

--Address count
ie=1
while (addresses[ie]~=nil) do
  ie=ie+1
end

--ping addresses
content='<b>KNX Physical Address check</b><br><br>'
content2=''
--log('Checking')
for i = 1, ie-1, 1 do
  result = tostring(knxlib.ping(addresses[i]))
  if result == 'false' then
    content2 = content2 ..'Address: '.. addresses[i] .. '   -   ' .. '<b>ERROR!</b>' .. '<br>'
  end
end
--log('Check completed...')

--send email
if content2 ~= '' then
  res, err =   mail('feedback@buildingautomation.ee', 'Physical Address check result', content .. content2)
end

Probably I would use Dynamic Folder in ETS to get all needed devices with physical addresses and save/print it to pdf. Copy all PA-s to notepad++ and use replace function to modify PA-s (like they are in script on line 2 to 13) that you can copy all addresses to script at once. It's about 10 min job to get all 175 addresses into script.
I hope this helps...
Reply


Messages In This Thread
RE: Support Request on Lua Scripting - by fleeceable - 12.08.2021, 18:05

Forum Jump: