Actually, it is possible for a macro to
trigger another macro. This is dangerous
in that it can create infinite loops, but
it can be useful.
A macro that has executed at least 1 delay
can call another macro or itself.
You call another macro by sending its
trigger command. One way to do this is to
define an appliance module in the software
with the same address as the macro
trigger. This will make the command
available.
You can stop running macros by using
the 'Purge Delayed Macro Events' command
from the Tools menu in ActiveHome.
Macros that are called from other macros
can use conditions if the Smart Macros
plugin is installed.
There is a limit of 8 pending macros
running at once.
Conditions are checked when the macro is
called. This is useful if you want to
check conditions during the middle of a
macro.
If you have a macro that calls other
macros, you are responsible to make sure
that macros don't call each other in an
infinite loop.
You can create interesting things using
this macro recursion like an infinitely
repeating timer. For instance, if you
wanted to execute macro C4 every 5 minutes
you could do the following:
Macro C1 (Start Timer)
- Set Flag 1
- Delay 5 seconds
- Turn C3 On
Macro C2 (Stop Timer)
- Clear Flag 1
Macro C3 (Timer Macro)
If Flag 1 Then
- Turn C4 On
- Delay 5 minutes
- Turn C3 On
Macro C4 (This macro will be executed every
5 minutes indefinitely. If C4 has
conditions, the conditions will be checked
every 5 minutes.)