Page 1 of 1

Script Processing Order

Posted: Friday 31 August 2018 10:32
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

Re: Script Processing Order

Posted: Friday 31 August 2018 10:42
by freijn
eeehhhhhh make 1 script instead of 10 ? or ?

Re: Script Processing Order

Posted: Friday 31 August 2018 17:34
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.