Please login or register.

Login with username, password and session length

Author Topic: Smart Macros with flags.  (Read 9406 times)

js3kgt

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Smart Macros with flags.
« on: August 19, 2011, 04:31:36 AM »

I tried searches to no avail besides what was posted back to 2005 so sorry if this is old news.

I have macros with conditional flag checking. I've worked around what to me seems like a bug by not using it but I figured I'd give it another go.

When I run the macro I see the flag set using the "F3" html status page.

If I run the macro again it just runs ignoring the flag status and sends the PLC to the light.

I have tried running the macro from RF triggers as well as clicking the software. The odd thing is that the flags set from clicking run the macro not from RF.

I have also tried using a phantom device but I have no space on my monitored housecode to accommodate.

Any help is appreciated.

Here's the macro details.

-Macro-
If flag 7 off then
set flag 7
send PLC b3 on
wait 5 mins
send PLC b3 off
clear flag 7

Also I've tried rebuilding the macros from scratch, downgrading the software, replacing the cm15a and creating individual macros to set and clear the flags.

Thank you.
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Smart Macros with flags.
« Reply #1 on: August 20, 2011, 09:47:27 PM »

First of all, you need to understand that running a conditional macro fro with AHP (by clicking on it in the softwaer) ignores the conditions.
You will need to either trigger it using a timer, or an RF or PLC command from another remote (or the SDK).

Second, what version of AHP are you running?
Logged

js3kgt

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: Smart Macros with flags.
« Reply #2 on: August 22, 2011, 08:54:25 PM »

I am running version 3.316. When I trigger the macro by rf it will not set the flag so the condition is useless and always runs.
Also if I trigger via software the flag will set but not clear after the delay. Sorry for the delay I didn't get an email for the post.
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Smart Macros with flags.
« Reply #3 on: August 22, 2011, 10:57:47 PM »

Try adding a delay (even 0 seconds) at the beginning of the macro.
See if that helps.
Logged

js3kgt

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: Smart Macros with flags.
« Reply #4 on: August 23, 2011, 03:11:24 AM »

No dice. I created a macro with delay set to 0 and set flag 1. Nothing happens to the flag by rf. By triggering the macro by clicking the macro that sets the flag. Such quirky software.
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Smart Macros with flags.
« Reply #5 on: August 23, 2011, 08:19:46 AM »

How are you checking if the flag is set or not?
If you press "F3" in AHP, that will open the status screen, which will show you the status of the flags. However, that is only a static view. It does not get updated, even if you refresh it. You need to close it and re-generate it from within AHP to see an updated status view.
Your macro clears the flag at the end of its run.

If you haven't done so, create a separate set of macros, on an unused address, that ONLY set and clear that one flag (one to set it, the other to clear it).
Use that new macro to manually set the flag, check it (using F3), and THEN try to kick off the macro using the RF controller.

What is the trigger address of the macro?
Logged

DavidH

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: Smart Macros with flags.
« Reply #6 on: August 23, 2011, 10:53:10 AM »

js3kgt - I have a macro that is almost exactly the same as yours and it works OK so I am wondering if there is some conditional logic issue.  For my condition I have "if NOT flag 7"  then it falls into the Macro.  The rest of the Macro is the same.  I am not at home so I can't look at the macro to verify or play with to see if I can get it to fail.

Dave
Logged

js3kgt

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: Smart Macros with flags.
« Reply #7 on: August 23, 2011, 11:33:11 AM »

Noam - I am aware that F3 does not allow refresh. I can get the flags to set by running the macro in the software.
Here's the testing macros I have setup.

Trigger Conditions C9 On and Flag Status On - 7
End Trigger Conditions
Wait for 0 seconds
Clear Flags [7]
Turn Desk ON
Wait for 1 seconds
Turn Desk OFF

and

Trigger Conditions C9 Off and Flag Status Off - 7
End Trigger Conditions
Wait for 0 seconds
Set Flags [7]
Turn Desk ON
Wait for 1 seconds
Turn Desk OFF

I have the Desk Lamp turn on and off to the confirm the macro runs. I can see the RF received in the activity monitor (F2). If I run the macros in software the flag sets or clears without fail. If I run via RF or PLC the macro runs but the flag doesn't set and the condition isn't checked. I pulled the condition out and the flag will not set unless run from software.

Trigger Conditions C9 On
End Trigger Conditions
Wait for 0 seconds
Clear Flags [7]
Turn Desk ON
Wait for 1 seconds
Turn Desk OFF

and

Trigger Conditions C9 Off
End Trigger Conditions
Wait for 0 seconds
Set Flags [7]
Turn Desk ON
Wait for 1 seconds
Turn Desk OFF

Thank you so much for the help so far.

Dave - Can I have your active home :) j/k
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Smart Macros with flags.
« Reply #8 on: August 23, 2011, 12:13:16 PM »

Do you have the "Store in Interface" option checked?
Are you saving and then downloading to the CM15A before testing?

Try creating two very simple macros, that ONLY set or clear the flag (no conditionals), to make sure you can change the status of the flag, and verify (using F3) that the flag is actually being set and cleared properly when you run those two macros.

Once you know that you can set the flag, and check the status of it, THEN try triggering the conditional using the RF remote.
Running the macro from the interface will always ignore the condition (ie: assume it is true), so that is only good for testing the sequence of actions in the macro.
You have the "Transcieved House Codes" set to include housecode "C", right?

Have you tried emptying the trash in AHP?
Have you tried resetting the CM15A (unplug it from the wall and the USB, remove the batteries, wait a minute, then put it all back together and re-download)?
Logged

js3kgt

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: Smart Macros with flags.
« Reply #9 on: August 23, 2011, 01:01:58 PM »

Looks like I have to have the macro on the monitored house code for the macro to fire properly. C is tranceived but B is monitored.
In desperation I was moving the devices around and trying everything I could. Watching the Activity Monitor I see Transmit RF when the macro is on C housecode. When on B I see Receive, followed by Macro.

I guess I will have to move some stuff around.

Noam, Thank you for your time and patients!

If anyone from x10 reads this. If your not going to update the active home software, open source it please.
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Smart Macros with flags.
« Reply #10 on: August 23, 2011, 09:47:44 PM »

Looks like I have to have the macro on the monitored house code for the macro to fire properly. C is tranceived but B is monitored.
In desperation I was moving the devices around and trying everything I could. Watching the Activity Monitor I see Transmit RF when the macro is on C housecode. When on B I see Receive, followed by Macro.

I guess I will have to move some stuff around.

Noam, Thank you for your time and patients!

If anyone from x10 reads this. If your not going to update the active home software, open source it please.
The think the key is that C is transceived. Otherwise, the CM15A hears the RF command, but ignores it.
Logged

js3kgt

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 6
Re: Smart Macros with flags.
« Reply #11 on: August 24, 2011, 12:19:34 AM »

Absolutely. Thanks for all the help.
I have since moved the macros and devices onto the same house code resulting in higher odds of success.
Other devices had to be moved to a different code but it works.
Logged
 

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