Is this created with the internal Editor? If so, you probably have All in the dorpdownbox under LUA and need to change that to "Time".
I wouldn't recommend to have this script ran with the eventsystem as that is single threaded and could create a delay for other events.
Jos
ps, I would also add a test whether the switch actually needs to be changed:
Code: Select all
commandArray = {}
ping_success = os.execute('ping -c1 192.168.1.101')
if ping_success then
if otherdevices['testping'] == 'Off' then
print("macbook is online")
commandArray['testping'] = 'On'
end
else
if otherdevices['testping'] == 'On' then
print("macbook offline")
commandArray['testping'] = 'Off'
end
end
return commandArray