Please login or register.

Login with username, password and session length

Author Topic: Is it possible to start a macro from a flag condition?  (Read 11564 times)

dash

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 57
Is it possible to start a macro from a flag condition?
« on: July 22, 2008, 05:48:47 PM »

I want to start a macro when a flag becomes set.

I've got a MS13a sensor which sends a dusk signal.

When that signal is received I want a flag to be set (that bit is easy).

However....

I want that 'flag set' condition to start a macro which switches on a series of lights in sequence.

The purpose of the flag is to stop subsequent dusk signals from affecting the lights.

I thought I had a workaround, in that the sensor switches on a dummy module, which is then used as the trigger for the lights macro.

However, this doesn't behave as a flag would, and subsequent dusk signals cause lights to go through their bright 100%/dim operations again (eventhough the dummy module is still switched on from the first dusk signal).

Although I can live with this, I would prefer to have perfect control...

Any ideas?

Thanks

 Dave
Logged
Automation is great - but really frustrating when it doesn't work as expected !!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Is it possible to start a macro from a flag condition?
« Reply #1 on: July 22, 2008, 08:19:04 PM »

Why not have the sensor set the flag and the dummy/phantom. Have the light macro check for the flag before firing?
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

dash

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 57
Re: Is it possible to start a macro from a flag condition?
« Reply #2 on: July 23, 2008, 02:38:25 AM »

I thought of that, but it won't work.

The flag will set every time dusk is sensed.


Is this the answer  ... ??

Set a flag as soon as the lights come on.
Have the 'lights on' macro look for that flag's status. If the flag is unset, the 'lights on' macro can run.
If the flag is set, it means the lights are already on and any subsequent signals from the dusk sensor cannot interfere with the macro.
The flag is unset when the lights are switched off (using a timed macro). Dummy switch is no longer necessary.


Cheers

  Dave
« Last Edit: July 23, 2008, 05:50:52 AM by dash »
Logged
Automation is great - but really frustrating when it doesn't work as expected !!

PajamaGuy

  • Hero Member
  • *****
  • Helpful Post Rating: 32
  • Posts: 522
Re: Is it possible to start a macro from a flag condition?
« Reply #3 on: July 23, 2008, 07:10:42 AM »

You have to start the macro by either a timer or by a module status change - a FLAG change will not trigger a macro.

Have the dusk signal trigger a macro (Mn) that runs only if FLAG #n is SET (using conditions)
When Mn runs, have it 1st SET flag #n
Then have it do the lights.

Have another Mn macro that triggers on the DAWN signal to CLEAR the FLAG #n.

But all of that is kind of pointless.  You don't indicate that you want the "MOTION" sensor to control the lights - and you get only one DUSK (on) and one DAWN (off) signal each 24 hours.

Your words say, "Using the DUSK command of a motion sensor, turn on the lights - then a timed macro will turn them off."  Perhaps if you 'splained a bit more what you're trying to do....?

Logged
PajamaGuy
Win-7 - Dell XPS -Automation
VA12a on a dedicated desktop - Video
XTB-IIR & V572RF32

Remote via LogMeIn (FREE) and Ignition

dash

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 57
Re: Is it possible to start a macro from a flag condition?
« Reply #4 on: July 23, 2008, 11:03:45 AM »

I'm using the second module address of MS13 PIR sensor (i.e. I'm only looking for dusk signals, not movement).

More than 1 dusk and 1 dawn can be detected each 24 hour period; if heavy clouds pass for instance, they can fool the sensor into sending a dusk signal before real dusk arrives.

I want the lights to come on when dusk is sensed on the MS13 (but only after certain times - which I'm in control of using other timers and flags).

The lights turn off at the same time each night - 23:00 - on a timed macro.

I think I've cracked it now...

  Set a flag as soon as the lights come on.
  Have the 'lights on' macro look for that flag's status. If the flag is unset, the 'lights on' macro can run.
  If the flag is set, it means the lights are already on and any subsequent signals from the dusk sensor cannot interfere with the macro.
  The flag is unset when the lights are switched off (using a timed macro).
« Last Edit: July 23, 2008, 11:10:58 AM by dash »
Logged
Automation is great - but really frustrating when it doesn't work as expected !!

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: Is it possible to start a macro from a flag condition?
« Reply #5 on: July 23, 2008, 11:18:54 AM »

I think I've cracked it now...

  Set a flag as soon as the lights come on.
  Have the 'lights on' macro look for that flag's status. If the flag is unset, the 'lights on' macro can run.
  If the flag is set, it means the lights are already on and any subsequent signals from the dusk sensor cannot interfere with the macro.
  The flag is unset when the lights are switched off (using a timed macro).
Glad you figured it out. Feel free to post the details under User-Designed Working Macros someone else may find it useful.
Logged
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Is it possible to start a macro from a flag condition?
« Reply #6 on: July 23, 2008, 03:57:17 PM »

I think I've cracked it now...
  Set a flag as soon as the lights come on.
  Have the 'lights on' macro look for that flag's status. If the flag is unset, the 'lights on' macro can run.
  If the flag is set, it means the lights are already on and any subsequent signals from the dusk sensor cannot interfere with the macro.
  The flag is unset when the lights are switched off (using a timed macro).
Not sure why you don't use the timer to trigger the ON macro at dusk but you have it worked out! ;)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

dash

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 57
Re: Is it possible to start a macro from a flag condition?
« Reply #7 on: July 23, 2008, 05:28:02 PM »


Not sure why you don't use the timer to trigger the ON macro at dusk but you have it worked out! ;)

I used to trigger the lights using the dusk timer in AHP, but would find that lights came on too early or too late depending on weather conditions. So the dusk sensor overcomes those issues (now that I've got the logic working and unwanted sensor activations filtered out).




Glad you figured it out. Feel free to post the details under User-Designed Working Macros someone else may find it useful.



See here ...

http://www.x10community.com/forums/index.php?topic=15926.0 and attached word doc below.

This set of macros controls lights using dusk sensor as basis, but with flags to prevent unexpected triggers of lights, and timers to prevent lights coming on before specific times on certain days of the week. So lights could come on as late as 21:30 mid summer, but will never come on before the set times in winter (to suit house occupancy patterns).

  Dave
« Last Edit: July 25, 2008, 03:15:13 AM by dash »
Logged
Automation is great - but really frustrating when it doesn't work as expected !!

vak01

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
Re: Is it possible to start a macro from a flag condition?
« Reply #8 on: July 29, 2008, 05:13:43 PM »

As in the older, missing condition "Trigger on Module Status Change"? is that still available in AHP?

You have to start the macro by either a timer or by a module status change - a FLAG change will not trigger a macro.

Have the dusk signal trigger a macro (Mn) that runs only if FLAG #n is SET (using conditions)
When Mn runs, have it 1st SET flag #n
Then have it do the lights.

Have another Mn macro that triggers on the DAWN signal to CLEAR the FLAG #n.

But all of that is kind of pointless.  You don't indicate that you want the "MOTION" sensor to control the lights - and you get only one DUSK (on) and one DAWN (off) signal each 24 hours.

Your words say, "Using the DUSK command of a motion sensor, turn on the lights - then a timed macro will turn them off."  Perhaps if you 'splained a bit more what you're trying to do....?


Logged
 

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