Page 1 of 1

dzVents distribute script order processing

Posted: Wednesday 02 August 2017 11:45
by EddyG
I am using V3.8153 and converted all my dzVents scripts to the last dzVents version.
A lot of the script run on the 1, or 5 or 10 minutes boundery.
What is the best way (performance wise) to convert some of the scripts to other bounderies to get a better distibution of the processing.
Mainly because every hour the system is "too" busy en some of the scripts end with the 10 sec. error.
Is there away to to force the order the scripts run? I noticed that currently only the scriptname is the order.
I had to rename some of my scripts to start with a 'z' and alike.
Otherwise this is a feature request. ;)

Re: dzVents distribute script order processing

Posted: Wednesday 02 August 2017 11:55
by dannybloe
well, the boundaries are dictated by the minute value in the current time. So every 5 minutes is at x:05, x:10 etc. You can't offset it as it will make things very complicated as you have to know when you pass the hour and shift stuff.. Can of worms. What you can do of course is create your own timer function and determine yourself when you want your script to be executed (or an active function).

Re: dzVents distribute script order processing

Posted: Wednesday 02 August 2017 13:06
by EddyG
Oke, thanks. I will run the script every minute and do the logic in the beginning of the 'execute' part for some of the scripts.

Re: dzVents distribute script order processing

Posted: Wednesday 02 August 2017 13:17
by dannybloe
Or you create a bunch of 'at *:xx' rules per script.

Re: dzVents distribute script order processing

Posted: Wednesday 02 August 2017 13:24
by EddyG
I solved it like at the beginning of the excecute part:

CurMin = domoticz.time.min
if (CurMin + 2) % 5 == 0 then
...code
end

What could be faster, your bunch of rules or my solution?

--- edit
After investigation I changed in:

timer = { 'at *:03', 'at *:08', 'at *:13', 'at *:18', 'at *:23', 'at *:28',
'at *:33', 'at *:38', 'at *:43', 'at *:48', 'at *:53', 'at *:58' }