Timers... EDIT: Switch On/Off-delay function

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
Ricard1
Posts: 62
Joined: Saturday 07 November 2015 12:30
Target OS: Windows
Domoticz version: Beta
Location: Sweden
Contact:

Timers... EDIT: Switch On/Off-delay function

Post by Ricard1 »

I would like to propose a change in Timers function.

Correct me if I am wrong but as I understand it Timers function is a basic counter held in memory. By this you get in trouble if Domoticz crash or is rebooted during a Timer session, it is lost and leaving i.e. Switch in On state forever. This can be expensive in my example when I use Timers for Delayed Off for temporary infra heaters in my conservatory. A few times it happens those timers was altered by both Domoticz crash-restart as well my own reboot and I did not recall to re-initiate the timer, leaving the 2.3KW heaters On for two days until I noticed it...

I think Timers in a modern design should be a set to an Actual Time in the Database, meaning; Device "Timer" in Database set to the Time of activation plus the user set Timer delay. In this way timers are saved and will still be executed at the exact time even Domoticz restart.

By this approach I guess Times would also be easier to improve, i.e. showing timer Due time and/or rest time to due. Or maybe in Edit Switch, include an option to show a "Set Timer" button for direct input of delay on/off Time.

I do not know the efforts in coding this change would demand, or possible downsides for other users, I just wanted to address my bad experiences in the present solution.

Any thoughts or ideas to this? :)

Stay safe!
Last edited by Ricard1 on Monday 25 January 2021 22:09, edited 1 time in total.
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Timers...

Post by erem »

i am not sure what you are asking here
if you mean for Domoticz to check if a device should be on according to it's timer plan that becomes messy very quick.
suppose the device has no timer plan, but a scene or group with that device has, r the device is switched manually outside timer hours.

a better solution to your problem would be (IMHO) to switch off all/some devices at reboot.
you can do that with

Code: Select all

on = {
    system = {'start''}
}
from here: https://www.domoticz.com/wiki/DzVents:_ ... 6.7D_3.0.0

or look here:viewtopic.php?t=19967

just my $.02
Regards,

Rob
Ricard1
Posts: 62
Joined: Saturday 07 November 2015 12:30
Target OS: Windows
Domoticz version: Beta
Location: Sweden
Contact:

Re: Timers...

Post by Ricard1 »

Hi erem,

Thanks for your inputs and tips on DzVents script. Just turning everything off after reboot is not preferable, it would i.e. turn off all night lights..., and manually edit a script for each device is not so user friendly.

But sorry I was unclear, I meant "On-delay" / "Off-delay" entered in seconds, under Edit on switches not the date/time Schedules under Timers.

On/Off-delays function would better create a database day/time Schedule On or Off, like I wrote "present time+user set delay = On or Off". By this it would be possible to implement a function that after Domoticz startup looks for missed On/Off-delay events, and If found this function set the Switch to expected state.

Automation systems should by design try avoid "unexpected states", in different scenarios. Reboots are expected for computers of course, planned or not, it should not lead to unexpected states in the running application.
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: Timers... EDIT: Switch On/Off-delay function

Post by erem »

aaaah, much clearer now

I do not believe the on/off delay should be (mis)used like that and i fail to see how "present time+user set delay = On or Off" would yield information on when to switch that device.
you would need info on when the device is supposed to be on, and compare that to the current date/time.

however, a script that evaluates all timers at startup would most likely fit your needs.

looking at the database i see two tables that hold timers. one for scenes/groups and one for devices. looping thru those and evaluating the criteria would meet your needs IMHO.

that would be a nice feature request.
Regards,

Rob
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest