Please login or register.

Login with username, password and session length

Author Topic: A question about mulitiple delays in macros  (Read 15529 times)

TerranJerry

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 38
A question about mulitiple delays in macros
« on: August 16, 2011, 11:53:03 PM »

I am running AVP 3.295 (seems like if I upgrade higher than that, my video from the UM12A starts flickering - so I'm stuck at 3.295 at the moment)

Anyway, let's assume I have three macros like this:

Door open - macro #1 (to turn on a lamp)
 Delay 5 secs
 Turn on door open lamp module (just a light to tell me its open)

Door open - macro #2 (to start my 10 min timer)
 Delay 10 minutes
 Send an email msg

Door close - macro #3 (to turn off the lamp)
 Delay 5 secs
 Turn off the door open lamp module

Ok, so here's the deal.  The door opens, both macros #1 and #2 seem to fire.  That makes sense.
However, if I close the door again in say 2 minutes, it "seems" like the "door close" macro (#3) is not running because the lamp doesn't go off until the timer macro (#2) finishes its full 10 min delay and then the door close macro (#3) runs.

I thought the delays in different macros run concurrently.  Is that not the case?  Does the 10 minute macro hold everything else up from running?

I'm wondering why macro #2 is holding up macro #3 from running.

Also, is there a better way to do the 10 minute delay in macro #2 rather than using a 'delay' function?

Thanks for any tips!
Jerry
 
Logged

HA Dave

  • Hero Member
  • *****
  • Helpful Post Rating: 175
  • Posts: 7127
Re: A question about mulitiple delays in macros
« Reply #1 on: August 18, 2011, 05:32:56 PM »

Not sure what your trying to accomplish... exactly.

I get the impression/feeling.... that the light is a signal to you that the door has opened... if your at home. And the email message would be a way to notify you of a left open door if your away. Is that anywhere near correct?   
Logged
Home Automation is an always changing technology

TerranJerry

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 38
Re: A question about mulitiple delays in macros
« Reply #2 on: August 18, 2011, 09:51:33 PM »

Actually that's just a simple example. My real question is about the 10 min delay. Does the 10 min delay keep other macros from running while that delay is running? If so is there a way to fix this?
Logged

HA Dave

  • Hero Member
  • *****
  • Helpful Post Rating: 175
  • Posts: 7127
Re: A question about mulitiple delays in macros
« Reply #3 on: August 18, 2011, 11:03:35 PM »

Does the 10 min delay keep other macros from running while that delay is running?

No... not in my setup.
Logged
Home Automation is an always changing technology

TerranJerry

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 38
Re: A question about mulitiple delays in macros
« Reply #4 on: August 19, 2011, 02:05:26 AM »

Hi Dave,
Thanks for the reply.  I'll try to explain a bit better.

I have a setup like this:

Macro #1 (Intent: this macro starts when the garage door opens; turns on warning light)
- Trigger: Garage door sensor triggered
   - delay 5 secs
   - Turn on garage door indicator lamp A2
   - send email "garage open"
   - delay 5 secs

Macro #2 (Intent: this macro starts when the garage door opens - waits 10 minutes and then turns on phantom module)
- Trigger: Garage door sensor triggered and garage door is open
   - delay 10 minutes
   - turn on phantom module A11
   - send email "10 min timer expired"
   - delay 2 minutes (allows time for monitoring macro #4 to run)
   - turn off phantom module A11
   - delay 5 seconds

Macro #3 (Intent: this macros starts when the garage door closes - turns off warning light - it clears the "I've been open for 10 minutes flag"
- Trigger: Garage door sensor - closed
   - Turn off garage door indicator lamp A2
   - Clear flag 11 (the "I've been open for 10 minutes flag")
   - send email "garage door closed"

Macro #4 (Intent: this macro checks whether or not the phantom module has turned on which will only occur if door stands open 10 mins)
- Trigger: A11 phantom module on and garage door open
   - Set flag 11

Macro #5 (Intent: if this flag is set and the phantom module is on, the garage has stood open 10 minutes)
- Trigger: A11 on and Flag 11 set and Garage door open
   - Delay 5 seconds
   - send email "garage standing open 10 minutes"

This (above) is what I have Dave.  I think it basically works with one exception.  As soon as macro #2 with the 10 minute delay starts running, none of the other macros continue to run until that timer expires.  Then they run. 

So for example, let's say I open the door, wait only 2 minutes and close the door. 
- Macros #1 & #2 start initially (note #2 starts the 10 minute timer)
Then I close the door after only 2 minutes
- Macro #3 should start but it will be held up for another 8 minutes by macro #2

So basically once the 10 minute delay macro starts running, none of my other macros run any further until that 10 minute delay completes.
I've seen other people talking about this in the forums.
I'm wondering if this is a problem with just the CM15A which is what I am using?
What do you use?

In a nut shell - it would seem that you can only have one delay running at a time with my setup.  For your macro to work (the example you gave) it would seem your macros are running concurrently or you would have the same problem.  So, I am wondering what is the difference?
I have AHP ver 3.295 running.

Your thoughts?
Jerry

Logged

TerranJerry

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 38
Re: A question about mulitiple delays in macros
« Reply #5 on: August 19, 2011, 02:25:52 AM »

One additional comment, looking at your garage door example, it seems that if you tried this sequence and you had the same problem I have, it wouldn't work.

Open garage door (light D8 comes on right?)  - now your 10 min timer is running if I read your programming correctly
Now before the 10 mins runs out, close the garage door - does your light D8 go out?

I'm pretty sure in my situation it would not.  However, I am going to try to set up your configuration on my system and see what happens here.
I'll let you know!  :)

Thanks for the help.

Jerry
Logged

HA Dave

  • Hero Member
  • *****
  • Helpful Post Rating: 175
  • Posts: 7127
Re: A question about mulitiple delays in macros
« Reply #6 on: August 19, 2011, 11:15:47 PM »

..... Now before the 10 mins runs out, close the garage door - does your light D8 go out?

Yeah... my setup has worked fine for years now... and today as well. Unless there is a bug of some kind in the latest software it should work on your setup.
Logged
Home Automation is an always changing technology

TerranJerry

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 38
Re: A question about mulitiple delays in macros
« Reply #7 on: August 20, 2011, 01:57:10 PM »

Hi Dave,

Thanks again for the replies.  Well, I looked at your configuration and it seems to run more sequentially than mine which is quite parallel and seems like they just don't support that much parallel processing.  So, I decided I liked yours much better!  #:)  So, I deleted mine, and programmed yours into my setup and it works great!

Now I guess I need to add the voice unit too huh?  LOL

Thanks Dave,

I appreciate your help.
Logged

HA Dave

  • Hero Member
  • *****
  • Helpful Post Rating: 175
  • Posts: 7127
Re: A question about mulitiple delays in macros
« Reply #8 on: August 20, 2011, 06:51:19 PM »

......... I deleted mine, and programmed yours into my setup and it works great!

Glad to read your setup is running well. Thanks for letting me know the out come.
Logged
Home Automation is an always changing technology

cheminge

  • Newbie
  • Helpful Post Rating: 1
  • Posts: 3
Re: A question about mulitiple delays in macros
« Reply #9 on: June 22, 2012, 04:47:29 PM »

I have a similar problem, but my macro has an hour delay, and any of the other macros will NOT process until the hour is over.  (that is no good.
So I made a workaround.
Following your updated example….
Macro1:
I added an “Advanced Function” to run a windows command that runs a simple batch file.
In the batch file I placed the following lines that read:
timeout 3600
"C:\Program Files\ActiveHome Pro\bin\ahcmd" sendplc m2 on
The 3600 is the number of seconds that the batch file will delay, mine is one hour so 60 * 60 = 3600, 10min would be 10 *60 = 600.

Macro2: (triggered by m2)
Remove the delay (as it is handled with the batch file)

This will allow all of the other macros to process parallel to the open and close event, and it will not try to play catch up.

I hope this helps.
Logged
 

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