[App][Pro] Loops

Menno,

Thats correct I use the start card bud stil not working.

Greetz Mark

Hi @Menno_van_Hout.
Absolutely love this app, works very good.

Would it be possible for you to build something that makes it possible to see which Loops are currently running, and how many iterations remain for each of those Loops, and how much time will remain for the next iteration?

best regards,
Twan

1 Like

You could also do this with the Chronograph app and Transitions.

Really struggling to get to grips with this. Here is my simple test and nothing happens:

I get no messages for start, iteration or finish. And Homey tells me the “start loop” when tag executes and finishes in 13 ms

What am I not understanding here?

Seems good as long as you trigger the “Start loop…” card.
To check if you are not encountering a bug try “test” instead of “Test_Loop”.
Maybe there is a bug in uppercase or special chars?

Renamed it “test” as suggested but still nothing when I “test from here” the START LOOP card. Or just start it from a START card

agree, but lets celebrate that people spend their time on these apps, even if we do see the specific use case, or think it can be done in another way. just my 2 cents…

This just isn’t working. I get the “The test has started” message but none of the messages in the Loop “test”

Make sure the flow is enabled.

:man_facepalming:

It was that simple! I’ve never had to “enable” a flow before, but that seemed to do the trick. Thank you.

Now I wanna know it as well as app developer hahaha.
So you accidentally had the flow disabled?

Well it’s a bit strange as the block of code sits inside an advanced flow with lots of isolated test blocks. I have never had to “enable” the flow before, I just create the block and test. On Caseda’s recommendation I right clicked and “enabled” the whole Advanced Flow (there was no indication that it was disabled) and suddenly, the block worked.

I shall now incorporate the “real” routine into my flows and test again.

With loop blocks specifically, if the flow has been triggered too frequently in a short amount of time, homey will disable the flow.

Hi, I was wondering what “should trigger finished card: yes/no” means and what it’s good for in the “kill loop” card. Basically I’ve got an advanced flow that when a (vibration) sensor is triggered it’ll start a loop with a one second delay. And another “when card” as long as the loop iterates I’ll have a then"light blink (short)" card. But when the sensor when get’s back to normal/is deactivated (which is usually after 30sec by default) then a call the “kill loop” card. I didn’t notice a difference for the yes/no setting of this card. Can someone explain it’s use?

Besides: Would it be an idea to have a simplified loop card where only requiring the delay setting in those cases another event would have to stop the loop? - Currently I just set the iteration count to some very high value, because in theory the loop could run indefinitely as long as the sensor stays active.
Cheers, Michael

Hi michael:

Example:
A loop consists of 3 states (trigger cards):

  • When loop started (Prepare device for example)
  • When loop iterates (Do whatever, like blinking etc etc)
  • When loop finished (Reset device to the state you’d wanted like saved in the started card)

So when you kill a loop you might want to still execute all finished cards as they usually reset a device to there normal state.

An example of a nice addiotional app that makes this perfect with automatic state saving:

For your last question I am not going to make that card on purpose. Thats’ a decision I made because I don’t want this app to create loop holes that easily. Not all Homey users would remember to make flows to kill it and thus can negativly impact your homey.

I decided not to add just loop cards but always NEED an limit of loops. Just put it high if you need it for many things. But make sure to not cause memory leaks.

It’s been a while since I’ve updated the loops app.
I’m still getting mails that people are thanking me for making this app, I appreciate that a lot!.

What is new?
Manual loops.
Some people do a certain acting when iterating through their loop, for instance sending a mail. When the delay is to low this ends up in duplicate flows running simultaneously. that’s why I am introducing manual loops, these loops only continue when you trigger a go to next iteration card.

I’ve also added a more accurate value for the normal flow:

Iteration value was stuck on 0. Now it also goes up so it can be used to loop through json lists.

Would be very nice to have the option to create an infinite loop / while loop, and have a trigger to exit it.
Use case: Fibaro wall plug on my coffe machine. Would like to automatically turn it off after say 20 min - then turn it on every 5 minutes but turn it off IF the current effect is above 0.

It’s a lazy way of creating an automation that turns it off to prevent fire, but leave it on when the main switch on the coffe machine is turned off.

1 Like

I try to avoid making it possible to create endless loops. Although there are possibilities.