Page 1 of 1

sleep/delaying actions

Posted: Wednesday 04 September 2019 12:33
by ricorico94
Hi,

I'm trying to move from bash scripts to DZVents.. One of my bash script is opening a movie screen to a specific length, but the only way I have is to send a command (to a domoticz switch, type Venetian Blinds EU) for starting "opening" the screen and then send another command to stop the opening after 12.5 seconds (not 12s, not 13s...). It does work well in bash with a sleep(12.5) command.
How could I do that in DZvents ? I saw the command like "afterSec" , but can it use decimal values ?
If the name of my device is Screen, is the best way as follows ?

Code: Select all

domoticz.devices('Screen').open
domoticz.devices('Screen').stop.afterSec(12.5)

Also, another quick question about the repeatAfterSec(X,Y) command: is the Y the number of occurences after the initial one, or after ?
I ask that because when I used that in a script, I used this:

Code: Select all

domoticz.devices('MyButton').switchOn().repeatAfterSec(1, Number)
and if Number=1, the button seems activated twice.. laways one more. This doesn't seem in line with what I had understood from the documentation on wiki.

br,
Ricorico94

Re: sleep/delaying actions

Posted: Wednesday 04 September 2019 15:04
by waaren
ricorico94 wrote: Wednesday 04 September 2019 12:33 If the name of my device is Screen, is the best way as follows ?

Code: Select all

domoticz.devices('Screen').open
domoticz.devices('Screen').stop.afterSec(12.5)
Yes that is the best way.
Also, another quick question about the repeatAfterSec(X,Y) command: is the Y the number of occurences after the initial one, or after ?
I ask that because when I used that in a script, I used this:

Code: Select all

domoticz.devices('MyButton').switchOn().repeatAfterSec(1, Number)
and if Number=1, the button seems activated twice.. laways one more. This doesn't seem in line with what I had understood from the documentation on wiki.
The repeatAfterXXX(1,1) repeats the action. So the switchOn is repeated once = 2 times a switchOn.
First one immediate and the repeat after 1 second