Hi All,
I want use a Virtual Switch as timer (count down timer) for my Domoticz Alarm System.
When a violation is detected I turn on that Virtual Switch with "On Delay = 30 seconds".
if I turn off the alarm within 30 seconds, I want stop the On Delay so the switch never turn On, but I can't find a way to accomplish that.
let's explain better with a API JSON example:
Turn On the switch:
http://localhost:8080/json.htm?type=com ... itchcmd=On
the "On Delay" start and the switch will turn On to 30 seconds.
after 5 seconds I run:
http://172.16.1.10:8080/json.htm?type=c ... tchcmd=Off
but the switch anyway will turn On after 30 seconds.
anyone have a suggestion to accomplish this task? (create a "interruptible" countdown timer)
this is can be an useful Feature Request?
With kind regards
Can't interrupt "On Delay" or "Off Delay" timer
Moderators: leecollings, remb0
Re: Can't interrupt "On Delay" or "Off Delay" timer
Hi,
I did some testing on version 2.2574 and it acts like you described. But it's not the way you want it to work. How can we accomplish this?
There is a switch that is activating the count down timer. I'll name it [Countdown activate]. There is switch that acts as a counter, I'll call it [Countdown timer]. You can create an event like this:
If [Countdown activate] = 'On'
Do Set [Countdown timer] = 'On' after '30' seconds
Else if [Countdown activate] = 'Off'
Do Set [Countdown timer] = 'Off'
Result:
When I turn [Countdown activate] to 'On' when [Countdown timer] is 'Off', then after 30 seconds [Countdown timer] turns 'On'.
When I turn [Countdown activate] to 'Off' when [Countdown timer] is 'On', it turns [Countdown timer] to 'Off'.
When I turn [Countdown activate] to 'On' and within 30 seconds I turn [Countdown activate] to 'Off', [Countdown timer] will stay 'Off'.
I did some testing on version 2.2574 and it acts like you described. But it's not the way you want it to work. How can we accomplish this?
There is a switch that is activating the count down timer. I'll name it [Countdown activate]. There is switch that acts as a counter, I'll call it [Countdown timer]. You can create an event like this:
If [Countdown activate] = 'On'
Do Set [Countdown timer] = 'On' after '30' seconds
Else if [Countdown activate] = 'Off'
Do Set [Countdown timer] = 'Off'
Result:
When I turn [Countdown activate] to 'On' when [Countdown timer] is 'Off', then after 30 seconds [Countdown timer] turns 'On'.
When I turn [Countdown activate] to 'Off' when [Countdown timer] is 'On', it turns [Countdown timer] to 'Off'.
When I turn [Countdown activate] to 'On' and within 30 seconds I turn [Countdown activate] to 'Off', [Countdown timer] will stay 'Off'.
-
- Posts: 62
- Joined: Thursday 18 September 2014 20:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Can't interrupt "On Delay" or "Off Delay" timer
Hi mrf68,mrf68 wrote: If [Countdown activate] = 'On'
Do Set [Countdown timer] = 'On' after '30' seconds
Else if [Countdown activate] = 'Off'
Do Set [Countdown timer] = 'Off'
thank you very much for the fast reply and the useful suggestion!!!
Just tried and works perfectly!

This setup involve the creation of two virtual devices for every incorruptible countdown timer, but make possible to accomplish this challenge

Anyway, some days ago I opened a Feature Ticket [529] http://www.domoticz.com/forum/tracker.php?p=2&t=529
with an "idea" to make a more easy system to manage "count down timers" using special variables.
This must be developed and I don't know if implementing "special variables of this type" is a good way to manage this need, anyway creating many virtual devices, IMHO add useless complexity and can be simplified in other ways

If someone else appreciate the feature request, support it adding a note into 529 ticket

With kind regards.
Re: Can't interrupt "On Delay" or "Off Delay" timer
You're welcome. Together we'll make it work. (Could be a slogan?)jin wrote: Hi mrf68,
thank you very much for the fast reply and the useful suggestion!!!
Just tried and works perfectly!![]()
Kind regards,
-
- Posts: 1
- Joined: Wednesday 20 April 2016 13:55
- Target OS: Linux
- Domoticz version:
- Contact:
Re: Can't interrupt "On Delay" or "Off Delay" timer
I don't know if implementing "special variables of this type" is a good way to manage this need, anyway creating many virtual devices, IMHO add useless complexity and can be simplified in other ways
????

Who is online
Users browsing this forum: Google [Bot] and 1 guest