Please login or register.

Login with username, password and session length

Author Topic: How to cancel queued commands sent so Macro does not act on them later?  (Read 4075 times)

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057

So I have this macro:

If B1 ON then:
Send Email Notification -xxxx4@vtext.com -thing open, alarm NOT on -Alarm is off but thing is open

Only problem is it sends twenty seven zillion emails - every time it sees motion again and again!

So I figure I will outsmart it with this instead:

If B1 ON AND flag 11 is OFF then:
Set Flags [11] Flag Command 
Send Email Notification -9xxxx@vtext.com -gun safe open, alarm NOT on -Alarm is off but gun safe is open
Delay for 05:00
Clear Flags [11] Flag Command

Better - sorta....  now it sends ONE email but waits 5 minutes then sends the other twenty seven zillion 5 minutes later!

Do I need a programmable thing like under Tools->"purge delayed macro events?"

Some please give me a hint!

Thanks.
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #1 on: February 05, 2013, 04:09:23 PM »

I haven't really played with the motion sensors, but I think that most of them can send an "off" command when the motion stops (after a pre-set delay).
If so, you should be able to use THAT command to trigger a macro to clear your flag.
You'll get one e-mail when motion starts, and then you shouldn't get another one until there is no more motion for that pre-set delay period, and THEN there is motion again.
Is that what you're trying to do?
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #2 on: February 05, 2013, 04:19:37 PM »

Noam, thank you for the reply.

I really don't need help clearing the flag;  the macro does fine job of that after the time delay.  That is not the problem....

The problem is the motion sensor keeps seeing motion - even during my 5 minute delay inside my macro - and each time it sees motion, it sends another B1 ON....  all these B1 ONs seem to que up in AHP....  so after my 5 minute timer times out and my macro officially ends, those pesky queued B! ON's all come in each sends another email - I get like 10 emails sent 5 minutes after the first one, even tho all the motion happened in the first 1 minute.....  I do not know why all the queued ones pop out and do not wait 5 min each either;  some quircky AHP firmware thing I guess....

This is not a motion sensor issue but a Macro issue.  I have an appliance module set as B1 to simulate the motion trigger and it does the same thing.  If I turn it on/off 10 times in a row, I get one email then 5 min later I get 9 more.....

Make sense?
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #3 on: February 07, 2013, 07:53:35 AM »

Let me try another shot at this.

Why is there a "cancel queued macro commands" in ahp under tools? 

And is there a way to send this same command in a macro?

thanks.
Logged

dave w

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 139
  • Posts: 6116
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #4 on: February 07, 2013, 10:10:54 AM »

I don't use AHP, and Noam is the expert, but here is what I do in Homeseer. The first macro does "X" (turns on lights, makes verbal warning, etc.), then calls a second macro ( could be the email macro), waits 2 seconds for the second macro to execute, then sets a "no email" flag (or could be a monitored ghost module in AHP). The second email macro has a conditional to send the email IF the "no email" flag is reset or OFF. Then the timed OFF command from motion sensor calls a macro to reset the "no email" flag.  So the conditional on the flag prevents susequent emails until the motion sensor turns off.
Don't know if this will work in AHP or not. If the motion sensor is not a monitored HCUC I think it should.
FWIW
Logged
"This aftershave makes me look fat"

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #5 on: February 07, 2013, 12:32:49 PM »

Thanks for the vote of confidence, Dave, but I wouldn't consider myself the expert. I'm more of "somewhat of an expert," at best.

I'm guessing that you want it to notify you when it first detects motion, and then ignore everything else until there is no more motion for 5 minutes, right?

In that case, I'd remove the delay and the flag clearing entirely. If your motion sensor sends a "B1 On" when there is motion, and a "B1 Off" when there has been no motion for 5 minutes (as I suspect it can be set to do), then it should work.

Your "B1 On" macro would be:
If flag 11 is OFF ("B1 On" is the trigger, and should not be listed in the macro as a condition), then:
Set Flags [11] Flag Command
Send Email Notification -9xxxx@vtext.com -gun safe open, alarm NOT on -Alarm is off but gun safe is open

Your "B1 Off" macro would be:
Clear Flags [11] Flag Command

So, repeated "B1 On" triggers from the motion sensor would check the flag, and then exit if it is already set. Nothing would get queued up, so it shouldn't send you extra notifications.
Of course, if whatever is sending the "B1 On" is not capable of being set this way, then we would need to find another way to do it (probably with more flags and nested macros).
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #6 on: February 07, 2013, 04:21:22 PM »

Thanks Noam and Dave.  Unfortunately Naom that is not how a X10 motion sensor works.....  it does not send a B1 ON then nothing until sending a B1 OFF.  It sends B1 ON, B1 ON, B1 ON, etc etc etc each time it sees motion....  then after NOT seeing motion for its timer setting (typically default 30 seconds) it sends a B1 OFF.

So each of those say 12 B1 ONs are sent and AHP QUEUES THEM UP.

THAT is my issue.  Even with timer to reset the flag 5 minutes later, the darn queued B1 ONs simply are waiting for my macro timer to time out and then are looked at by AHP.
Logged

dave w

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 139
  • Posts: 6116
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #7 on: February 08, 2013, 03:50:02 PM »

Thanks Noam and Dave.  Unfortunately Naom that is not how a X10 motion sensor works.....  it does not send a B1 ON then nothing until sending a B1 OFF.  It sends B1 ON, B1 ON, B1 ON, etc etc etc each time it sees motion....  then after NOT seeing motion for its timer setting (typically default 30 seconds) it sends a B1 OFF.

So each of those say 12 B1 ONs are sent and AHP QUEUES THEM UP.

THAT is my issue.  Even with timer to reset the flag 5 minutes later, the darn queued B1 ONs simply are waiting for my macro timer to time out and then are looked at by AHP.
I don't think your flag is working right. As long as your flag is "set", your conditional should stop any queues being generated.(?).
Logged
"This aftershave makes me look fat"

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #8 on: February 09, 2013, 11:49:39 AM »

hmmm.. thanks for comment.  I was about to watch the flag real time but got distracted;  will go back to it.  thanks for idea.
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #9 on: February 09, 2013, 06:58:19 PM »

Thanks Noam and Dave.  Unfortunately Naom that is not how a X10 motion sensor works.....  it does not send a B1 ON then nothing until sending a B1 OFF.  It sends B1 ON, B1 ON, B1 ON, etc etc etc each time it sees motion....  then after NOT seeing motion for its timer setting (typically default 30 seconds) it sends a B1 OFF.

So each of those say 12 B1 ONs are sent and AHP QUEUES THEM UP.

THAT is my issue.  Even with timer to reset the flag 5 minutes later, the darn queued B1 ONs simply are waiting for my macro timer to time out and then are looked at by AHP.
I don't think your flag is working right. As long as your flag is "set", your conditional should stop any queues being generated.(?).
that's what I was getting at. If the condition on your "B1 On" macro is that the flag is NOT set, and then it sets it, it will only run once, no matter how many times it is re-triggered. If you use the "B1 Off" to clear the flag (instead of doing it using a delay in the macro), then that should take care of it for you.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: How to cancel queued commands sent so Macro does not act on them later?
« Reply #10 on: February 09, 2013, 08:03:27 PM »

ah!  good idea. i will try it that way!  thanks!
Logged
 

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