X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: Chris S. on February 25, 2006, 05:06:43 PM

Title: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: Chris S. on February 25, 2006, 05:06:43 PM
I wanted to create a Macro to turn on a light in our bedroom if someone gets up in
the middle of the night to go to the bathroom.

The problem was, that the way the Lamp modules work (I have the LM465)
is that the Lamp Module would turn on to full brightness (if motion was sensed)
and then down to the dim level. (50%).

You can only dim the module if it is currently on.
There may be other ways of doing this (would like to hear other methods),
but what I did was turn on the Lamp, and set it to 2% (that was the lowest setting, couldn't tweak to 1%)
now the lamp module is on.

Motion Sensor in bedroom - A2
The Macro is triggered by motion in the room and another macro is triggered after 1 minute
(A2 OFF set on the Active Eye

Macro 1 "Bedroom Night Light ON"

Trigger Condition A2 ON and
It's After Dusk or
It's Before Dawn
End Trigger Conditions
Brighten Bedroom Light by 50%


Macro 2 "Bedroom Night Light OFF"

Trigger Condition A2 OFF and
It's After Dusk or
It's Before Dawn
End Trigger Conditions
Dim Bedroom Light by 50%

This leaves the Night Light on all the time, but looking
at the filaments, the Light is really not on at all, and
according to AHP, the module now read 0% after
running the macros a couple of times to test.

I'd be curious to see how other people are doing this.

Chris
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: Chris S. on February 25, 2006, 07:55:55 PM
Well after playing with this macro a bit, it did not work out as
intended.

If the motion sensor is tripped within the 1 minute time frame
after the light has been brightened to 50%, another trigger
will increase the brightness another 50%.

Back to the drawing board.

Also, it appears that when using a condition if a module is on
can only be used for those modules on the HC being monitored.

Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: Mystyx on February 25, 2006, 11:48:35 PM
I think you would need to add a flag to this to wait for 1 min and clear the flag to make sure it doesn't repeat the command before it turns off.
I'm still playing around and haven't tried much with flags as of yet, but others have used the flag functions to do similar things you are trying. I would go more into details if I had them.  :-\
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: Chris S. on February 26, 2006, 01:52:54 AM
Mystyx:

The flags were the trick.
I think I've got it working now.
Here's the 2 Macros.

The ON Macro checks if Flag 1 is currently OFF and
if TRUE then turns the light on and dims to 50%.

The OFF Macro turns of the light, and resets Flag 1  to OFF.

If the light is has been set on by the On Macro,
and if the sensor picks up activity again prior to the OFF Macro
the Flag 1 is still set to ON, so the ON Macro will not execute the remainder
of the steps.


Bedroom Night Light ON
(http://i1.tinypic.com/ok8m4y.jpg)


Bedroom Night Light OFF
(http://i1.tinypic.com/ok8v90.jpg)
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: Mystyx on February 26, 2006, 02:02:24 AM
Nice, Ill need to try my more complex macros with flags, see what I can come up with for disabling sound (door bell) and disabling a cam.... ive been waiting to make sure I have a complete stable system before trying to setup multiple macros set off within macros using flags ect.
one thing with what im trying to do too uses both interface and PC run macros, so I best get it right :P
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: emil on February 27, 2006, 08:20:37 AM
You can lock out multiple hits by looking at the light module as a condition also.
Just replace the flag condition with if the light module is on. It's just a bit cleaner, I use it all the time to prevent multiple light on/chime hits.
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: Chris S. on February 27, 2006, 10:58:38 AM
Good idea, but my problem is that the only HC I can create a condition to check if the
module is on, is HC B.

The module in question is on HC A

My CM15A is set to monitor HC B.

Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: emil on February 27, 2006, 01:06:49 PM
Ah,

I'm assuming you need to monitor B for something, otherwise change it to A.
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: Chris S. on February 27, 2006, 08:55:57 PM
Yeah,
The majority of my H codes are on B.

I wonder if X10 has any plans on upgrading the interface to monotor all H codes.
Would be nice.
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: emil on February 28, 2006, 08:22:55 AM
I'm wondering if it would check A even if it is not on the monitored channel?
When I get a chance I'll try a little test routine to see if this is the case.

As I asked for before, sure would be nice to have more detailed documentation on how these macros and the interface works.
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: Mystyx on March 05, 2006, 01:06:16 AM
Man, Emil...  that would mean figuring out a whole new setup, get certain modules on one HC as im using 5 HC atm :)

but yes, thats one reason I havent played with monitoring and flags yet, but waiting to get some bugs in AHP worked out first :)
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: Dan Lawrence on March 05, 2006, 10:23:18 AM
You can specify any trigger houscode in a macro, either in AHP or Smart Macros. If you need to set up a keypress macro, set the adress (i.e. B1) when the macro is constructed or edited. Macros are not bound to any specfic trigger code.
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: stolzb on March 27, 2006, 12:18:43 PM
I know this is a late reply, but I've got the same setup (brightening and dimming a bathroom light) and I've got it where it will soft start and dim out after two minutes.  I got this from another post, can't remember where but it works.  I am replying to this post from a computer that doesn't have AHP on it so I can't provide screen shots.  Here is the setup.

D1 = Bathroom Sensor
D3 = Light Switch

Macro Name:  Master Bath On

Trigger: D1 on, Between 10:00pm and 12:00am, Flag 2 off.  End Trigger
Set Flag 2
Brighten D3 to 40%

End Macro

New Macro: Master Bath OFF

Trigger: D1 Off, Flag 2 on,(No time conditions).  End Trigger
Delay 1 Min
Dim D3 99%
Clear Flag 2

End Macro

I set up another Macro between 12:01am and 5:30am.  I was having trouble with the macro if it crossed midnight. Don't know why. 

The first time you trip the macro, the light will go full bright until it Dims 99% and from that point on, it will brighten to 40%.  When dimming the light by 99%, I can stand in the totally dark room and see no light from the fixtures, so in essence, it is off.  This "tricks" the switch into thinking it is on 1% so it can brighten to 40% without having to turn full on then dim to 40%.  Gives that soft start.

I was having trouble with the delay of the motion sensor interfering with the delay I set up in the macro so I set the macro to use the delay of the motion sensor of one minute. When it sends its off command, the macro will delay one more minute and then dim.

Hope this is what you were looking for.  I works in all three of my bathrooms.

 
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: dave w on March 28, 2006, 11:19:10 AM
stolzb

What is the flag doing?
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: stolzb on March 29, 2006, 02:40:36 PM
Dave,  I was having trouble with the light resetting everytime I trip the motion sensor while I was in the room.  Setting flags while it was scheduled and clearing them stopped it from happening.  When I trip the motion sensor, it will check to see if the flag is checked, if no, it would brighten the light.  If yes, it wouldn't do anything.
Title: Re: Creating a Macro to set a Lamp Module to a specific Brightness
Post by: stolzb on March 29, 2006, 02:45:34 PM
Hey all,  I must be blind.  Chris S. posted almost the exact thing that I did earlier in this thread.  My apologies.