Please login or register.

Login with username, password and session length

Author Topic: Help with a smart macro  (Read 7718 times)

jayman13

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 44
Help with a smart macro
« on: July 03, 2011, 11:58:59 AM »

I'm trying to have my bathroom light go on when I enter and go off right when I leave.  The sensor is at a place where it will only be activated when someone enters and leaves.  What is the best way to do this?  The setup I have now is that the sensor is E4 and the light switch is E9.  One macro:  When E4 is activated, flag 1 is set and E9 is supposed to go on.  2nd macro:  When E4 is activated and flag 1 is on turn E9 off and clear flag 1.  It doesn't work though.  What happens is that the light just keeps going on and off continuously.  Anyone have any ideas?
Logged

dave w

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 139
  • Posts: 6116
Re: Help with a smart macro
« Reply #1 on: July 03, 2011, 05:28:12 PM »

I'm trying to have my bathroom light go on when I enter and go off right when I leave.  

You are not going to get it to turn OFF *right* when you leave unless you use two motion sensors positioned on either side of the entrance door or at least in some way where one sensor is triggered at least one second before the other, so your macros can determine which direction you are going (in or out). And this gets a little complicated with flags.

Speaking of which, what are you using the flags for now?

Can't you just use E4 as you trigger for two macros "E4 ON = E9 ON" and "E4 OFF = E9 OFF"  Is it the one minute turn off delay the problem you are fighting with?
« Last Edit: July 04, 2011, 10:03:08 AM by dave w »
Logged
"This aftershave makes me look fat"

jayman13

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 44
Re: Help with a smart macro
« Reply #2 on: July 03, 2011, 08:52:49 PM »

I'm trying to have my bathroom light go on when I enter and go off right when I leave. 

You are not going to get it to turn OFF *right* when you leave unless you use two motion sensors positioned on either side of the entrance door or at least in some way wher one sensor os triggered at least one second before the other, so your macros can determine which direction you are going (in or out). And this gets a little complicated with flags.

Speaking of which, what are you using the flags for now?

Can't you just use E4 as you trigger for two macros "E4 ON = E9 ON" and "E4 OFF = E9 OFF"  Is it the one minute turn off delay the problem you are fighting with?

Yeah, just think it wpuld be cooler if it went on right when it entered and off right when one exited.  Thanks though.  Btw, what's the deal with transcievers?  Should I be using them?  Seems like they tend to screw things up with a CM15a from what I've read.  Any alternatives?
Logged

Dan Lawrence

  • Hero Member
  • *****
  • Helpful Post Rating: 68
  • Posts: 3991
Re: Help with a smart macro
« Reply #3 on: July 03, 2011, 09:22:24 PM »

I recommend the RR501 Transceiver, which can be gotten from http://www.automatedoutlet.com/  by itself, X10 only sells it as part of a package. Automated Outlet also sells other X10 items, but regardless of order side has flat price shipping.  Check them out.
Logged
I don't SELL this stuff... BUT I sure do ENJOY using it!!!

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: Help with a smart macro
« Reply #4 on: July 04, 2011, 01:47:56 AM »

I'm trying to have my bathroom light go on when I enter and go off right when I leave. 

You are not going to get it to turn OFF *right* when you leave unless you use two motion sensors positioned on either side of the entrance door or at least in some way wher one sensor os triggered at least one second before the other, so your macros can determine which direction you are going (in or out). And this gets a little complicated with flags.

Speaking of which, what are you using the flags for now?

Can't you just use E4 as you trigger for two macros "E4 ON = E9 ON" and "E4 OFF = E9 OFF"  Is it the one minute turn off delay the problem you are fighting with?

Yeah, just think it wpuld be cooler if it went on right when it entered and off right when one exited.  Thanks though.  Btw, what's the deal with transcievers?  Should I be using them?  Seems like they tend to screw things up with a CM15a from what I've read.  Any alternatives?

Dave W is correct, the only way to accomplish this would be with 2 motion sensors staggered in a way where you could get at least a one second delay between the two.  I think it could be done though.

As for the transceivers, I have never tried an RR501 which is a polite transceiver, but I have tried the TM751s with the CM15A, and unless you have a pretty good distance between the two, they can cause issues with each other.  I typically recommend an antenna mod on the CM15A to increase its range, but not all are savy enough to accomplish this.
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

jayman13

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 44
Re: Help with a smart macro
« Reply #5 on: July 04, 2011, 10:41:23 AM »

I'm trying to have my bathroom light go on when I enter and go off right when I leave. 

You are not going to get it to turn OFF *right* when you leave unless you use two motion sensors positioned on either side of the entrance door or at least in some way wher one sensor os triggered at least one second before the other, so your macros can determine which direction you are going (in or out). And this gets a little complicated with flags.

Speaking of which, what are you using the flags for now?

Can't you just use E4 as you trigger for two macros "E4 ON = E9 ON" and "E4 OFF = E9 OFF"  Is it the one minute turn off delay the problem you are fighting with?

Yeah, just think it wpuld be cooler if it went on right when it entered and off right when one exited.  Thanks though.  Btw, what's the deal with transcievers?  Should I be using them?  Seems like they tend to screw things up with a CM15a from what I've read.  Any alternatives?

Dave W is correct, the only way to accomplish this would be with 2 motion sensors staggered in a way where you could get at least a one second delay between the two.  I think it could be done though.

As for the transceivers, I have never tried an RR501 which is a polite transceiver, but I have tried the TM751s with the CM15A, and unless you have a pretty good distance between the two, they can cause issues with each other.  I typically recommend an antenna mod on the CM15A to increase its range, but not all are savy enough to accomplish this.

What's the best way to "mod" the antenna.  Is there an easiest one?  One for a newbie like me?
Logged

dbemowsk

  • Hero Member
  • *****
  • Helpful Post Rating: 21
  • Posts: 428
    • PHP Web Scripting
Re: Help with a smart macro
« Reply #6 on: July 04, 2011, 12:49:14 PM »

You may want to check out this thread in which someone just extended the existing antenna wire about 9 inches.  This effectively makes the existing antenna a 1/2 wavelength antenna vs the standard 1/4 wavelength.  Others have done a coax F-connector mod (see the link in the second post from Eric Goldberg from the above thread) which is what I have done, but that requires a bit more skill in soldering and such.
Logged
Dan Bemowski
Owner of PHP Web Scripting LLC
Programmer of RemoteWatch X10
User of any X10 products I can get my hands on.

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Help with a smart macro
« Reply #7 on: July 04, 2011, 01:42:50 PM »

What's the best way to "mod" the antenna.  Is there an easiest one?  One for a newbie like me?

I did the "reflector" mod, which is the simplest one in my opinion.
You need an 18.5" length of wire (I used #12 electrical wire, but a length of straightened coat-hanger is fine, too).
Simple attach it alongside the CM15a's antenna, making them even at the bottom. Use some tape, cable ties, or some tubing to hold the two together.
There is no electrical connection between the wire and the CM15A's antenna. The wire acts as a 1/2 wavelength reflector.
In my case, it has improved my RF reception enough to give me coverage in my entire house.
A side benefit is that it doesn't void the warranty.
Logged
 

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