X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: wayneaking on November 06, 2009, 04:22:11 AM

Title: Toggle Macro
Post by: wayneaking on November 06, 2009, 04:22:11 AM
I'm trying to create a toggle macro -- I want the same trigger to turn a light on if it's off or off if it's on.

Simple enough in my old TimeCommander (which died recently after many years of use):

     If
         (XSEQ O-4 O-ON) Received within 4 seconds
     Then
         If
            (K-4) is ON
         Then
             (K-4) OFF
          Else
              (K-4 ON
      End

That's pretty obvious -- Doing this in Active Home seems to be quite a challenge:

I have the 1st Macro "Study Lites Toggle: with Trigger O4 ON:
   Trigger Conditions O4 On and
   Module Status Off - Study Lites
   End Trigger Conditions
   Turn Study Lites ON

And the 2nd "Else" Macro "Study Lites Toggle 2" with Trigger O4 ON:
    Trigger Conditions O4 On and
    Module Status On - Study Lites
    End Trigger Conditions
    Turn Study Lites OFF

If I send the trigger O4 ON with the module Study Lites K4 On, nothing happens
If I send the trigger O4 ON with the module Off, it responds properly by turning the module On
What am I missing???? ???










Title: Re: Toggle Macro
Post by: Don N on November 06, 2009, 10:33:37 AM
I set up a Macro just as you described and it works perfectly.  Do you have K set as the Monitored House Code?
Title: Re: Toggle Macro
Post by: Mellowmark on November 06, 2009, 05:27:51 PM
How does the program know the light is on. Maybe if you set a flag on off and monitor it when the light is on or off. 
Title: Re: Toggle Macro
Post by: wayneaking on November 06, 2009, 05:43:25 PM
I set up a Macro just as you described and it works perfectly.  Do you have K set as the Monitored House Code?

Hmmm.  I did have K set but it keeps changing to something else.  I put it back to K this morning but the macro(s) still don't work.  I'm thinking there is some step I'm overlooking.

By the way, is there a way to have more control over the Monitored House Code?  I don't seem to be able to set this to my preference and the choices I get for Monitored House Code are not always what I need.
Title: Re: Toggle Macro
Post by: wayneaking on November 06, 2009, 05:47:04 PM
How does the program know the light is on. Maybe if you set a flag on off and monitor it when the light is on or off. 

As I understand it, it should know if the light is on a Monitored House Code.  I'm considering trying your suggestion of using a flag since the house code thing doesn't seem to be reliable.
Title: Re: Toggle Macro
Post by: HA Dave on November 06, 2009, 06:03:07 PM
Hmmm.  I did have K set but it keeps changing to something else.  I put it back to K this morning but the macro(s) still don't work.  I'm thinking there is some step I'm overlooking.

The AHP software will want to use the most used code (the code with the most modules) as the monitored code. If "K" isn't the most used it will ask you if you want to switch (over and over again). For the monitored codes to be properly monitored the modules and macros also need to saved in the interface (I believe).

I at one time created more than a dozen fake/dummy modules to fill-up the moniitored code I wanted to use... and not be pestered to change.
Title: Re: Toggle Macro
Post by: Don N on November 06, 2009, 06:33:20 PM
wayneaking -- just make sure whatever House Code you are using is monitored.  If you have another House Code that you want to monitor, then change the light (K) House Code to the House Code that you are currently Monitoring.

As they say -- Trust me your Macros work.  I did it.  Just make sure you set the House Code correctly.
Title: Re: Toggle Macro
Post by: wayneaking on November 06, 2009, 08:05:59 PM
wayneaking -- just make sure whatever House Code you are using is monitored.  If you have another House Code that you want to monitor, then change the light (K) House Code to the House Code that you are currently Monitoring.

As they say -- Trust me your Macros work.  I did it.  Just make sure you set the House Code correctly.

Thanks for the info.  How can I easily set the House Code and/or verify where it's set?  Currently I have to use "Download Timers and Macros" and then wait for the message that asks if I want to change the House Code.
Title: Re: Toggle Macro
Post by: Don N on November 06, 2009, 08:28:43 PM
Go to Tools drop down menu.  Select Hardware Configuration.  Select one Monitored House Code (A-P).  In your case K.  Now when you Download Timers and Macros and it displays Warning - Monitored House Code, select Keep the Current Setting.  You don't have to do this all the time, only when you want to download a newer version to AHP.
Title: Re: Toggle Macro
Post by: wayneaking on November 06, 2009, 10:56:00 PM
Go to Tools drop down menu.  Select Hardware Configuration.  Select one Monitored House Code (A-P).  In your case K.  Now when you Download Timers and Macros and it displays Warning - Monitored House Code, select Keep the Current Setting.  You don't have to do this all the time, only when you want to download a newer version to AHP.

Thanks for the info on Monitored House Code.

I have also solved my basic problem and have a working toggle macro.  It turns out that I had a module plugged in with the same module number as the trigger I was using for my macro.  Once I fixed that, my macro started working

Thanks to everyone who offered me help and suggestions.

FYI, the reason I wanted a toggle macro was to double the number of triggers I could get from my X10 wireless remote control.  For example, I can use an F1 ON triggered macro to turn light(s) on and off and use F1 OFF for another purpose.  This now duplicates what I was able to do by programming my TimeCommander (which recently died after many years of use).
Title: Re: Toggle Macro
Post by: Mellowmark on November 07, 2009, 01:18:20 PM
Nice Idea to get you remote to have 32 functions instead of 16.