Please login or register.

Login with username, password and session length

Author Topic: Daytime / Nighttime Timer Flag Macro  (Read 34785 times)

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Daytime / Nighttime Timer Flag Macro
« on: October 25, 2007, 01:01:21 AM »

Narrative:
AHP 3.206

Runs from the interface or PC (users choice), however some people have reported problems when using Flags spanning between the interface Macros & PC Macros.

Suggestion: where ever the majority of your Macros that you plan to use this Flag reside, store these Macros & Timer in the same location.

Q: Why would you want to make a Macro with a timer to set a Flag for daytime / nighttime when those condition options are already available?

A: Because: 1) Flag conditions take less time to process than time conditions. 2) If you use it by itself it only uses 1 of the 3 Macro conditions allowed (time conditions require 2); if you are using other Flag conditions, then it usually slips right in without adding another condition.

1) Create a dummy appliance switch: A2 Daytime

2) Create the following 2 Macros:

     Macro Name:
      DaytimeON

     Trigger:
      A2 ON

     Action(s):
      Set Flags [2]


     Macro Name:
      DaytimeOFF

     Trigger:
      A2 OFF

     Action(s):
      Clear Flags [2]

3) Create a Timer for switch A2: to turn ON at Dawn & OFF at Dusk Daily.

Additional notes:
At Dawn, the Timer turns switch A2 ON and triggers the associated Macro DaytimeON; this Macro Sets Flag 2.

At Dusk, the Time turns switch A2 OFF and triggers the associated Macro DaytimeOFF this Macro Clears Flag 2.

Now in any macros you write and want it to only execute during the daytime, use the Flag Condition to check if Flag 2 is Set. For nighttime macros, check for Flag 2 to be Cleared.

As with all examples, the Names, X10 Addresses and Flag numbers used are changeable.

This is a simple Macro; and as your other Macros become more complex, a single flag representing daytime & nighttime helps a lot with the limited number of conditions per Macro.

As I add more Macro examples to this section, most of them will reference this Flag 2 in their conditions.
Logged

Oldtimer

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 45
  • Posts: 364
  • Line Noise & Signal Sucker Fatigue Syndrome
    • Oldtimer's X10 Forum Home Page
Re: Daytime / Nighttime Timer Flag Macro
« Reply #1 on: October 25, 2007, 10:46:22 AM »

Narrative:
AHP 3.206

A: Because: 1) Flag conditions take less time to process than time conditions. 2) If you use it by itself it only uses 1 of the 3 Macro conditions allowed (time conditions require 2); if you are using other Flag conditions, then it usually slips right in without adding another condition.



Puck: This is a really great idea and gets a helpful from me!  It has one important additional advantage you don't mention.  The existing dawn/dusk conditionals don't allow for offsets before or after dusk or dawn.  Using a dummy module as you describe allows an offset to be applied which we've never been able to do in a condition before.  As simple as it appears I consider this to be a major programming breakthrough.
Logged
Having "fun" with X-10 since 1980.

RebHawk

  • Full Member
  • ***
  • Helpful Post Rating: 6
  • Posts: 60
Re: Daytime / Nighttime Timer Flag Macro
« Reply #2 on: February 07, 2008, 01:32:15 AM »

Is the dummy module really necessary?  Wouldn't a timer set to run the macro at a given time work just as well?  Or is this (using a dummy module) yet another workaround best described by a term used to refer to a male child born out of wedlock?  ;D

Cheers,
--Lee

PS---That last part is in no way intended as a criticism of you, Puck.  It's just a comment on the often roundabout ways one has to do things in X10/AHP to get them to work... :D   Thanks for all your posts here, they're very helpful to us all.
« Last Edit: February 07, 2008, 09:28:39 AM by RebHawk »
Logged

JimC

  • Hero Member
  • *****
  • Helpful Post Rating: 41
  • Posts: 631
Re: Daytime / Nighttime Timer Flag Macro
« Reply #3 on: February 07, 2008, 06:16:04 AM »

Puck,

Great post. I also gave you a helpfull.   :)

My only problem is that I have not found flags to work reliably in AHP especially when used in macros using "ELSE".  ???
Logged
_ _ ...  ..._ _

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Daytime / Nighttime Timer Flag Macro
« Reply #4 on: February 07, 2008, 10:03:39 AM »

Is the dummy module really necessary? 

You could just as easily assign the timer to a macro by itself.

I add the dummy switch for 2 reasons:

1) It gives you an immediate visual of the current state

2) I use 2 CM15As, so in order for the one timer here to trigger the macro on the 2nd unit, it needs to be triggered via a switch.

Puck,

Great post. I also gave you a helpfull.   :)

My only problem is that I have not found flags to work reliably in AHP especially when used in macros using "ELSE".  ???

Thanks JimC. It's unfortunate that you have some problems with flags; I only use flags now. Unless it's absolutely necessary, I don't use any other condition methods for my macros. Flags are the one form of conditions that have been very reliable for me. I myself have never had good success with monitored house code states for conditions.
Logged

hollyfox

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 13
Re: Daytime / Nighttime Timer Flag Macro
« Reply #5 on: December 26, 2008, 03:19:57 PM »

This is great! I have spent the better portion of the day trying to get lights to work the way they should and what a nightmare! X10 really needs to take another look at this porduct. Somewhere in their Software Engineering department they have a gap in their testing accountability.

Of course, you all realize that they are using the fixes in this forum as material for product improvement rather that doing the proper testing before release. I am appalled at the delay that the "Pro" XPS switch has built into it. It is a good 10 or more seconds. A burglar could break into my door before I ever got the light on to video him/her.

Tighten up X10! Thanks for the good suggestion on the phantom module and triggers. Now if they will see dusk and dawn (I won't know that until this evening).

Logged

Nishant Pant

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Re: Daytime / Nighttime Timer Flag Macro
« Reply #6 on: January 02, 2009, 03:39:41 PM »

Very nice. I like the fact that by using the flag u don't eat up 2 condition checks (which the time range check does)
Logged

IPS

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 285
Re: Daytime / Nighttime Timer Flag Macro
« Reply #7 on: July 14, 2009, 05:36:36 PM »

Puck
Thanks for the macros. I plan to use them soon. I have couple of questions about macros. May be you or somebody can help.
1. What is the concept of flag in a macro? What does it do and how it does it?

Just some background for the second part.

CM15A is not connected to PC. It is stand alone near the panel. This seems to be the best place. so far I haven't had any missed commands (because of the distance of CM15A from PC) both from remotes and BVC. I have A CM19A connected to PC. So that send all commands from PC to CM15A I am sure of that because there are no other transreceiver plugged in. I used to have six transreceivers all over the house some times two for the same code. Then I read a post in this forum and installed an ACT 236 coupler/repeater and that took care of all the transreceivers. I also replaced the CM15A antenna with that of TM751 and that's why it is picking all the signals from all over the house.

Now the question:

I created a simple macro to rum from PC. It as as follows:

        B1 on   
        All C off
        wait 4sec
        Turn C1 on (Camera)
        turn on still recording
        wait 1 min
        turn of recording
        wait 4 sec
        turn off C1
        turn of B1

I am not able to get it working. I would appreciate help from any body.

P.S. sorry for posting unfinished thread. it was just one of those press of a button things.
« Last Edit: July 14, 2009, 05:48:27 PM by IPS »
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Daytime / Nighttime Timer Flag Macro
« Reply #8 on: July 15, 2009, 09:32:37 AM »

1. What is the concept of flag in a macro? What does it do and how it does it?

how to use flags

I have not used a CM19A so I'm not familiar with how a PC based AHP macro will send the commands through it to be be received and processed by the CM15A. You might want to post this question on the AHP Help & Troubleshooting section so it doesn't get buried and lost in this thread.
Logged
 

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