Page 1 of 2

afterSec(x)

Posted: Saturday 05 August 2017 11:21
by bdormael
Maybe a stupid question:

for devices we have:
device.switchOn().afterSec(10)

Can't we have this also for variables like:
variable.set('my_value').afterSec(10)

In normal LUA you can do this for variables

Re: afterSec(x)

Posted: Saturday 05 August 2017 22:38
by dannybloe
Oh I didn't know that. I'll add it.

Re: afterSec(x)

Posted: Sunday 06 August 2017 7:31
by bdormael
dannybloe wrote:Oh I didn't know that. I'll add it.
Thx


Verzonden vanaf mijn iPad met Tapatalk

Re: afterSec(x)

Posted: Monday 14 August 2017 12:50
by mikkel75
I'm also looking for this feature - is it added now?

Thanks!

Re: afterSec(x)

Posted: Monday 14 August 2017 19:11
by dannybloe
Not yet.. just got back from vacation. Catching up here...

Re: afterSec(x)

Posted: Wednesday 23 August 2017 9:46
by mikkel75
OK...but pleaaaaaseeee implement this soon - I really need it for my alarm system :)

Thanks...

Re: afterSec(x)

Posted: Wednesday 23 August 2017 9:51
by dannybloe
I'm testing it right now on my production machine. I want to have it running for a little before we start creating Pull Requests.

Re: afterSec(x)

Posted: Wednesday 23 August 2017 14:34
by mikkel75
Sounds really good...thanks so much for doing this...

Re: afterSec(x)

Posted: Friday 25 August 2017 11:51
by DewGew
Is it possible to use time option to a function also? eg. " myfunction().afterSec(delay)"

Re: afterSec(x)

Posted: Friday 25 August 2017 12:07
by dannybloe
No, that's handled by the Lua interpreter. Calling a function has nothing to do with Domotic's scheduling support.

Re: afterSec(x)

Posted: Tuesday 29 August 2017 10:13
by mikkel75
dannybloe wrote: Wednesday 23 August 2017 9:51 I'm testing it right now on my production machine. I want to have it running for a little before we start creating Pull Requests.
How's the testing going? :)

Re: afterSec(x)

Posted: Wednesday 30 August 2017 8:21
by dannybloe
Taking longer than expected as quite some changes have to made in the Domoticz event systems. Still working on that.

Re: afterSec(x)

Posted: Wednesday 30 August 2017 9:37
by mikkel75
OK - thanks again for your effort!

Re: afterSec(x)

Posted: Thursday 07 September 2017 8:41
by mikkel75
Any progress? ;)

Re: afterSec(x)

Posted: Monday 09 October 2017 11:42
by mikkel75
Are we getting closer to a solution? :)

Re: afterSec(x)

Posted: Monday 09 October 2017 19:37
by dannybloe
Eh.. it is released in 3.8551 so give it a try.

Re: afterSec(x)

Posted: Wednesday 11 October 2017 14:22
by bdormael
dannybloe wrote: Monday 09 October 2017 19:37 Eh.. it is released in 3.8551 so give it a try.
Working perfect, thx

Re: afterSec(x)

Posted: Tuesday 16 January 2018 13:10
by mikkel75
Question:

Is it possible to cancel an .afterSec() before it is activated (the time has passed)?

The use-case is for an alarm system, where I use afterSec to time from when the PIR is trigged to when the siren should start. I want to be able to cancel the siren if the alarm is disarmed.

Thanks,
Mikkel

Re: afterSec(x)

Posted: Tuesday 16 January 2018 13:13
by dannybloe
In the upcoming dzVents 2.4 you can do device.cancelQueuedCommands(). Until then you can try device.setState(device.state)).

Re: afterSec(x)

Posted: Tuesday 16 January 2018 14:35
by mikkel75
Hi,

Thanks for the quick reply.

I do it like this:

domoticz.variables('SoundSiren').set('0')

But that doesn't cancel the afterSec() - it's still called after the time-out.

Any other suggestions that might work?

Thanks.