Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: calling macro from a macro  (Read 34732 times)

myron18

  • Jr. Member
  • **
  • Helpful Post Rating: 1
  • Posts: 21
calling macro from a macro
« on: July 22, 2007, 11:19:16 AM »

A number of times I've seen "Macros can't directly call another macro" or a similar type statement.  In Smart Macros, I've found that I can call another macro directly by clicking on "conditions" in the upper right column, then "Advanced functions". Drag "X10 Address Command" to the module area. This can directly trigger another macro`. I'm guessing that by including flags, and other conditions, this can enable nesting macros.
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: calling macro from a macro
« Reply #1 on: July 22, 2007, 01:27:41 PM »

Interesting! I haven't tried that approach. Most of us here use the "dummy module" approach to trigger the next module. Your idea maybe easier. Does it matter if the macro being called has conditions?
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Boiler

  • Guest
Re: calling macro from a macro
« Reply #2 on: July 22, 2007, 02:00:16 PM »

A number of times I've seen "Macros can't directly call another macro" or a similar type statement.  In Smart Macros, I've found that I can call another macro directly by clicking on "conditions" in the upper right column, then "Advanced functions". Drag "X10 Address Command" to the module area. This can directly trigger another macro`. I'm guessing that by including flags, and other conditions, this can enable nesting macros.

Could you have meant "Appliance Control" from the "advanced functions".  The "X10 Address Command" issues an address but does not issue an on or Off command - it won't trigger a macro.  After reading your post, I tried triggering a macro with the Appliance Control and it works.

Steven - This works with conditions as well.

Thank you myron18 - I've been using the dummy module technique for so long it's become second nature.  Never thought to try the Advanced command.  This will really clean up a lot of clutter in my setup.

Another shining example of a person not knowing that something can't be done - and doing it!
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: calling macro from a macro
« Reply #3 on: July 22, 2007, 05:38:25 PM »

....Another shining example of a person not knowing that something can't be done - and doing it!

At the risk of tempting the "If It Works, Don't Fix It Gods", I think I'll do a backup of my .ahx file, remove a few of my "dummy modules" and tempt Murphy.

Thanks again, myron18.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Boiler

  • Guest
Re: calling macro from a macro
« Reply #4 on: July 22, 2007, 05:54:07 PM »

At the risk of tempting the "If It Works, Don't Fix It Gods", I think I'll do a backup of my .ahx file, remove a few of my "dummy modules" and tempt Murphy.

I know those Gods well.  They've kicked my but on numerous occasions.  I created a test file to check it out.  I'm not ready to begin rewriting my whole system.  It'll take some time probably some courage from an aluminum can before I get there.

Let me know how things work out.
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: calling macro from a macro
« Reply #5 on: July 22, 2007, 08:15:35 PM »

Removing all my dummy variables turned out to relatively painless. As long as I matched the ONs to the ONs and the OFFs to the OFFs, I should be in good shape.  ;)

I was dreading that I might delete a dummy variable and still have a macro trying to call it. Fortunately the process was made easier by something X10 did right with the AHP software. As I went to delete a dummy variable, it would list all the macros that had it in it and ask if I really wanted to delete it.

Well off to see if it worked.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

myron18

  • Jr. Member
  • **
  • Helpful Post Rating: 1
  • Posts: 21
Re: calling macro from a macro
« Reply #6 on: July 22, 2007, 10:42:42 PM »

When I initially tried the "X10 Address Command" to trigger a macro, it worked. I was playing around with options for triggering, and am not sure whether I unintentionally wrote a second parallel trigger. When I have time, I'll try it again.
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: calling macro from a macro
« Reply #7 on: July 22, 2007, 11:41:37 PM »

When I initially tried the "X10 Address Command" to trigger a macro, it worked....
If you had created an address like "M1" followed by turning off another "M" module e.g. "M3 Off" for example, you would of effective done an M1 and M3 off. The "M1" piggybacks with the next command. Maybe that's what happened.
Anyway thanks for leading us down the path of discovery.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: calling macro from a macro
« Reply #8 on: July 23, 2007, 03:54:25 PM »

Appliance Control Bug?
I may of stumbled into a bug using the Appliance Control option. I'm testing it now but it appears, in some cases, to be saving an ON command even if you program an OFF.

I'm still working on a specific example but I definitely have macros where I have programed "Appliance Control OFF" and had a macro report display it "Appliance Control ON". It hasn't happened every time but may be happening more often when there already is a macro with an "Appliance Control ON" programed.

So don't jump into using this option to start a macro that you wish to be triggered by an off command.
« Last Edit: July 23, 2007, 04:30:10 PM by steven r »
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Boiler

  • Guest
Re: calling macro from a macro
« Reply #9 on: July 23, 2007, 05:05:46 PM »

I may of stumbled into a bug using the Appliance Control option. I'm testing it now but it appears, in some cases, to be saving an ON command even if you program an OFF.

Steven,
I confess I didn't try triggering an off macro before (only on). 

I just coded the following macros to check the off call.  Seems to work flawlessly (25 times).  My test lamp turns on and off reliably, and all the codes are verified in activity monitor and on my Testerlinc.  Everything is downloaded to the CM15a.  I've triggered with RF, Powerline, and clicking a M2 switch on within AHP. 

Quote
Main Macro (M2)
Trigger M2 On
Appliance Control M3 on
delay 10 sec
Appliance control M3 off

On Macro (M3)
Trigger M3 On
Module A12 On

Off Macro (M3)
Trigger M3 Off
Module A12 Off

I don't doubt for a second what you're seeing.  I'm a bit curious about the date code/firmware revision of your CM15a.  If you'd like to try my test file, let me know and I'll send it to you.


[TTA Edit: Formatted MACRO for visual impact.]
« Last Edit: July 23, 2007, 05:39:44 PM by TakeTheActive »
Logged

Boiler

  • Guest
Re: calling macro from a macro
« Reply #10 on: July 23, 2007, 05:19:56 PM »

Update

Tried the same test file with macro M2 (main) stored in the PC.  Works fine for powerline commands.  Very flakey with RF (works ~ 60% of the time).


Main Macro (M2)
Trigger M2 On
Appliance Control M3 on
delay 10 sec
Appliance control M3 off

On Macro (M3)
Trigger M3 On
Module A12 On

Off Macro (M3)
Trigger M3 Off
Module A12 Off
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: calling macro from a macro
« Reply #11 on: July 23, 2007, 05:50:27 PM »

...I just coded the following macros to check the off call.  Seems to work flawlessly (25 times)....
The bug has nothing  to do with calling another macro. Once you get the Appliance OFF saved it works fine.

The problem I had was that I programed the appliance control to send a "P5 ON". Later in a different macro I programed an appliance control to send a "P5 OFF". After downloading the file to the CM15A, I did a macro report to find that the command that I wanted to be "P5 OFF" was saved as "P5 ON".

"P5 ON" triggers a macro that starts all my lights flashing. "P5 OFF" triggers a macro that then stops all the lights flashing. Needless to say the problem was immediately obvious when I went to test those macros and the lights continued to flash.

It's been awhile since I tried it but in the past, I've experienced problems setting up macro to trigger on an OFF if an ON already exits for that same House and Unit code, also.
« Last Edit: July 23, 2007, 06:03:41 PM by steven r »
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Boiler

  • Guest
Re: calling macro from a macro
« Reply #12 on: July 23, 2007, 06:29:20 PM »

The bug has nothing  to do with calling another macro. Once you get the Appliance OFF saved it works fine.

The problem I had was that I programed the appliance control to send a "P5 ON". Later in a different macro I programed an appliance control to send a "P5 OFF". After downloading the file to the CM15A, I did a macro report to find that the command that I wanted to be "P5 OFF" was saved as "P5 ON".

"P5 ON" triggers a macro that starts all my lights flashing. "P5 OFF" triggers a macro that then stops all the lights flashing. Needless to say the problem was immediately obvious when I went to test those macros and the lights continued to flash.

It's been awhile since I tried it but in the past, I've experienced problems setting up macro to trigger on an OFF if an ON already exits for that same House and Unit code, also.

I've never seen that.  You've just described my basic configuration.  I have 23 instances of ON and Off macros at the same address.  Many of these are accompanied by a hardware module on the same address.  Nary a problem.

What version of AHP are you using? 
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: calling macro from a macro
« Reply #13 on: July 23, 2007, 07:01:00 PM »

...What version of AHP are you using? 
3.204

I haven't been able to do a step by step recreate of the bug but I have a simplified .ahx file that shows it, if anyone wants to look at it.
e.g. I can clear my CM15A, upload the test file, download to the CM15A, run a macro report and there will be macros with "Appliance ON" commands where AHP clearly shows I've put an "Appliance OFF". Perhaps it was a glitch but since it happened in more that one place in my file and nothing else seems wrong, I suspect an elusive bug.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Boiler

  • Guest
Re: calling macro from a macro
« Reply #14 on: July 23, 2007, 07:25:32 PM »

Steven,

I'd love to try your .AHX file.  I have 3 CM15a's of various vintage (although I can't see how this could be a CM15a problem).  And two different AHP installs.

Let me know.
Logged
Pages: [1] 2
 

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