Page 1 of 1

siren duration set in seconds instead of minutes

Posted: Friday 11 March 2016 11:43
by TruusDom
Hey there, my first topic here.

I want to know if a door is opend, so i made a blocky.

When the door is opend the sirene Aeotec Gen5 will go on.
When the door is closed the sirene will go off. I set the time for max 1 minute in case the door is open all the time.
However, 1 minute is too long. I wish it could be 5 seconds, but this is not possible in blocky.
Can somebody help me to set the 1 minute time into 5 seconds? Please give me a step by step answer ;)

By the way the virtual switch only changes the sound theme.

Re: siren duration set in seconds instead of minutes

Posted: Sunday 13 March 2016 21:28
by georgesattali
Hello,
maybe you could add another blocky to set the Siren Off after 5 secs ?

if "Siren AEOTEC" = "On"
do Set "Siren AEOTEC" = "Off" After 5 seconds

meaning "if the siren goes on, put it off after 5 secs"

The "Set FOR" is in minutes, the "Set AFTER" is in secs (exactly for the type of problem you encounter ...)

Bye, Geo

Re: siren duration set in seconds instead of minutes

Posted: Monday 14 March 2016 19:38
by TruusDom
Thanks georgesattali,

I have got it working now.

Re: siren duration set in seconds instead of minutes

Posted: Sunday 15 May 2016 15:53
by TruusDom
Works great, but wen i leave the door open, the scene activates time after time. So the sirene goes on for 3 seconds and A minute later again voor 3 seconds ans so on.
Is there A scene command to stop this loop?

Re: siren duration set in seconds instead of minutes

Posted: Thursday 19 May 2016 9:23
by bijnavoornix
Cant you use a virtual switch? When door openend and vswitch is off, sound alarm and set vswitch to on. When door closed, vswitch to off

Sent from my MI 4LTE using Tapatalk

Re: siren duration set in seconds instead of minutes

Posted: Sunday 22 May 2016 12:26
by TruusDom
Thanks bijnavoornix, i will give it a try.

Re: siren duration set in seconds instead of minutes

Posted: Sunday 22 May 2016 12:38
by tozzke
I would use a variable to prevent retriggering
something like 'schuurdeur_opnieuw_sirene_triggeren?' which you set to 'ja' or 'nee' (or 1/0 if you're using an integer variable)
It could be something like:

Code: Select all

If [schuurdeur = Open] and [var schuurdeur_opnieuw_sirene_triggeren? = ja]
Do Set [Sirene = On]
   Set [Sirene = Off after 5 seconds]
   Set [var schuurdeur_opnieuw_sirene_triggeren? = nee]
Elseif [schuurdeur = Closed] and [var schuurdeur_opnieuw_sirene_triggeren? = nee]
Do Set [var schuurdeur_opnieuw_sirene_triggeren? = ja]

Re: siren duration set in seconds instead of minutes

Posted: Sunday 22 May 2016 14:00
by TruusDom
I have to many "and" conditions in blocky, so i guess i better try tozzke's sollution.
Thanks.

Re: siren duration set in seconds instead of minutes

Posted: Sunday 22 May 2016 15:08
by TruusDom
My scene seams to be corrupt. Made a new one and made a dummy switch. Works great. Thanks

Re: siren duration set in seconds instead of minutes

Posted: Wednesday 25 May 2016 20:14
by TruusDom
I cannot find "the green checkmark 'Mark topic as solved' at the post" to close this post.

Please close this post.