X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: idbl_fanatic on October 20, 2008, 11:33:25 PM

Title: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 20, 2008, 11:33:25 PM
Not sure how to do it.............

I have an eagle eye set up to turn on my kitchen lights when anyone enters the kitchen (C13), and off after 1 min of no activity, so what I would like to do, is set up a macro so that say between the hours of 10:30 PM and 5 am if it is triggered it will only light the light say 40%

Can this be done? I have never used or set up a smart macro before. But I'm learning!

It is set up as a LM14A and it does dim.

Thanks!!
Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 21, 2008, 07:28:39 AM
Well, since you want the light to come on 100% of the time, I'd leave the MS14A's direct activation/deactivation alone.  (Unless you are using new soft-starts and want the lights to ramp up to only 40%)

Then I'd simply write a macro that triggers on the MS14A and have it dim the light to 40%.  Put condition that says if the time is between 5 a.m. and 10:30 p.m. to do nothing, ELSE ramp down to 40%.  (Sometimes time-span macros don't like crossing midnight)

The MS14A will still be the "OFF"

(You may have to experiment with a couple of seconds' delay, but the MS14A's direct "ON" should be faster than the macro anyway.)

Now if you want to soft-start and only ramp up to 40%, I think you'll have to use only macros and not direct addressing.
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 21, 2008, 10:14:15 AM
ok, you TOTALLY lost me......................

LOL

I have NEVER even written a macro, I tried last night, and the light wouldn't even come on at all when I walked in there. And this was after 10:30 pm

Ok, one more thing............my eagle eye, and the light switch are both on C13, should I change that? say make the eagle eye C13, and the switch C16?
Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 21, 2008, 02:30:10 PM
Ok, this might have to come in chunks, and I'll bet Dave or Puck or Tuicemen already has it done & better, but:

I'm going to run out of time so in English (I'll write psuedo-code later):

Leave C13 for both MS14 & light.
------------------------------------------
Macro C13  - Trigger=C13=ON
Condition = FLAG#2 = CLEAR
Action
1. Set FLAG#2=ON
2. Delay 10 seconds
3. Set C13=40%
4. Delay 30 Seconds
5. Set FLAG#2=CLEAR
----------------------------------------
Save the file
Walk into the kitchen.  The light should come on 100 bright. Get out of the range of the MS14, but keep watching.  After 10 seconds it should dim.  After whatever you have the MS14's delay set to, it should go off.

Once you get that working we can go to the next step.  (The FLAG#2 is set to prevent subsequent C13=ON's from re-triggering the macro while it's running)

More later
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 21, 2008, 02:53:19 PM
Ok, this might have to come in chunks, and I'll bet Dave or Puck or Tuicemen already has it done & better, but:

I'm going to run out of time so in English (I'll write psuedo-code later):

Leave C13 for both MS14 & light.
------------------------------------------
Macro C13  - Trigger=C13=ON
Condition = FLAG#2 = CLEAR
Action
1. Set FLAG#2=ON
2. Delay 10 seconds
3. Set C13=40%
4. Delay 30 Seconds
5. Set FLAG#2=CLEAR
----------------------------------------
Save the file
Walk into the kitchen.  The light should come on 100 bright. Get out of the range of the MS14, but keep watching.  After 10 seconds it should dim.  After whatever you have the MS14's delay set to, it should go off.

Once you get that working we can go to the next step.  (The FLAG#2 is set to prevent subsequent C13=ON's from re-triggering the macro while it's running)

More later

Ok, the only thing that I DON'T understand is this: Condition = FLAG#2 = CLEAR

How do I add this as a condition? I can only get "check if flags are on of off"

Thanks
Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 21, 2008, 03:04:45 PM
Right, check if Flag#2 is CLEAR (OFF)


Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 21, 2008, 03:08:13 PM
Sorry - Because in different places there are different words, when talking about the 16 FLAGS in the CM15A, I use "SET" & "CLEAR", when using modules as PHANTOMS (which I sometimes call "Flags") I use "ON" & "OFF".  Clear as mudd?
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 21, 2008, 03:29:17 PM
Sorry - Because in different places there are different words, when talking about the 16 FLAGS in the CM15A, I use "SET" & "CLEAR", when using modules as PHANTOMS (which I sometimes call "Flags") I use "ON" & "OFF".  Clear as mudd?

Yeah clear as mud LOL

Ok, this is what I got set up, it is a little different wording.............

Kitchen on macro:

Trigger conditions C13 On and
Flag status off - 2 and
it's after 10:30 pm and
it's before 5:00 am
End Trigger Conditions
Set Flag [2]
Brighten C13 by 40%


Kitchen off macro:

Clear flags [2]


YAY, NAY??

Thanks for all the help
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 21, 2008, 08:12:16 PM
ok, this is not working, the light will not shut off, the switch is showing that it is off, but it is still showing 100% and it is on.
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 21, 2008, 10:05:23 PM
Ok, this might have to come in chunks, and I'll bet Dave or Puck or Tuicemen already has it done & better, but:

I'm going to run out of time so in English (I'll write psuedo-code later):

Leave C13 for both MS14 & light.
------------------------------------------
Macro C13  - Trigger=C13=ON
Condition = FLAG#2 = CLEAR
Action
1. Set FLAG#2=ON
2. Delay 10 seconds
3. Set C13=40%
4. Delay 30 Seconds
5. Set FLAG#2=CLEAR
----------------------------------------
Save the file
Walk into the kitchen.  The light should come on 100 bright. Get out of the range of the MS14, but keep watching.  After 10 seconds it should dim.  After whatever you have the MS14's delay set to, it should go off.

Once you get that working we can go to the next step.  (The FLAG#2 is set to prevent subsequent C13=ON's from re-triggering the macro while it's running)

More later

This wont work either........... never dims........
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 21, 2008, 10:24:16 PM
Sorry - Because in different places there are different words, when talking about the 16 FLAGS in the CM15A, I use "SET" & "CLEAR", when using modules as PHANTOMS (which I sometimes call "Flags") I use "ON" & "OFF".  Clear as mudd?

Yeah clear as mud LOL

Ok, this is what I got set up, it is a little different wording.............

Kitchen on macro:

Trigger conditions C13 On and
Flag status off - 2 and
it's after 10:30 pm and
it's before 5:00 am
End Trigger Conditions
Set Flag [2]
Brighten C13 by 40%


Kitchen off macro:

Clear flags [2]


YAY, NAY??

Thanks for all the help

Ok, strange enough, this only works IF I click on "Run Macro" then it will work, but it wont work if I let the eagle eye activate it.
Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 22, 2008, 05:14:44 AM
In the AHP TOOLs->Preferences->Macro Options, Check the Box that says "Issue ON in place of bright".
...and are you TRANSCEIVING "C"?
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 22, 2008, 10:10:47 AM
In the AHP TOOLs->Preferences->Macro Options, Check the Box that says "Issue ON in place of bright".
...and are you TRANSCEIVING "C"?


Not sure what you mean by "and are you TRANSCEIVING "C""

Also, I played around with it a little more last night, and I re-created the MACRO, and it worked, BUT in the "OFF" time (before the macro should be active) the lights will come on to 100% and then dim to 40%
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 22, 2008, 11:11:12 AM
ok, so going back to this one just to test.............

Leave C13 for both MS14 & light.
------------------------------------------
Macro C13  - Trigger=C13=ON
Condition = FLAG#2 = CLEAR
Action
1. Set FLAG#2=ON
2. Delay 10 seconds
3. Set C13=40%
4. Delay 30 Seconds
5. Set FLAG#2=CLEAR


This works................UNTIL I put a time frame on it, then it won't execute, the Macro button flashes, but it seems that the macro don't run, the light just comes on normally.
Title: Re: Gonna TRY a smart macro, but...............
Post by: Boiler on October 22, 2008, 01:31:55 PM
Ok, strange enough, this only works IF I click on "Run Macro" then it will work, but it wont work if I let the eagle eye activate it.

Clicking on the macro "forces" it to execute - it bypasses all of the conditions you have set.
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 22, 2008, 01:36:27 PM
Ok, strange enough, this only works IF I click on "Run Macro" then it will work, but it wont work if I let the eagle eye activate it.

Clicking on the macro "forces" it to execute - it bypasses all of the conditions you have set.

AHHHH, make sense............

I still can't get it to work if I add a time frame in there. The minute I add a time frame in there, it stops working all together, I take it out, it works.
Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 22, 2008, 01:57:59 PM
For TESTING purposes:

Like suppose you had a light next to your desk that was/is "L1".  You'd create a phantom device (most use appliance modules) and address it L1.  Change the trigger of the macro to L1=ON

So when you manually switch the appliance module L1 on (via clicking on it), it would also turn on the L1 light, and trigger the macro, which would wait the DELAY and then DIM the light.  Clicking the phantom L1 would turn the L1 light off. 

Then - once you get everything working, you just change the trigger back to C13.  I hope that's clear.  (and for the gurus out there, you probably don't need the phantom, clicking the lamp module should work, but this is a bit more illustrative - don't you think?)

So when you get the test thing working, then play with the timing.  It's a pain.  Daytime & Nighttime don't work in every instance, so don't bother. 

Setting the between times uses up 2 of the 3 maximum conditions, but since the other condition is a flag, you only have 3.  "Between" times are tricky because X10 does not like to cross over midnight.  So you can reverse it  (I have to check if you can say NOT Between), or you can use "OR"s. 

If the FLAG is clear AND (time is AFTER 10:30 OR Time is BEFORE 5:30) should work.   I'll try it tonight and screen cap the content if I can get it to work.

Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 22, 2008, 03:09:19 PM
For TESTING purposes:

Like suppose you had a light next to your desk that was/is "L1".  You'd create a phantom device (most use appliance modules) and address it L1.  Change the trigger of the macro to L1=ON

So when you manually switch the appliance module L1 on (via clicking on it), it would also turn on the L1 light, and trigger the macro, which would wait the DELAY and then DIM the light.  Clicking the phantom L1 would turn the L1 light off. 



Yeah this is what I have been doing to try and get it to work, instead of walking in there all the time..............I would very much appreciate the screen capture if you can get it to work!! Thanks!!
Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 22, 2008, 05:25:26 PM
1. Tools->Preferences->Smart Macros->SmartMacroInterface=Advanced
2. LightOff Macro clears the FLAG#15
3. Between doesn’t work the way you need, especially when it eats 2 conditions (max is 3)
4. So we’ll use a PHANTOM module that is on whatever your MONITORED H/C is.  (You could use a FLAg, but you’d need a macro to set it)
5. (brand new ergo/natural keyboard, so pardon the typos)
6. You need the FLAG to stop re-entrance every time the MS14a sends an “ON”
7. Pictures are worth 1,000 words, holler if you need more words.
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 22, 2008, 05:45:44 PM
ok...........PLEASE bare with me here...............


So the "NightPhantom (F15)" is just set up for the sole purpose of the timer, so that the macro won't activate at any other time other than between those hours right?

Also........I notice that your flags are set to the same as this Phantom switch (15), so with the other try's that I was doing, should I have set them to 13?

Thanks for all the help, I will try this when I get home, for some reason my remote connection won't work today.

Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 22, 2008, 07:23:22 PM
No problem - we've all started somewhere - and like I tell my I/T departments, "We're here to help!"

Without going into security sensors, AHP and the CM15A keep track of, or "MONITOR" 32 items so that the system knows at any time the status of those 32 items.  16 of them are called FLAGS, and they are stored in the CM15A.  They are either SET "on" or CLEAR "off" - They're NOT addressed, they're just FLAGS numbered 1 through 16.

The other 16 (of the 32) things that AHP can keep track of are whatever is addressed in the MONITORED HouseCode space. I think (and for the purpose of this) the status of the MONITORED H/C devices is either ON or OFF - I don't think the "DIMMED" status is monitored. 

So let's say you go to TOOLS->HARDWARE CONFIGURATION-> and select HouseCode “C” – The On/OFF status (and on 10%=ON) of all modules that are addressed “C” 1-through16 is maintained in the CM15A.  So any MACRO can use the CONDITION of FLAGs 1-through-16, and/or the ON/OFF status of modules C1-through-C16.  (Given the above, a macro can NOT conditionally operate on the status of module G2, or any module addressed other than “C”.)
I just happened to use FLAG#15 – You can use any one of the 16.  And I named my phantom module F15 – in fact my Phantoms are all “P’s”
It doesn’t matter which FLAG or Phantom you use.  When you have all this working,  you’ll have the Phantom, the MS14A, and the LM14A all at the same address.
In sequence, the MS14A (C13) will detect motion and send a “C13-ON” – which will turn on the light at C13, and flip the PHANTOM C13 switch on, causing the macro DimLight to trigger on C13=ON.  Macro DimLight will check to see if Light C13 has NOT already been dimmed (FLAG#15=OFF) and if the time is between 10:30 p.m. and 5:30 a.m. (Phantom F15=ON) – If BOTH of those CONDITIONS are true, the macro will continue.  It sets FLAG#15 so that while motion continues, and the MS14A continues to send out C13-ON, the macro will ignore them and not pollute the power line with repeated dim commands.  The 5 second delay ensures the C13-ON from the MS14A gets there before the DIM command (and it’s probably not necessary, but what the heck) – and then we get the actual DIM command.
Macro LightOff which triggers on a C13-OFF signal from the MS14A is necessary (and te only thing it does is) to CLEAR FLAG#15 so that when the motion happens again the light gets dimmed.
CAUTION:  I have not run this and there may be a problem with the MS14A and the Light being both on C13.  I’m afraid the subsequent C13-ON’s from the MS14A might raise the light back to 100%.  If not then GREAT.  If it does, all you’d need to do is in change the address of the lamp to something else like C14, and you’d need to add an ELSE so that when the conditions aren’t met, C14 would go to 100% ON.  And you’d need to add a C14-OFF to the LightOFF macro.

For your remote connection, use LogMeIn.com's FREE stuff. 
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 22, 2008, 08:47:04 PM
Ok, got it set up just like you have, except for some reason I can't add F15, so I made the phantom one C15 instead, that should be ok right?

SO what is happening, is that it is going to 100%, and then dimming down, even after I turn off the Phantom module

Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 22, 2008, 08:51:42 PM
...........
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 22, 2008, 09:03:27 PM
Ok, I think I got it.............but................now after the macro runs, the next time I go into the kitchen, it SHOULD be 100%, but it's not. It is what the macro set it at.

AND.................it wont shut off

BTW, I do use Logmein, they had replaced our Electric meter today, and my system didn't reboot.
Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 23, 2008, 07:28:07 AM
Well, you didn’t run into the problem I thought you might – but you did find another.  The actual light switch/mofule that you’re using is one of the newer soft-start ones with a memory.  Simple ON commands cause it to ramp-up from 0% to whatever it was last dimmed-to, and the OFF command causes it to ramp-down to 0%.
The OFF should be working.  If the MS14A and the lamp are both addressed as C13, then the MS14A’s OFF signal should turn off the lamp – if that’s not working – there is an issue that is not related to AHP & macros.  Does the AHP Activity Monitor show the C13-OFF command?

To fix your problem, we’re going to have to dump the direct-action scenario of having the MS14A and the Lamp on the same address.  (I don’t use and don’t like that approach, anyway)
Leave the MS14A on C13, but put the lamp on C12 (or any address other than C13 or C14.  The MS14A throws a C14-ON at dusk, and a C14-OFF at dawn.)
The macro with the C13-ON trigger will need an ELSE, and the CONDITION for the else is IF F15=OFF.  Its action is to set C12=100%.  And you’ll have to add a C12-OFF to the C13-OFF triggered macro.
C12 = LM14A Lamp
C13 = MS14A
F15 = NightPhantom – (Set by timer)
FLAG#15 = “Macro control is active”
DimLight – Macro to Dim C12
BrightLight – Macro to set C12 @ 100%
LightsOff – Macro to turn C12=OFF
CM15A Monitored H/C=”F”
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 23, 2008, 11:09:06 AM
Well, you didn’t run into the problem I thought you might – but you did find another.  The actual light switch/mofule that you’re using is one of the newer soft-start ones with a memory.  Simple ON commands cause it to ramp-up from 0% to whatever it was last dimmed-to, and the OFF command causes it to ramp-down to 0%.
The OFF should be working.  If the MS14A and the lamp are both addressed as C13, then the MS14A’s OFF signal should turn off the lamp – if that’s not working – there is an issue that is not related to AHP & macros.  Does the AHP Activity Monitor show the C13-OFF command?

To fix your problem, we’re going to have to dump the direct-action scenario of having the MS14A and the Lamp on the same address.  (I don’t use and don’t like that approach, anyway)
Leave the MS14A on C13, but put the lamp on C12 (or any address other than C13 or C14.  The MS14A throws a C14-ON at dusk, and a C14-OFF at dawn.)
The macro with the C13-ON trigger will need an ELSE, and the CONDITION for the else is IF F15=OFF.  Its action is to set C12=100%.  And you’ll have to add a C12-OFF to the C13-OFF triggered macro.
C12 = LM14A Lamp
C13 = MS14A
F15 = NightPhantom – (Set by timer)
FLAG#15 = “Macro control is active”
DimLight – Macro to Dim C12
BrightLight – Macro to set C12 @ 100%
LightsOff – Macro to turn C12=OFF
CM15A Monitored H/C=”F”


ok!!! This seems to work, I Won't know for sure until I get home and physically switch the channel of the light switch to C12 THANKS!!!

I was thinking while laying in bed last night that I would need something that turned it on 100% in the "off" times just didnt know how

One more thing, when I tried to add say F15 as a switch, and then add a module status, the F15 doesn't show in there, only all of my C's (C1-16) Why is that?
Title: Re: Gonna TRY a smart macro, but...............
Post by: PajamaGuy on October 23, 2008, 03:12:16 PM
Quote
One more thing, when I tried to add say F15 as a switch, and then add a module status, the F15 doesn't show in there, only all of my C's (C1-16) Why is that?

Not sure I understand your question. ??? - Nope, I'm sure I don't understand your question... rofl
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 23, 2008, 03:25:10 PM
Quote
One more thing, when I tried to add say F15 as a switch, and then add a module status, the F15 doesn't show in there, only all of my C's (C1-16) Why is that?

Not sure I understand your question. ??? - Nope, I'm sure I don't understand your question... rofl

Ok, so I added a Phantom module and addressed it F15, when I went to add a condition to check status, the module F15 was not there, only all of my C's where there.
Title: Re: Gonna TRY a smart macro, but...............
Post by: Boiler on October 23, 2008, 03:53:22 PM
Ok, so I added a Phantom module and addressed it F15, when I went to add a condition to check status, the module F15 was not there, only all of my C's where there.

You can only Monitor 1 house code at a time.  Currently you have AHP set to monitor House Code C.

Please also note that since you are using the LM14a interface for your devices, you will not be able to reliably monitor them with AHP.  AHP will execute extended code bright/dim commands, but it will not show the status of the module or allow you to trigger off the status.  Workaround is to use dummy modules or flags.
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 23, 2008, 09:10:15 PM
Well...................getting closer..............it seems to work with the timer, however, it still will not go back to 100% after the "dim" macro runs, with the phantom switch off.
Title: Re: Gonna TRY a smart macro, but...............
Post by: idbl_fanatic on October 23, 2008, 09:56:56 PM
GOT IT!!!!!!!!!!!!!!!!!!!!!!!!


On the Bright macro, I can't issue the "ON" command, it needs to be set to absolute and set to 99%, and it works.

Thanks for ALL of your help!!!!!!