Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OH3] Rescheduling timer failed #2131

Closed
MarcinJakubczyk opened this issue Jan 18, 2021 · 1 comment · Fixed by #2153
Closed

[OH3] Rescheduling timer failed #2131

MarcinJakubczyk opened this issue Jan 18, 2021 · 1 comment · Fixed by #2153

Comments

@MarcinJakubczyk
Copy link

MarcinJakubczyk commented Jan 18, 2021

Reschedule timer ends with warning log and no action:
[WARN ] [el.script.internal.actions.TimerImpl] - Rescheduling failed as execution has already started!

Documentation says this should be possible:
Reschedules a timer to a new starting time. This can also be called after a timer has terminated, which will result in another execution of the same code.
source: https://openhab.org/javadoc/latest/org/openhab/core/model/script/actions/timer#reschedule(java.time.ZonedDateTime)

Example rule:

var Timer testTimer

rule "Reschedule test"
when
    Item TestSwitch changed
then
    logInfo("RescheduleTest", "TestSwitch changed")

    if (testTimer !== null)
    {
        logInfo("RescheduleTest", "Timer state: " + testTimer.hasTerminated + testTimer.isRunning + testTimer.isActive)

        testTimer.reschedule(now.plusSeconds(10))
    }
    else
        testTimer = createTimer(now.plusSeconds(10), [|
            logInfo("RescheduleTest", "Test timer fired")])
end

Test switch:

Switch  TestSwitch

Related discussion: https://community.openhab.org/t/oh3-timer-reschedule-failed/112912
Related source code:

@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/oh3-timer-reschedule-failed/112912/10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants