Please login or register.

Login with username, password and session length

Author Topic: Flags Question  (Read 4373 times)

birdzeye

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 475
Flags Question
« on: July 31, 2009, 07:30:29 PM »

I have read several posts on Flags and Tuicemen's Flags Basics and I still don't get it. What are Flags?

When you make a new Macro and go over to the righthand side and drag and drop Flags into your Macro, what do the 16 check boxes stand for? Are you supposed to have MADE the 16 flags somewhere else beforehand or what? Are they pre-made and if so, where do you find out what they mean? Like if you check off #5 and set it, what will happen?

Logged

hawk1

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 625
Re: Flags Question
« Reply #1 on: July 31, 2009, 07:43:47 PM »

basically its sort of a condition.  Inside of a macro if you set a flag (example: flag2 on) than you can use that as a condition in a different macro to see if it should run or not.

you could look at flags like little switches.  if you set the switch (flag) on or off then that switch (flag)can be used as a condition for macros and such.

If you have a macro that sets flag 2 and starts video recording, you can have another macro look to see if flag2 is set and if it is set then that macro won't run.

but if you set the flag 2 and then video recording, delay 30 sec, clear flag 2 then your other macro would see that flag 2 was set and not do anything, then if the macro is done running after 30 sec then your macro would see that flag 2 is clear and it can go ahead and run. 

hope I didn't confuse you.   ;)
Logged
koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: Flags Question
« Reply #2 on: July 31, 2009, 07:58:52 PM »

birdzeye,

Think of a flag as a single bit memory location that can have one of two states, either "set" or "cleared".

You can use it in a macro to "remember" if something has happened or not.

Say you want macro "B" to do something, but only if macro "A" has been triggered.

Macro "A" would "set" a flag like maybe flag "2".

Then the next time macro "B" fired, it would check flag "2" in a condition and only continue if flag "2" is "set".


Sorry, couldn't come up with a decent "real world" example.    :(


Looks like hawk1 did while I was typing this though.   #:)


 >!
« Last Edit: July 31, 2009, 08:01:22 PM by -Bill- (of wgjohns.com) »
Logged
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

birdzeye

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 475
Re: Flags Question
« Reply #3 on: July 31, 2009, 08:07:55 PM »

hawk1 and Bill,

Hey thanks those were helpful posts--both good explanations. I think I understand now, though it really does sound totally complicated and somewhat maddening.

Can I get more info on actual working examples of this, showing how the separate macros would be constructed? In AHP Help, it said something about a Macro Library, but I'm not sure if this is still available or if it really was a "library".  Is there a "library"?


Logged

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: Flags Question
« Reply #4 on: July 31, 2009, 08:14:06 PM »

hawk1 and Bill,

Hey thanks those were helpful posts--both good explanations. I think I understand now, though it really does sound totally complicated and somewhat maddening.

Can I get more info on actual working examples of this, showing how the separate macros would be constructed? In AHP Help, it said something about a Macro Library, but I'm not sure if this is still available or if it really was a "library".  Is there a "library"?




Unfortunately, the macro library turned out to be "vaporware".  ;)   >*<
Logged
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

hawk1

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 625
Re: Flags Question
« Reply #5 on: August 01, 2009, 10:04:16 AM »

Macro 1:
trigger b2 motion sensor
check if flag 2 is off (condition)
set flag 2
cam2 on
start recording
delay 30 seconds
stop recording
clear flag 2

Macro 2:
trigger b3 motion sensor
check if flag 2 is off (condition)
set flag 2
cam3 on
start recording
delay 30 seconds
stop recording
clear flag 2

Description:  When macro 1 is triggered by b2 it checks the condition of flag2, if it is on macro 1 won't do anything since the condition of flag 2 is set. Basically in the macros above flag  2 set means that the system is recording.

If macro 1 is triggerd by b2 and flag 2 is cleared it will run, set flag 2 and record video for 30 seconds then stop and clear flag 2 so if trigger b3 fires it can record.

Same with macro 2, it will check the flag status and if macro 1 has set flag 2 macro 2 won't do anything, but if macro 1 isn't running then macro 2 will execute and record video.

You have 16 flags to play with.  Like Bill said it's a good way to see if something or a macro was triggered or running. In the above example if macro one is already recording you wouldn't want to try to start another instance of recording.  Flags keep that from happening.

That being said, they can get confusing and out of hand. 

Hope I haven't confused you!   ;)
« Last Edit: August 01, 2009, 10:18:13 AM by hawk1 »
Logged
koopr@sstelco.com, I don't know what I'm doin but I'm havin fun doin it!

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: Flags Question
« Reply #6 on: August 01, 2009, 10:56:47 AM »

Also check out the forum section User-Designed Working Macros for examples.
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. :)
 

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