Countdown timers (user variable)

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
hschokker
Posts: 2
Joined: Saturday 19 May 2018 8:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Countdown timers (user variable)

Post by hschokker »

I would like to make a blockly event that will turn a lamp on if there is movement detected and the lamp is currently off. Then I would also like that event to start a countdown timer (in a similar way as setting a user variable) for n seconds which automatically countsdown seperate from the blockly event.

With another blockly event I would like to set that timer back to n seconds if movement is detected.

Finally I would like to make a third blockly event that turns the light off when the timer reaches 0 seconds.

By doing it like this I can seperate movement sensor light actions easiliy from wallswitches. A wallswitch will now set the timer to -1 or sonething (not triggering the blockly to turn off the light) and it can switch the light on or off based on the current light status. (I have multiple wallswitches for one light)

Countdown timers could be added within the user variables. If we just have the option to make an integer variable a automatic countdown one I would be able to do the things I want. (you could also allow for setting to countdown seconds/minutes/hours)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Countdown timers (user variable)

Post by waaren »

Until this request is implemented; Would it be an option to create a dummy device with an off delay and use that as your timer ?

Swtich the dummy device On and trigger your part of the code, that need to be executed when the timer expires, when the device switches Off
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
hschokker
Posts: 2
Joined: Saturday 19 May 2018 8:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Countdown timers (user variable)

Post by hschokker »

waaren wrote: Saturday 19 May 2018 9:56 Until this request is implemented; Would it be an option to create a dummy device with an off delay and use that as your timer ?

Swtich the dummy device On and trigger your part of the code, that need to be executed when the timer expires, when the device switches Off
I will try that, it is an option if the dummy switch can be turned on again when it is within its off delay (to reset the off delay timer)

EDIT: It works, I made a dummy switch that turns on with a 30 second delay. If it is still within the turn-on delay and I turn it on again it will wait for the whole 30 seconds again. This works relatively well for the case i described. I am having some small issues but that is probably due to some other things.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest