dzVents ping tool, yet another option
Posted: Wednesday 19 June 2019 22:41
I want to make my own dzVents ping tool.
Maybe there are some on the WWW, but i am having fun making things and think about it. And of course, trying to learn something out of it.
The scripts i started with, that works for 1 device.
But would like to have multi devices in the same script.
Tried it with this code. But somehow it doesn't take the IP address out of the list.
Is there somebody wo can help?
Maybe there are some on the WWW, but i am having fun making things and think about it. And of course, trying to learn something out of it.
The scripts i started with, that works for 1 device.
But would like to have multi devices in the same script.
Tried it with this code. But somehow it doesn't take the IP address out of the list.
Is there somebody wo can help?
Code: Select all
return {
on = {
devices = {'Samsung werk'
}
},
execute = function(domoticz, device)
-- Device name IP-adres
local devices_ping = {
['Gateway'] = 'xxx.xxx.xxx.xxx',
}
for _, node in pairs(devices_ping) do
local ip = devices_ping[node]
print(ip)
--local ip = 'xxx.xxx.xxx.xxx'
ping_success=""
ping_success=os.execute('ping -c1 -w1 ' .. ip)
if ping_success then
print("ping success ")
else
print("ping failed ")
end
end
end
}