jswim788
(John Schmitz)
March 16, 2019, 6:56pm
4
There’s been some discussion on this that you might want to look at. It’s mostly a looping timer. As far as I see there is no direct way to read the timer value, but the solutions work around that.
So I have been trying this for hours and I cant wrap my head around it.
I am setting up an automated irrigation, which is working very well, especially through the help of @rlkoshak ’s design patterns. It takes my hours to understand them (no computer savvy background whatsoever) but I got there. A Post in the solutions area will follow, once everything works to my satisfaction.
I have a Number Item (Setpoint in Sitemap) where I can set the IrrigationDuration in Minutes.
When Automated Irrigat…
Hi all,
I created:
timer = createTimer(now.plusSeconds(180))
is there a way to Display the value of a timer in my Sitemap in iOS App?
I tried to Format the string somehow but nothing works
Any help is much appreciated.
Regards
Joerg
I´m currently testing with timers and I want to know the timer “state” (what´s the current count) if a rule will execute something. So that´s my question: How could I log the timer “state”?
I´ve created a timer with
timers.put(sw.name, createTimer(now.plusSeconds(TimerTimeoutSeconds), [| … ]))
But if I want to log the timer with
logInfo(“testrule”, "Time remaining: " + (timers.get(sw.name)))
i´ll get
“Time remaining: org.eclipse.smarthome.model.script.internal.actions.TimerImpl@224ecf…
And the looping time design pattern:
Edit: Update for OH 4
Please see Design Pattern: What is a Design Pattern and How Do I Use Them to understand the scope and purpose of this and other Design Patterns.
Problem Statement
Often one may require a loop in a Rule, to wait for some event to occur or some state to change before doing something. For example, if a door is opened for a long time to send an alert every hour until the door is closed.
Concept
[image]
Use a Timer that reschedules itself instead of a while loop or sleeps.
…