dzVents distribute script order processing

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

dzVents distribute script order processing

Post 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. ;)
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents distribute script order processing

Post 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).
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: dzVents distribute script order processing

Post 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.
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: dzVents distribute script order processing

Post by dannybloe »

Or you create a bunch of 'at *:xx' rules per script.
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: dzVents distribute script order processing

Post 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' }
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest