Jump to content

'Else' after Repeat


jgraziano

Recommended Posts

After this finishes looping 10 times, shouldn't the 'Status Indicator' turn off?

 

If

X10 'G15/Dim (15)' is Received

 

Then

Set '-Status Indicator (Ent. Ctr.)' 40%

Repeat 10 times

Set '-Fireplace' Off

Wait 10 minutes

Set '-Fireplace' On

Wait 20 minutes

 

Else

Set '-Status Indicator (Ent. Ctr.)' Off

 

 

Thanks.

Link to comment
Jim,

 

This is similar to a thread that Chris Jahn had posted elsewhere (thanks again Chris).

 

Try putting a "run program XX" after the last wait in your "then". Looping back through the program should evaluate to the "else" (X10 Code not received) and turn your status indicator off.

 

IM

IndyMike,

I assume you meant to run this program? It seems like that would just make it loop forever, and when I tried it, it does. I just want it to repeat the on/off cycle ten times and then turn off the indicator, unless it is stopped by another program, which works.

 

thx.

Link to comment

I know the feeling, believe me! And especially after 11 on Saturday night, with the frustrating realization that, once again, I have not won the PowerBall lottery. Oh well . . . . :cry:

 

I really don't understand why it shouldn't work. When it finishes repeating, it should run the else. It's really pretty simple.

Link to comment

Jim,

I believe the issue is that the "If X10" condition is a trigger (similar to a Insteon Control). The else loop really doesn't apply here.

 

If there were a X10 "status" trigger (doesn't exist) your else would execute.

 

I'm still playing with the program call trying to "force" the else loop. The following does execute the else (and sets the program status to false) once the then is completed. The problem is, the X10 off command isn't executed. I'm scratching my head a bit on this end.

 

If
       X10 'A1/Off (11)' is Received

Then
       Send X10 'I1/Off (11)'
       Wait  1 second
       Send X10 'I1/On (3)'
       Wait  10 seconds
       Repeat 10 times
          Wait  1 second
          Send X10 'I1/Dim (15)'
       Repeat 1 times
          Run program 'X10 Test' (Else Path)

Else
       Wait  2 seconds
       Send X10 'I1/Off (11)'

Link to comment

Jim,

I found a method for executing the "else" but it involves two programs -

 

 

Program Test1 - Triggers off the X10 off command and tests to make sure "Test2" is not already running (prevents re-triggering).

If
       X10 'A1/Off (11)' is Received
   And Program 'X10 Test2' is False

Then
       Run program 'X10 Test2'

Else
  - No Actions - (To add one, press 'Action')

 

Program Test2: Turns on lamp I1 and dims through 10 steps. The else loop is forced which turns the lamp off. The conditional "If Program "X10 Test..." is required to allow access to the else path.

If
       Program 'X10 Test2' is True

Then
       Send X10 'I1/Off (11)'
       Wait  1 second
       Send X10 'I1/On (3)'
       Wait  10 seconds
       Repeat 10 times
          Wait  1 second
          Send X10 'I1/Dim (15)'
       Repeat 1 times
          Run program 'X10 Test2' (Else Path)

Else
       Wait  10 seconds
       Send X10 'I1/Off (11)'

 

If you're not concerned about re-triggering, you should be able to move your else action to the last statement in your then sequence.

If
X10 'G15/Dim (15)' is Received

Then
Set '-Status Indicator (Ent. Ctr.)' 40%
Repeat 10 times
  Set '-Fireplace' Off
  Wait 10 minutes
  Set '-Fireplace' On
  Wait 20 minutes
Repeat 1 time
 set '-Status Indicator (Ent. Ctr.)' Off

Else
 No actions

 

IM

Link to comment

Actually, I'm not concerned about re-triggering, so the second one is perfect. I didn't realize that the first Repeat would only repeat 'between the Repeats'.

 

So I ended up with:

If

X10 'G15/Dim (15)' is Received

 

Then

Repeat 10 times

Set '-Status Indicator (Ent. Ctr.)' 40%

Set '-Fireplace' Off

Wait 10 minutes

Set '-Fireplace' On

Wait 20 minutes

Repeat 1 times

Set '-Fireplace' Off

Set '-Status Indicator (Ent. Ctr.)' Off

 

Else

- No Actions - (To add one, press 'Action')

The only thing I added was the 'Fireplace OFF' so when it finished it will turn it off, which I didn't have before. It normally would not run the full 10 times, since I have this program being disabled if the fireplace is either turned OFF or ON.

 

Thanks!

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...