Delay based on value changing

Hello Apilio community - I’m hoping someone can help me out!

I have a Boolean (AcceptableWind) variable that updates when my wind sensor detects wind in an acceptable range.

I then have a condition (CALM_WIND) that is set if AcceptableWind is true for at least 20 minutes (the intent of the delay is to prevent the action (turning a water feature on and off) from cycling on and off repeatedly when the wind is “straddling” my threshold.

My issue is that IFTTT sends wind updates to trigger the Boolean frequently. So in the log, I’ll see a lot of “Boolean changed from false to false” or “Boolean changed from true to true”. The value didn’t change, but because the Boolean was updated from “false” to “false”, it resets the Delay timer and sometimes hours and hours can pass before the logicblock triggers.

Is there a way I can achieve the outcome I’m going for? Basically a 20min delay on the CALM_WIND condition that says CALM_WIND is true if AcceptableWind has been true for 20 minutes?

Thanks!

1 Like

Thanks for posting @Taurus! I think this is one for @pebneter AKA the :mage:t2:

Hmmm … :thinking: From how you describe your goal and setup I would say it should work.
You defined the delay on the condition, correct?

Yes, that is correct. 20 minute delay on the condition.

But when the IFTTT event triggers the Boolean update, even if it’s not changing the status from true<->false, it resets the “20 minute clock”.

So imagine every 5 minutes the IFTTT event triggers the Boolean update, but the status hasn’t changed from false. So the log shows “IFTTT updates value from false to false”. Nothing has actually changed, except that the 20 minute clock resets. Since this happens every 5 minutes, the condition will never be met because the 20 minute delay will never be satisfied.

Make sense?

Ok, understood so far. That’s how it was designed to work - a „false“ signal reinforces that „true“ is far away and therefore it resets the counter.
But if you get one true signal and the more of them while the count down is running, then it should not reset the counter.
So if you have a „true“ update and only „true“ follow up signals, the cont down will hit zero 20 minutes after the first true signal.

Is that working in your case? Would you expect it to work differently?

1 Like