16.08.2021, 07:39
Use this:
Code:
devices = {
{ address = '1.1.1', motion = '2/1/1' },
{ address = '1.1.2', motion = '2/1/2' },
}
content = ''
for _, dev in ipairs(devices) do
result = knxlib.ping(dev.address)
if result == false then
content = content .. 'Motion Detector - Address: ' .. dev.address .. ' - <b>IS OFFLINE!</b><br>'
grp.checkwrite(dev.motion, false)
end
os.sleep(0.5)
end
if content ~= '' then
res, err = mail('123456@gmail.com', 'KNX Installation Fault', content)
end