Thats unwanted and after some thinking i have a simple solution :
Create in the domoticz dir a batchfile named "run_command.bat"
Create in taskschedular a task named "z__run_command"
- this task executes the "run_command.bat"
- this task has no trigger (it will be triggered from the script below)
Code: Select all
function uitvoeren(tedoen)
local f = io.open("run_command.bat", "w") f:write(tedoen) f:close()
os.execute('powershell.exe Start-ScheduledTask -TaskName "z__run_command"')
end
The script above writes your command to the batch file and starts the scheduled task without almost any wait. (Powershell is very fast.)
Taskschedular will run the batch file in another process, no influence on domoticz.
Be aware there is no feedback and domoticz does not wait to finisch, it continues normally, thus no dependencies on the result are posible.
With a trick (redirect console to a txt file) it would be possible to get the result (by reading the txt file) but then you have to test it later as domoticz has allready seconds continued.