Please login or register.

Login with username, password and session length

Author Topic: Help setting up conditional macro  (Read 6491 times)

Mike79

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
Help setting up conditional macro
« on: September 07, 2011, 08:42:14 AM »

Hello,

I'm new to the forum and need some help. I have the smart macro plug-in. I want to set E5 (Front door lights) to come on at dusk every day (full power for now), at 10:30 pm Sunday thru Thursday turn down to 75% power, at 11:30 Friday and Saturday turn down to 75% power, off at dawn. Anytime the H6 (motion detector) sees motion during the turn down periods turn power up to 100% for 4 minutes then back to preset condition.

Question

1. Can I do this all from 1 smart macro or do I need to have timers, 1 for Sunday thru Thursday for dusk to 10:30, 1 for Friday and Saturday dusk to 11:30. Then a timer for each with the lower power til dawn. Then a macro for the motion sensor?

Thanks for the help!

Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Help setting up conditional macro
« Reply #1 on: September 07, 2011, 10:44:33 AM »

Hello,

I'm new to the forum and need some help. I have the smart macro plug-in. I want to set E5 (Front door lights) to come on at dusk every day (full power for now), at 10:30 pm Sunday thru Thursday turn down to 75% power, at 11:30 Friday and Saturday turn down to 75% power, off at dawn. Anytime the H6 (motion detector) sees motion during the turn down periods turn power up to 100% for 4 minutes then back to preset condition.

Question

1. Can I do this all from 1 smart macro or do I need to have timers, 1 for Sunday thru Thursday for dusk to 10:30, 1 for Friday and Saturday dusk to 11:30. Then a timer for each with the lower power til dawn. Then a macro for the motion sensor?

Thanks for the help!


There are a few ways to accomplish this, using a combination of timers and macros.
The timers would be used to turn the lights on at dusk, dim them at the appropriate time, and then turn them off at dawn.
The macros would be used to handle the motion-triggered activity. I think some of the motion sensors have an adjustable  "timeout" period, after which they send the "off" command for whatever HouseCode/UnitCode they are set.
If you can set that timeout to 4 minutes, then the sensor will send the "off" command after it doesn't see motion for 4 minutes.
You would then create two simple conditional macros (on a different housecode/unitcode than the light switch).
The conditions for both would be based on the day/time of when you want the lights to be dimmed.
The "on" macro would set the light to full brightness. The "off" macro would dim it down to 75%.
If you can leave the 4-minute delay to the motion sensor, then you should get more reliable operation (since multiple triggers won't cause multiple delays to start, and your light won't keep dimming up and down.

One alternative would be to actually use a macro (activated by a timer) to dim the light and set a flag. You would then use another macro to turn the light off and clear the flag.
The flag could then be used as a much simpler condition for the motion-activated macros. (if the flag is set, then run the macro - if not, don't.)

Of course, this assumes you are using lamp modules (or wall switches) that are dimmable, and are using dimmable bulbs in them.

You COULD use a conditional macro with a flag or two, and integrate the delay right into the timer, but that's a lot more work.
Logged

Mike79

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
Re: Help setting up conditional macro
« Reply #2 on: September 07, 2011, 11:14:29 AM »

Noam, Thanks for the reply.

I like the first idea, but this is for my father-in-laws home so "KISS" is important. Can i just set the motion sensor to trip the macro and set a delay of 4 minutes for now. Then if I want I can change to 5 or 3 minutes without reprograming the sensor?

trigger = H6 on

Macro to turn on E5 and brighten to 100%. Then 4 minute delay. Then dim to 75%

Will that work without opening a can of worms?

Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Help setting up conditional macro
« Reply #3 on: September 07, 2011, 03:11:33 PM »

Noam, Thanks for the reply.

I like the first idea, but this is for my father-in-laws home so "KISS" is important. Can i just set the motion sensor to trip the macro and set a delay of 4 minutes for now. Then if I want I can change to 5 or 3 minutes without reprograming the sensor?

trigger = H6 on

Macro to turn on E5 and brighten to 100%. Then 4 minute delay. Then dim to 75%

Will that work without opening a can of worms?
It is a bit more complicated than that.
The timer-based macro would set a flag (ex: flag #5 - try to steer away from flags 1,15, and 16 - they sometimes to funny things), and dim the light down to 75%.

The H6 macro would need to turn on a second flag (ex: Flag #6), brighten the light to 100%, wait 4 minutes, dim the light back down to 75%, and then clear the flag.
You would need to set it as a conditional flag to operate ONLY when the second flag is CLEAR (not set).

The problem with this, is that it will wait 4 minutes from the START of motion. If the motion lasts longer than 4 minutes, the light will dim down, then brighten again as the macro is re-triggered (with the second flag cleared). If that doesn't bother you, then go for it.
I don't know if the motion sensor keeps sending the "on" code if it is triggered again during the "timeout" period or not.

You could get even more complicated, setting the motion sensor to the minimum delay, having it run a macro that clears the flag when motion stops, and having the "bright-wait-dim" macro kick off another macro that checks that the flag is clear before dimming the light.
It can get pretty complex, and leaves lots of room for problems to creep in.

As I said, I don't use any motion sensors in my setup, so I don't really know.
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.