Script Processing Order

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

Moderator: leecollings

Post Reply
DanM
Posts: 79
Joined: Thursday 23 October 2014 22:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Script Processing Order

Post by DanM »

Hi,

Suppose I have 10 scripts all triggered by the same motion sensor... one of which actually turns the light on and the rest of which are less urgent. How can I ensure the one that turns the light on runs first? If I cant is there to call a dzvents script at the end of another script (so main script is called by the motion sensor, other script called at the end) Ideally in this case the other script needs to be dzvents as it will have other triggers.. cant be a generic lua function easily I dont think.

Cheers,

Dan
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Script Processing Order

Post by freijn »

eeehhhhhh make 1 script instead of 10 ? or ?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Script Processing Order

Post by waaren »

DanM wrote: Friday 31 August 2018 10:32 Suppose I have 10 scripts all triggered by the same motion sensor... one of which actually turns the light on and the rest of which are less urgent. How can I ensure the one that turns the light on runs first? If I cant is there to call a dzvents script at the end of another script (so main script is called by the motion sensor, other script called at the end) Ideally in this case the other script needs to be dzvents as it will have other triggers.. cant be a generic lua function easily I dont think.
You can influence the running order by using the desired order in the scriptnames. Script 1xxxx will be processed before 2xxxx
Because the domoticz event system (and therewith dzVents) is single threaded script 2xxxx will not start before 1xxxx has finished.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest