Please login or register.

Login with username, password and session length

Author Topic: Macro and Flags  (Read 3711 times)

arf1410

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 270
Macro and Flags
« on: December 19, 2005, 01:21:44 PM »

I have a 2-way Switchlinc in the garage. If
I want teh light to turn itself off
automatically, say 5 minutes after I turn
it on, I think I can fairly easily set up a
Macro (say F5 ON triggers macrco - delay 5
mintues - F5 OFF), but can I use flags - or
some other means such that if, say TWO F5
ON commands received within 1 minute, the
light stays on (ie - the macro does not
execute)?
Logged

PK

  • Guest
Re: Macro and Flags
« Reply #1 on: December 19, 2005, 01:41:32 PM »

I've been mulling over a way of doing
something similar, and though I haven't
tried it yet I think something like this
might work:

If you want to be able to 'cancel' the turn
off portion of the macro before the time
delay elapses (which is what I believe you
are describing) I think you can do it by
structuring your "turn on/delay/turn off"
macro into two macros-- the first macro
would turn on the light, set a flag, start
the 5 minute delay, and as the last step,
instead of turning off the light after the
delay, it would include a 'pseudo device'
command.  This would allow a 2nd macro
(defined as a trigger set to the pseudo
device address) to be called by the first
macro (after the delay has elapsed)to
examine the flag, and if still on, turn off
the light.
This would allow you to clear the flag
should you decide to cancel the turn off
once the delay has begun counting down.
Clearing the flag could be done by
a 'cancel' macro with a unique trigger, or
might also be done with the original
trigger with some conditional logic at the
front end (although this may be chancy if
the trigger gets repeated inadvertently).
Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: Macro and Flags
« Reply #2 on: December 19, 2005, 02:04:19 PM »

This should be reasonably easy, but there are
a few caveats.

The biggest one is that you can't use the
"double-tap" feature of the SwitchLinc, as
the CM15A will not recognize it as two
separate commands (it sends
address-command-command instead of
address-command-address-command). I am not
sure how long you have to wait before the
SwitchLinc will send a second address-command
pair.

Another one is that some newer versions of
AHP (I am not sure if this is still true with
the latest version) don’t transceive commands
for which there is a macro, so remotes will
not turn the light on.  You can’t send an on
command within the macro though since it
would cause the macro to run again.  If it is
a dimmer you can brighten the module instead
of turning it on.  Alternately you can set up
a scene address for turning the light on from
the macro.

Assuming the switch is on A1 and you are
using a dummy macro at M1, one solution would
be to have the following:

Macro A1 ON
Conditions: flag 1 cleared
Turn on light (see 2nd caveat)
Set flag 1
Wait 5 minutes
M1 OFF

Macro A1 ON
Conditions: flag 1 set
Clear flag 1

Macro A1 OFF
Turn light off (see 2nd caveat)
Clear flag 1

Macro M1 OFF
Conditions: flag 1 set
Turn light off
Clear flag 1

This will make it so that if you turn it on a
3rd time, it will re-enable the timer, but if
it is within 5 minutes of the first time you
turned it on, it will turn off 5 minutes
after that on, otherwise it will be 5 minutes
after the 3rd press.
Logged

arf1410

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 270
Re: Macro and Flags
« Reply #3 on: December 19, 2005, 03:31:46 PM »

Roger H -

Are you sure about this (below)?

(it sends  address-command-command instead
of  address-command-address-command).
Logged

arf1410

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 270
Re: Macro and Flags
« Reply #4 on: December 19, 2005, 03:35:45 PM »

I answered my own question with the CM11A
activty monitor -
1 second appart = address-command-command
5 seconds appart = address-command-address-
command
Logged
 

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