executeShellCommand() And command option  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
acaonweb
Posts: 78
Joined: Thursday 23 March 2017 14:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

executeShellCommand() And command option

Post by acaonweb »

Hi guys,
I’m trying to send an executeShellCommand() repeating it.
I’ve tried something like

Code: Select all

dz.executeShellCommand(‘my command’).repeatAfterSec(1, 3)
but I get an error.
How resolve?

Thanx in advance.
Fabrizio
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: executeShellCommand() And command option

Post by waaren »

acaonweb wrote: Tuesday 06 April 2021 21:47 I’m trying to send an executeShellCommand() repeating it.
How resolve?
Option repeatAfterSec is not available for executeShellCommand.

You could use

Code: Select all

for delay = 0, 2 do 
    dz.executeShellCommand(‘my command’).afterSec(delay)
end
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
acaonweb
Posts: 78
Joined: Thursday 23 March 2017 14:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: executeShellCommand() And command option  [Solved]

Post by acaonweb »

thanx so much
with this code delay is 0,1,2 so three times every 1 second.

Great :)
acaonweb
Posts: 78
Joined: Thursday 23 March 2017 14:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: executeShellCommand() And command option

Post by acaonweb »

and what if i'd like do 4 times every 3 seconds?

Code: Select all

for delay = 0, 9, 3 do 
    dz.executeShellCommand(‘my command’).afterSec(delay)
end
It's like that?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: executeShellCommand() And command option

Post by waaren »

acaonweb wrote: Wednesday 07 April 2021 16:21 and what if i'd like do 4 times every 3 seconds?

Code: Select all

for delay = 0, 9, 3 do 
    dz.executeShellCommand(‘my command’).afterSec(delay)
end
Yes, that will do the executeShellCommand after 0,3,6 and 9 seconds
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
acaonweb
Posts: 78
Joined: Thursday 23 March 2017 14:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: executeShellCommand() And command option

Post by acaonweb »

thanx :)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest