X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: steven r on May 04, 2007, 02:00:54 PM

Title: Dimming Macro Using FLAG and ELSE
Post by: steven r on May 04, 2007, 02:00:54 PM
My dinning room chandelier has 8 of those small 60 watt bulbs. Needless to say, that is way too much light for most applications. I've found that about 60% brightness works most of the time. However for a candle light dinner, 40 or 50% is better. I already had a "stick on wall" switch nearby in the kitchen so I figured this would be a perfect application for a macro.

Here's what I did:

Quote
[Dim Dinning Room]
If D4 Off and Flag Status On exactly 8
(C8) Dinning Room Dim by 10%         ;Relative dim - makes light a bit dimmer.
Delay for 2 Seconds      ;Not sure if this is needed but experience says follow a dim with a delay

Else...
[Dim Dinning Room]
If D4 Off
(C8) Dinning Room Brighten then dim to 61%    ;Absolute light setting of 61%
Set Flags [8]        Flag Command
Delay for 01:00
Clear Flags [8]      Flag Command


This 1st time the trigger condition, D4 OFF, is pressed the else executes and the light is dimmed to 61%. (For some reason AHP won't let you set exactly 60%.) The else sets flag 8 providing you a 1 minute window to further dim the light before clearing the flag. During the minute after the initial 61% setting the light dims in 10% increments by additional presses of D4 OFF.

This meets my 1 touch for 60% light application while giving me the option to easily dim a bit more on occasion. More macros could be added for brightening but I don't need them so I decided to follow the "If it works, don't fix it" rule.

Hope this gives some of you out there some ideas on which to build.


[TTA Edit: Changed code to FIXED Font to simplify alignment (Create in Notepad w/TABS, then Cut-N-Paste); Added QUOTE to create highlight box for impact (CODE Font is too small, IMO.]