Page 1 of 1
Countdown
Posted: Friday 20 November 2015 8:37
by Robban
Hi
I am about to make an alarm system with domoticz and RpI and now i wonder
how do i make a countdown from 30 sek in blocky or Lua?
like..
if front door=open then start countdown
Re: Countdown
Posted: Friday 20 November 2015 9:06
by BakSeeDaa
You can create a virtual switch device then set an Off delay of the desired time. After you turn it on it will turn itself off after it's reached the time for it's off delay. You can then trigger on the virtual device change.
Re: Countdown
Posted: Friday 20 November 2015 9:25
by rgroothuis
You can check the "last modified status", this has a date/time in it. Compare the date/time against the current date/time and you know the time difference. Do this in a time based Lua script.
Re: Countdown
Posted: Friday 20 November 2015 13:50
by pluggin
Robban wrote:Hi
I am about to make an alarm system with domoticz and RpI and now i wonder
how do i make a countdown from 30 sek in blocky or Lua?
like..
if front door=open then start countdown
I do what you need with SET/AFTER
The rule do this:
If door or windows = open then wait 15 sec and turn on the Siren (This give me time to deactive the alarm)
If Siren = on then turn ON living room light for 5 minutes / turn it OFF SIREN after 5 minutes
Re: Countdown
Posted: Friday 20 November 2015 13:57
by Robban
ok, think i getting the hang of it,
however,
is it possible to make:
if door =open then countdown
if countdown>0 and <30 and pushbutton=on then stop countdown and deactivate alarm
?