Please login or register.

Login with username, password and session length

Author Topic: Question on AHP macro behaviour - are macros queued?  (Read 4297 times)

spud098

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Question on AHP macro behaviour - are macros queued?
« on: July 21, 2009, 11:57:09 AM »

Hi guys,

I've just got a question on how macros in AHP work because some of the behaviour I spotted recently isn't what I expected, and now I'm confused! :}

I've got a motion sensor to trigger a macro which turns on a light at address A1, wait 3 minutes then turn it off again. When the motion sensor gets triggered, then gets triggered again a minute later, I would have expected the light to go off two minutes after the second trigger (which is 3 mins after the first), then a second off command a minute later to be disregarded.

However the behaviour I get is the light stays on till 3 minutes after the second trigger. This is actually the behaviour I wanted, but now I'm confused about how AHP is processing macros!

If AHP is in the middle of a macro including a delay and is interupted with the need to run another macro, is the end of the first one always disregarded or is something more complicated going on?

Many thanks in advance for any info on this!

(BTW I'm using AHP 3.240 and a CM15Pro)

many thanks,
nicola

Logged

Dan Lawrence

  • Hero Member
  • *****
  • Helpful Post Rating: 68
  • Posts: 3991
Re: Question on AHP macro behaviour - are macros queued?
« Reply #1 on: July 21, 2009, 05:42:29 PM »

AHP 3.240?  You must not be in the US or Canada. :-\
Logged
I don't SELL this stuff... BUT I sure do ENJOY using it!!!

spud098

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: Question on AHP macro behaviour - are macros queued?
« Reply #2 on: July 21, 2009, 05:47:55 PM »

No, I'm in the UK. I guess the UK version doesn't differ that much... or does it?

cheers, nicola

Logged

Dan Lawrence

  • Hero Member
  • *****
  • Helpful Post Rating: 68
  • Posts: 3991
Re: Question on AHP macro behaviour - are macros queued?
« Reply #3 on: July 21, 2009, 08:51:39 PM »

It probably doesn't, but I believe your interface is a serial device, ours is a USB device.  I suspect your AHP is not built like ours. Your electric plugs/outlets are different as well so the modules are not the same.   
Logged
I don't SELL this stuff... BUT I sure do ENJOY using it!!!

Boiler

  • Guest
Re: Question on AHP macro behaviour - are macros queued?
« Reply #4 on: July 22, 2009, 06:47:09 AM »

Hi guys,

I've just got a question on how macros in AHP work because some of the behaviour I spotted recently isn't what I expected, and now I'm confused! :}

I've got a motion sensor to trigger a macro which turns on a light at address A1, wait 3 minutes then turn it off again. When the motion sensor gets triggered, then gets triggered again a minute later, I would have expected the light to go off two minutes after the second trigger (which is 3 mins after the first), then a second off command a minute later to be disregarded.

However the behaviour I get is the light stays on till 3 minutes after the second trigger. This is actually the behaviour I wanted, but now I'm confused about how AHP is processing macros!

If AHP is in the middle of a macro including a delay and is interupted with the need to run another macro, is the end of the first one always disregarded or is something more complicated going on?

Many thanks in advance for any info on this!

(BTW I'm using AHP 3.240 and a CM15Pro)

many thanks,
nicola

Hello nicola,

My experience with older versions of AHP indicates that the behavior depends on the structure of the macro.  In older versions, if a delay was used as the first statement in the macro, repeated triggers would simply restart the delay.  A 1 minute delay could therefor be extended indefinitely by repeating the triggers.

If a module call was used prior to a delay (and other statements), a trigger that occurred after the module call would launch a second instance of the macro.  This can produce all kinds of unwanted results.

I have a post on this "older" understanding of AHP over here: Macro Re-Entry   

Unfortunately, it does not sound as if your macro is behaving this way.  From your description, I'm envisioning your macro as follows:

Macro
Trigger on XX ON
Send A1 ON
Delay 1 Minute
Send A1 Off

Based on previous versions - Assuming a trigger occurring at time 0:
A second trigger occurring at time 1:10 (during the delay) would launch a second instance of your macro.  The first macro would complete at around 1 minute elapsed time and would turn off A1. 
Your second macro would complete at around 2:10 elapsed and would again turn off A1 (no effect - it's already off).

This isn't at all what you've described.  There may have been some changes in AHP to fix multiple instances of macros.  If so, we would very much like to know this.  Please confirm your macro configuration and get back with us.

Thanks,
Boiler
Logged

spud098

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: Question on AHP macro behaviour - are macros queued?
« Reply #5 on: July 22, 2009, 12:58:21 PM »


Hi Boiler,

Thanks for your help with this one!

After a few experiments it does sound like I'm getting slightly different behaviour to you...

I'll describe my setup exactly (apologies if this doesn't follow the usual conventions as I'm new at this stuff!)

I have a lamp on A1, and two sensors one at A2 and the other at A4 (A3 is skipped because of the eagle eye light dark sensor which I'm ignoring)

Macro1, triggered by A2, reads:

Turn A1 ON
WAIT for 20 Seconds
Turn A1 OFF

This all behaves correctly by itself. However if A2 is activated, then 10 seconds later A2 is activated again, the lamp goes off after 30 seconds. I can prevent the lamp going off by keeping activating A2 (which I'm doing by pressing the 'on' button on the sensor rather than running the macros directly through AHP).

To experiment, I added a new macro Macro2 triggered by the sensor at A4, identical to macro1. When I tested what happened again after activing the first sensor, then 10 seconds later the second, it seems again the first macro was interupted by the second and the lamp would stay on for 30 seconds (the end of the first macro just didn't run).

Whats wierd (and reassuring!) though is that after experimenting I worked out that if I changed Macro2 to read:

Turn A1 ON
WAIT for 21 Seconds
Turn A1 OFF

...the macros are instead interleaved! Triggering A1 then 10 seconds later A2, the lamp went off after 20 seconds followed by a second ignored off command at 31 seconds.

So it appears that identical macros might be restarted, none identical ones interleaved?

If this is correct I've answered by own question, but it sounds weird if the US version acts differently?

cheers,
nicola


Logged

spud098

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 4
Re: Question on AHP macro behaviour - are macros queued?
« Reply #6 on: July 22, 2009, 01:01:34 PM »

Oh, just to answer Dan, my CM15 is also USB like yours (i.e. not serial)

cheers, nicola
Logged

Dan Lawrence

  • Hero Member
  • *****
  • Helpful Post Rating: 68
  • Posts: 3991
Re: Question on AHP macro behaviour - are macros queued?
« Reply #7 on: July 22, 2009, 05:42:18 PM »

Thanks!!!  We don't get many here from the UK.  If you could provide a hotlink to where you purchase your X10 equipment, we can see what you have on your side of the pond.   ;D
Logged
I don't SELL this stuff... BUT I sure do ENJOY using it!!!

tjosan

  • Jr. Member
  • **
  • Helpful Post Rating: 1
  • Posts: 11
Re: Question on AHP macro behaviour - are macros queued?
« Reply #8 on: July 23, 2009, 05:19:17 AM »

Thanks!!!  We don't get many here from the UK.  If you could provide a hotlink to where you purchase your X10 equipment, we can see what you have on your side of the pond.   ;D

I don't know for Spud, here are the two places where I buy my stuff.
http://www.intellihome.be/
http://x10modules.com/

Lars K
« Last Edit: July 23, 2009, 06:25:10 AM by tjosan »
Logged
 

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