Please login or register.

Login with username, password and session length

Author Topic: Can you cancel a macro with another macro?  (Read 5098 times)

mrfixup

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 1
Can you cancel a macro with another macro?
« on: April 12, 2011, 07:03:38 PM »

I have a bathroom exhaust fan remotely ducted to my shower. I've written a smart macro to control the fan with the shower (I have a flow switch in the cold water line).  Here's my question - When the shower starts, I have the macro always turn the fan off. When it stops, it waits 2 minutes and then turns the fan on for 20 minutes. However, if the shower is turned on again, the fan will stop as planned. When you stop the shower, the macro triggers again and the 2min delay and 20 minutes start over. How do I stop the first shutdown macro from running after the second shutdown macro is started?
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: Can you cancel a macro with another macro?
« Reply #1 on: May 03, 2011, 12:23:04 PM »

You might have to use a flag and check that the flag isn't still set during your delay so that it doesn't run the macro you are trying to keep from running.  Puck wrote a nice example that I'm planning on using for a chime delay (so the chime only runs once every xx minutes rather than every detected motion).

http://forums.x10.com/index.php?topic=14775.0
 

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