Multiple afterSec for same device
Posted: Tuesday 02 June 2020 22:34
Already asked it in another topic. But i guess i could beter have created another one.
What i saw in the other topic was multiple use of afterSec for the same device.
However i can't get it working.
Only my last set statement is executed.
found something in de doc about scheduled commands within the range of the new scheduled command is automaticly canceled.
Therefore i changed the order by schedule first that command with the highest time. But this isn't working either; at the end, only the last command is executed.
Simple example:
you should expect that varTest=2 after 2(or more) seconds. But it looks like .set(1) command is also canceling the set(2) command. So i end up with varTest=1 after 2 seconds.
is this a bug? Or can't you schedule multiple commands for 1 device/var?
Original post:
https://www.domoticz.com/forum/viewtopi ... 90#p249090
What i saw in the other topic was multiple use of afterSec for the same device.
However i can't get it working.
Only my last set statement is executed.
found something in de doc about scheduled commands within the range of the new scheduled command is automaticly canceled.
Therefore i changed the order by schedule first that command with the highest time. But this isn't working either; at the end, only the last command is executed.
Simple example:
Code: Select all
return {
on = {
devices = {
"SwitchTest"
}
},
execute = function(domoticz, device)
local varTest = domoticz.variables("VarTest")
varTest.set(2).afterSec(2)
varTest.set(1).afterSec(1)
end
}
is this a bug? Or can't you schedule multiple commands for 1 device/var?
Original post:
https://www.domoticz.com/forum/viewtopi ... 90#p249090