Help getting a Repeat Loop to work


#1

I can’t get this simple Repeat Loop to work

I would like the switch to turn at a set time
then run for a set time
turn off for set time
then wait for set time
repeat

Right now, the switch only turns on then off at the set times, but it appears that the repeat loop is not functioning.

image


#2

Your first repeat loop would repeat until switch two is turned off… but the 3rd command in the loop turns it off, so there’s no need for it to repeat the loop a second time. At the end of the first pass through your DO loop, the light is off so it never will repeat.

Is this a ‘real’ piston you’re trying to write, or just trying to get a loop to work? Depending on your answer, I can post up a couple different sample pistons.


#3

My ultimate goal is to set a timer that will control my Hot Water Heater Circulation Pump. This will be programmed for an outlet switch. I’d like it to:

Turn on at 5:30 AM
Repeat Loop:

  • Run for 15 minutes then
  • Be off for 15 minutes

Turn off when we’re not home
Turn back on when we arrive back home
Turn off at 10:00 PM

Thx


#4

If line 30 & 36 pointed to a different switch (maybe a simulated switch) then your piston would work… Switch 2 would keep cycling until the other switch is turned off


#5

This should do it:


#6

I wasn’t aware of the Toggle Feature, and after thinking about it, I see that each time the Piston runs, it toggles the switch. Brilliant!

That’s great Thanks!


#7

Really dumb question, but how can I get the “repeat” in the pistons. I’m trying to do something similar, and have made the execute, every day at 17:30, but am unable to find the repeat/until. I’ve tried timers, actions and If blocks, but it’s not there.

Where is it? Thanks.


#8

In the upper right corner of your screen, click on settings and choose “show advanced statements”. That will open up a whole new world of features the next time you click “add statement”.


#9

Thanks, I remember seeing it previously. Just couldnt find it again.

It was kind of similar to when I realised that you could select ADD (under task) and another whole new world opened up.