Jump to content

'Else' after Repeat


jgraziano

Recommended Posts

Posted

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.

Posted

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

Posted
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.

Posted

Wow Jim,

As you already know - I was way off base. I had thought you were using a time base trigger and totally missed the repeat loop.

 

In the future, I'll try not to make posts when it's after my bedtime.

Posted

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.

Posted

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)'

Posted

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

Posted

Yeah, I thought about using two programs after your last post (didn't reply since I was out and it's a pain on the BB).

 

I'll give it a shot.

 

Thanks!

Posted

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!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...