Blocky: Run LUA script with a delay of x seconds
Posted: Sunday 22 July 2018 8:34
In Blocky I run a LUA script. I want to run this script with a delay of x seconds.
Is this possible?
Is this possible?
Open source Home Automation System
https://forum.domoticz.com/
Probably not an ideal solution as the event system in domoticz is single threaded. So it will have to wait until the lua script with the delay is finished.leonmoonen wrote: ↑Sunday 22 July 2018 11:21You could change the lua script so it starts with a delay/sleep. Here are some suggestions on building a sleep function in lua: http://lua-users.org/wiki/SleepFunctionRitmeester wrote: ↑Sunday 22 July 2018 8:34 In Blocky I run a LUA script. I want to run this script with a delay of x seconds.
Is this possible?
If it is external script (so started from os level) you can use the OS mechanism for running it in the background. So in linux you could start it with a trailing &.leonmoonen wrote: ↑Sunday 22 July 2018 11:52 Wow, I had fully expected that such ‘secondary’ scripts (i.e., started in a event handling script like blockly) would be executed on the background...
Is there a reason not to do so (except if you’d want to get a value back)?
Code: Select all
Error: EventSystem: Warning!, lua script Post Box Switch has been running for more than 10 seconds