Please login or register.

Login with username, password and session length

Author Topic: SDK scripts to apply to macros?  (Read 10420 times)

awesomapowa

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
SDK scripts to apply to macros?
« on: October 26, 2006, 02:12:20 PM »

I would like to use an AHP Macro to cycle a pair of 2-pin modules every 30 minutes. At the moment I have had to create a timer for every other 30 minute period in the course of 12 hours. Is there a way to apply a script that basically says

if (minutes are evenly devisiable by 15)

 run a macro

end if

Thanks!
Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: SDK scripts to apply to macros?
« Reply #1 on: October 30, 2006, 01:33:19 PM »

There are several solutions to this problem.  You could use the SDK to write a program which would trigger the macros, but I think an easier solution is to write two macros like this.  It assumes you are using M1 ON and M1 OFF have defined virtual "dummy" appliance module at address M1.

Macro M1 ON and Flag 1 Cleared:
Turn Modules On
Set Flag 1
wait 15 minutes
Turn M1 OFF

Macro M1 OFF and Flag 1 Set:
Turn Modules Off
Clear Flag 1
wait 15 minutes
Turn M1 ON

All you have to do is trigger M1 ON once it will alternate between the two macros approximately every 15 minutes.  If you need it to be more accurate, you can shorten the 15 minute delay by a couple seconds since it will take a ore or two seconds to turn the modules on and off.  If you are wanting it at very specific times, you can use a timer to re-trigger M1 ON one or more times a day (as long as the macros take slightly longer than 15 minutes, the flags should allow a new macro thread to be started and stop the old macro thread).

As written these macros use SmartMacros to assure that you don't get 2 macro "threads" causing unpredictable behaviour.  If you don't have SmartMacros, just don't use the flags and make sure you don't trigger the macro loop more than once.
Logged
 

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