Page 1 of 1

Re: Lua for PING with sleep

Posted: Monday 27 November 2017 16:02
by emme
cannot really figure it out.... but...
I think os.execute will return the errorlevel for the command.... not for the reply of it..
os.execute('ping -c1 192.168.0.150') will always return true even if the ping is not successful because the command ping were executed with no error

anyhow... it runs with no error into my deomoticz installation...
UNLESS....
you delete the script while it is wtill runing... then I got such error :P

Re: Lua for PING with sleep

Posted: Monday 27 November 2017 16:11
by BakSeeDaa
That script will stall the Domoticz event system. You don't want that. Don't do it.

Re: Lua for PING with sleep

Posted: Monday 27 November 2017 21:12
by JimmyH1969
How about the integrated "System alive checker"?

Re: Lua for PING with sleep

Posted: Monday 27 November 2017 21:59
by Jan Jansen
In the first place I can't say how to do. Perhaps it is possible to set the script on or off with a virtual (timer) switch. I would like that option.

Re: Lua for PING with sleep

Posted: Monday 27 November 2017 23:27
by JimmyH1969
Just go to hardware and add the system alive checker.
When it's added you can configure it and add the ip adresses of all the systems you like to check and specify timeout's etc.
For every device you add a virtual switch is created. You can use that switch in other scripts like, when virtul switch is off (unable to ping that system) send a message, switch a light, whatever

Re: Lua for PING with sleep

Posted: Tuesday 28 November 2017 8:45
by JimmyH1969
:D