In Openhab 2 I used my now.plusMillis(…) to create timers in my rules. I understand that Openhab 3 uses Java Time and the plusMillis(…) is not working anymore. How to I achive to run a command in 250 Milliseconds from now? What I want to achieve is to stop the rollershutter after a quater of a second.
createTimer(now.plusMillis(250))[ |rollo.sendCommand(STOP) ] obviously does not work anymore.
createTimer(now.plusSeconds(0.250))[ |rollo.sendCommand(STOP) ] also does not work.
Thank you very much for a hint…
I used the method
// duration in Nanoseconds
var Long duration = 250000000
var Timer t = createTimer(now.plusNanos(duration), [|
logInfo("Created Timer","Timer finished. Sending command: " + cmd)
Note: I copied the code snipped from above from my Lambda function. Please be aware, that the used variables
cmd are locally defined as
val to be possible to pass them into the lambda function!