Please login or register.

Login with username, password and session length

Author Topic: One second delay to prevent macro looping  (Read 2836 times)

paul warshawsky

  • Sr. Member
  • ****
  • Helpful Post Rating: 5
  • Posts: 102
One second delay to prevent macro looping
« on: June 17, 2008, 11:20:45 AM »

I recently rearranged all my module codes to arrange my transceivers in a more reasonable way (one house code/transceiver per floor.)  I knew from past experience that this would create some unexpected problem and I was not disappointed!

Here's what happened.  I have two slimline switches that trigger macros to turn on two lights in the basement (in a hallway and the staircase) and turn off all the lights in the basement.  One is on the entrance from the garage and the other is at the top of the stairs from the main level.  They make entering and exiting the basement easier.  I had originally had both switches on the same house code as all the basement lights but this created reception problems (especially for the one at the top of the stairs.)  What I did was change the house code for the switch at the top of the stairs and create identical macros (B2 ON: A7, A8 ON, B2 OFF: A7, A8, A9, A10 OFF.)  The macros are identical to the ones programmed at the entrance to the garage the only difference is the trigger for that one is on the A house code.

Should work, right...

So the garage entrance works fine.  The head of the stairs fails 100% of the time (sluggishly turns on/off only some of the lights).  If I look at the activity monitor what seems to be happening is a continuous loop where the macro keeps triggering over and over.  Based on a suggestion that I found while searching for a similar problem I added a one second delay to the start of the macro and lo and behold its all good now!

Can anyone explain this odd behaviour?  Is this a problem that is well described?  If this is a common problem should there be a default one second delay (or a suggestion from the software to insert one?)  I can't think of anything in the macro that should trigger it to run again.

I'm delighted that this was my only problem and it only took a few hours to fix!  (Oh how my expectations have decreased...)

Paul
Logged

Boiler

  • Guest
Re: One second delay to prevent macro looping
« Reply #1 on: June 17, 2008, 05:38:28 PM »

I recently rearranged all my module codes to arrange my transceivers in a more reasonable way (one house code/transceiver per floor.)  I knew from past experience that this would create some unexpected problem and I was not disappointed!

Here's what happened.  I have two slimline switches that trigger macros to turn on two lights in the basement (in a hallway and the staircase) and turn off all the lights in the basement.  One is on the entrance from the garage and the other is at the top of the stairs from the main level.  They make entering and exiting the basement easier.  I had originally had both switches on the same house code as all the basement lights but this created reception problems (especially for the one at the top of the stairs.)  What I did was change the house code for the switch at the top of the stairs and create identical macros (B2 ON: A7, A8 ON, B2 OFF: A7, A8, A9, A10 OFF.)  The macros are identical to
the ones programmed at the entrance to the garage the only difference is the trigger for that one is on the A house code.

Should work, right...

So the garage entrance works fine.  The head of the stairs fails 100% of the time (sluggishly turns on/off only some of the lights).  If I look at the activity monitor what seems to be happening is a continuous loop where the macro keeps triggering over and over.  Based on a suggestion that I found while searching for a similar problem I added a one second delay to the start of the macro and lo and behold its all good now!

Can anyone explain this odd behaviour?  Is this a problem that is well described?  If this is a common problem should there be a default one second delay (or a suggestion from the software to insert one?)  I can't think of anything in the macro that should trigger it to run again.

I'm delighted that this was my only problem and it only took a few hours to fix!  (Oh how my expectations have decreased...)


Paul,
First, please check to make sure that you have your CM15a set to not transceive housecodes A and B (my apologies if you've already done this).

Past that, disabling the "transceive houscode function" will not prevent the CM15a from receiving the RF and triggering your macro.  The option only prevents the CM15a from retransmitting the RF command on your powerline.

Are you using Flags to lock out multiple triggers?  If I understand your post correctly, It sounds as if your CM15a is launching multiple "copies" of your macro (it's receiving both RF and powerline On commands) and that is messing up the works.

By adding a 1 second delay at the beginning of the macro, you've allowed it to be "re-entered".  This can work, but I prefer using Flags to prevent re-calling the macro.  Here's a thread dealing with macro re-entry -

http://www.x10community.com/forums/index.php?topic=15204.msg84874#msg84874

Earlier in the same thread, I have and example of how to use Flags to prevent "multiple triggers" of a macro.

Let us know how things turn out,
Boiler
Logged

paul warshawsky

  • Sr. Member
  • ****
  • Helpful Post Rating: 5
  • Posts: 102
Re: One second delay to prevent macro looping
« Reply #2 on: June 17, 2008, 10:08:38 PM »

Thank you, that is very helpful.  I have already disabled the CM15a from tranceiving all codes.  I understand how pressing the button once could trigger the macro two or three times if there is no "lockout period" but I don't understand what creates the cycle (I'm talking non-stop triggering until I interupt it by re-downloading to the module - maybe 100 triggers!).  This is more for my curiosity and understanding then because I still have a problem.  I also don't get why the same macro triggered by a switch with an A housecode doesn't cause the same problem.

Any thoughts on that?

Paul
Logged

Brian H

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 305
  • Posts: 13295
Re: One second delay to prevent macro looping
« Reply #3 on: June 18, 2008, 06:42:07 AM »

Do you have any X10 Repeaters between the phases? Some models are known to do strange things with some addresses in short time spans.
Logged

Boiler

  • Guest
Re: One second delay to prevent macro looping
« Reply #4 on: June 18, 2008, 04:21:03 PM »

Thank you, that is very helpful.  I have already disabled the CM15a from tranceiving all codes.  I understand how pressing the button once could trigger the macro two or three times if there is no "lockout period" but I don't understand what creates the cycle (I'm talking non-stop triggering until I interupt it by re-downloading to the module - maybe 100 triggers!).  This is more for my curiosity and understanding then because I still have a problem.  I also don't get why the same macro triggered by a switch with an A housecode doesn't cause the same problem.

Any thoughts on that?

Paul,
What you're describing is what we fondly (not) refer to as a "firestorm".  As Brian H indicated, this is normally caused by an active repeater interacting with the CM15a.  My Leviton HCA-02 repeater can produce this under certain circumstances (normally when using "DIM" Commands).

Assuming you have a repeater, the 1 second delay may provide enough of a break between the repeater transmission and the CM15a macro transmission to prevent a looping problem.
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.