Page 1 of 1

Toggle Function or Siren Off for Minutes in Blocky

Posted: Saturday 08 July 2017 14:57
by WBTech
Hi, I am using a PIR/Microwave Outdoor Motion-detector to prevent failure alarm. The Motion-detector alarm signal is connected to a Fibaro Universal Binary Switch which gives alarm to a AEON Siren Gen5. This works fine, but as the Motion-detector has multiple areas I get a lot of signals if somebody is passing the whole area. My Question: Is it possible by using only Blocky to switch off the Siren after some seconds for some minutes after the first alarm signal ? I tried to switch off the siren for 2 minutes by Blocky, but the siren will be armed every time again (within the 2 Minutes) the Fibaro Universal Binary sensor gives a new signal. (sometimes 10 times and more within one minute).

If a "Toggle" option would be available in Blocky it should work. My idea: Switch On the siren after the first alarm signal for some seconds and then switch off the siren for some minutes after the sensor starts to toggle.

Maybe someone has a idea how to solve this only by Blocky. In the Forum I only could find some solutions by programming.

Thanks and best regards

WBTech

ps: I could not add my Blocky example to the Forum by using copy&paste

Re: Toggle Function or Siren Off for Minutes in Blocky

Posted: Saturday 08 July 2017 16:40
by K3rryBlue
you can use a custom var. Didn't test it.
In this case after triggering the custom var is set to 1 for a certain amount of time, which causes the IF to fail.
You need to define the lenght in seconds. Prob the time that the PIR keeps pushing signals.

IF PIR = On and custom var = 0
DO Alarm = ON
Set Alarm = Off after 60 seconds
Custom var = 1
Set Custom var = 0 after 240 seconds

Re: Toggle Function or Siren Off for Minutes in Blocky

Posted: Sunday 09 July 2017 16:24
by WBTech
Thanks, sounds good I will test it in the next days.

Re: Toggle Function or Siren Off for Minutes in Blocky

Posted: Monday 10 July 2017 15:55
by WBTech
Hi K3rryBlue, your suggestion worked fine ! I am new in Domoticz and had not yet worked with variables, but they are quite useful. I will use them also for other tasks in the future. Thanks and best reagrds
WBTech

Re: Toggle Function or Siren Off for Minutes in Blocky

Posted: Monday 10 July 2017 18:24
by K3rryBlue
you're welcome.

If you find maintaining these custom vars troublesome, you can also replace them with virtual switches. They give you a direct view on their value and easier to program with blockly. you might even use these switches to perform additional actions.

Re: Toggle Function or Siren Off for Minutes in Blocky

Posted: Tuesday 11 July 2017 15:46
by WBTech
Thanks for your additional information. The possibilities of virtual switches sounds interesting. I will do some tests to find out what is better working under special conditions. I am using Domoticz now for security reasons, home automation and solar.