Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: how to use flags  (Read 73144 times)

jimnfl

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
how to use flags
« on: November 04, 2005, 06:17:53 AM »

the directions on how to use flags are
vague.  can anyone tell how to use them and
their purpose.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: how to use flags
« Reply #1 on: November 04, 2005, 03:46:28 PM »

flags are conditions to be used in
smartmacros they can be used set or cleared.
They can be used to lengthen the number of
conditions a macro checks before running.
you can set/clear a flag any number of ways
even with another macro. Eg If you have one
macro "A" set  flag 1 at the begining of the
macro and clear it at the end. then You can
have another macro "B" check to see if flag
1 is set/cleared thus it tells macro B if
macro A is running or not.
Using flags can become as complicated as
your imagination lets it. :)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

tom j

  • Hero Member
  • *****
  • Helpful Post Rating: 16
  • Posts: 1270
Re: how to use flags
« Reply #2 on: May 17, 2006, 01:32:46 AM »

flags are conditions to be used in
smartmacros they can be used set or cleared.
They can be used to lengthen the number of
conditions a macro checks before running.
you can set/clear a flag any number of ways
even with another macro. Eg If you have one
macro "A" set  flag 1 at the begining of the
macro and clear it at the end. then You can
have another macro "B" check to see if flag
1 is set/cleared thus it tells macro B if
macro A is running or not.
Using flags can become as complicated as
your imagination lets it. :)

Say how about another general example of a flag and there uses. Thanks

Tcj
Logged

jatracy

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 28
Re: how to use flags
« Reply #3 on: May 17, 2006, 10:08:23 AM »

I tried using flags in my multiple motion detector setup. I was setting a flag in a macro each time motion was detected and turning on the lights and clearing the flag when the motion detector sent the OFF command. I also had an else statement look at all the flags to decide to turn the lights off or not. The problem I had, was I was trying to insert a delay in the macro before clearing the flag (as opposed to setting the delay on the motion sensor), but the flag would get cleared as soon as the macro was triggered. I have since stopped using flags and I just setup the motion detectors for the amount of delay I want and check the status of the dummy appliance modules that are on the same HC/UC. I would prefer to use flags, but it works so why break it if it ain't broken!
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: how to use flags
« Reply #4 on: May 17, 2006, 10:33:23 AM »

I use dummy/phantom modules as well as flags but that for another thread. Heres a simple example of a flag I use to tell my system that I'm working day shift anything which would run during the day if I'm home checks to see if the flag is setor cleared first.Also I can have macro wich will only run if I'm at work by checking to see if this flag is set or not. Macro is triggered by a motion sensor  and has limitations eg: if my wife gets up at this time for some unknow reason!
but for the most part it works flawlessly ;) :D Note: the flag is cleared every night with a timer instead of at the end of the week in case of a false set. ;)
« Last Edit: September 26, 2007, 04:11:44 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

tom j

  • Hero Member
  • *****
  • Helpful Post Rating: 16
  • Posts: 1270
Re: how to use flags
« Reply #5 on: May 19, 2006, 12:48:04 AM »

I use dummy/phantom modules as well as flags but that for another thread. Heres a simple example of a flag I use to tell my system that I'm working day shift anything which would run during the day if I'm home checks to see if the flag is setor cleared first.Also I can have macro wich will only run if I'm at work by checking to see if this flag is set or not. Macro is triggered by a motion sensor  and has limitations eg: if my wife gets up at this time for some unknow reason!
but for the most part it works flawlessly ;) :D Note: the flag iscleared every night with a timer instead of at the end of the week incase of a false set.

Say this is great thanks!! bought Active home Pro a while back but because of range issues I haven't hooked it up yet. Guess I should download the software and start experimenting still currently using the old Active Home. Just wondering do you know if there are any books that help explain this kind of programing? really would be great if there was it would be a big help. One last thing what's the definition of a flag anyway. Thanks Again!

Tcj
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: how to use flags
« Reply #6 on: May 19, 2006, 03:58:38 AM »

...Just wondering do you know if there are any books that help explain this kind of programing?...
This forum is the closest thing you'll find to a book. There's a good chance that what you want to do has been done before. If not, someone will give you an idea how. This is what I call "drop & drag" programming. Try it out. Start building a macro and drag each step over. If you have a problem or question, let us know.

...One last thing what's the definition of a flag anyway....
A flag is a setable condition that can be tested later. eg. You could set flag 2 from one macro and later test for it in another macro. You can have your macro take action or not based on the condition of the flag. Hmm... Perhaps not the clearest explanation. Hope it helped, anyway. Best way to learn is start making macros and see what happens.

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: how to use flags
« Reply #7 on: May 19, 2006, 08:44:01 AM »

tom j: steven r is right
Quote
This forum is the closest thing you'll find to a book. There's a good chance that what you want to do has been done before. If not, someone will give you an idea how.
Users on this forum have been able to do things with AHP and the CM15A that even X10 hadn't thought of. Even when they said it couldn't be done we found workarounds to prove otherwise! ;) ;D :D as for the definition of a flag  check here: Definition of a flag found at  the X10 Knowledgebase Wiki
« Last Edit: September 26, 2007, 04:13:26 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

maddoghoek

  • Newbie
  • Helpful Post Rating: 1
  • Posts: 2
Re: how to use flags
« Reply #8 on: May 20, 2006, 03:29:09 PM »

Is the current status of a dummy module held in the CM15 or do you need a PC running.  I was using flags to create an on/off switch of my motion detectors.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: how to use flags
« Reply #9 on: May 23, 2006, 09:44:32 AM »

« Last Edit: September 26, 2007, 04:14:51 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

RJMiller

  • Full Member
  • ***
  • Helpful Post Rating: 0
  • Posts: 37
Re: how to use flags
« Reply #10 on: October 16, 2006, 06:08:20 PM »

Hi, I am also trying to use flags with phantom modules.

I am using a flag to show if it is a weekday or not.  Since SmartMacros only allow for two conditions I run this macro prior to the macro with the time range in it.  I am trying to decrease the number of phantom modules I have to use.  Somehow things just don't seem to be working.  I check flag 16 to see if set (weekday) and then check the time range then go about my business of taking action.

I use other flags to determine which door has opened...  door switch triggers a macro which sets a flag identifying say... door 1 as the one that is opened.  Then a checkflag macro looks at the flags and runs another macro specific to the flag it sees... flag 1 would be door 1 then action is taken.

For instance...

  Door 1 switch triggers a macro
    run macro checkweekday (set flag 16 appropriately)
    set flag 1
    run checkflag macro

  Checkflag macro
    if outside working hours and flag1 and 16 set (weekdays and door1)
      run door 1 macro

  Door 1 macro
    send email saying someone there after working hours

I can do this with multiple phantom modules but somehow the flag logic isn't working.  Anyone have any ideas?

  RJ

Logged

delibaker

  • Sr. Member
  • ****
  • Helpful Post Rating: 2
  • Posts: 76
Re: how to use flags
« Reply #11 on: October 16, 2006, 06:49:48 PM »

RJ, you should be able to use the conditions "Weekday" and "Time Between" to do what you want.  I don't have the email option but I've included a screenshot of what it would look like!  HTH!

Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: how to use flags
« Reply #12 on: October 16, 2006, 07:08:46 PM »


  Door 1 switch triggers a macro
    run macro checkweekday (set flag 16 appropriately)
    set flag 1
    run checkflag macro

  Checkflag macro
    if outside working hours and flag1 and 16 set (weekdays and door1)
      run door 1 macro

  Door 1 macro
    send email saying someone there after working hours

I can do this with multiple phantom modules but somehow the flag logic isn't working.  Anyone have any ideas?

  RJ
You need to have your door sensor trigger a macro to set a phantom "ONLY" (no conditions or extra info like flags set etc)!  ;)
Your phantom address then is used in a macro to Set/clear flags
The problem is your security sensors/macros have to run from the PC. Flag macros have to run from the interface! Phantoms can run from either as can regular modules! ;) :D ;D
Hope this Helps!
« Last Edit: October 16, 2006, 07:10:46 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

KDR

  • Hero Member
  • *****
  • Helpful Post Rating: 53
  • Posts: 758
    • Home Automation Chat
Re: how to use flags
« Reply #13 on: October 16, 2006, 08:04:13 PM »

Tuicemen   You are 100% correct and in addition if you have MyHouse and use it for emails in macros you can't use conditions in those macros either. I tested the Day Of Week condition and found it will work if you only select 1 of the days. If you select more then that the condition doesn't apply. And none of the Time conditions work. (Security and Email has the "store in interface" and "run from pc" grayed out.

It takes 3 macros to send an email from a security sensor if there are conditions that need to be met.  Macro 1 is setup for the security sensor status and then triggers macro 2 by way of a dummy module with the same address as macro 2. Macro 2 contains your conditionals and a dummy module which turns on if the conditions are met. Macro 3 which has the same house and unit code as the dummy module in macro 2, turns on at the same time, executing the content in macro 3 which is the send email command. I have spent a bit of time looking at this trying to see if a flag could be used but keep drawing a blank. Can anyone else see a way of using a flag instead of a dummy module?

By the way I don't actually drag and drop an appliance module into a room. I go to Advance Functions in the macro window and just drop in an Appliance Control in the macro body and give it a house and unit code.

Quote
Your phantom address then is used in a macro to Set/clear flags

I can see how this works provided the flags being set are looked at or tested for by a regular macro which is checking conditions and not one of these "run from pc" only modules or dropins. I would think that this is something that will be fixed in some future update version.

Added...
The problem with using dummy modules is that it takes 2 per email. I have my security system set to email me with a specific email message giving me detail of the zone that set off the sensor. Dummy modules = Number of sensors x 2. That could end up using a lot of house codes. 10 for me right now. Maybe another 20 to 30 or more down the road.
« Last Edit: October 16, 2006, 08:21:21 PM by KDR »
Logged
Note: "Guests" may read the X10 forum , but you must register to post!

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

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: how to use flags
« Reply #14 on: October 16, 2006, 10:54:50 PM »

KDR: Hopefully this is only a "temporary work arround" until X10 updates this plug-in ::) ;) :D
Logged
Please Read Topic:
General Forum Etiquette
Before you post!
Pages: [1] 2
 

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