I am a beginner and spend quite some time looking for an answer in the forum… but was not successful yet.
Problem statement:
I want to display the remaining time of a timer I created within Blocky rule on one of my openHAB Pages. E.g. I have started a 15min timer and want to see how much time is left while the timer is running.
I think I have to “connect” the Blocky timer with a dedicated “Time remaining” item I have created. But I am not yet successful doing this.
Question:
Can someone please describe how to link a Blocky rule timer with a “remaining timer” item that can be displayed on a page?
A hack might be to update a DateTime Item when the timer is started, and then perform maths in a separate rule to determine the remaining time. But the UI display updates on Item state changes, so this rule would have to run very frequently.
Of course, you generally know the target execution time when you start the timer anyway, but that would have uses if you were managing a whole bunch of timers, say.
Update the time remaining Item with the amount of time on the timer.
Create a timer that expires in a second.
Inside the timer, subtract one second from the time remaining Item and update the Item
4a. If the time is up update the Item to 0 and do the work of the timer.
4b. if the time isn’t up, reschedule the timer for another second.