Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Multiple triggers Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Handman
Senior Member
Senior Member


Joined: February 02 2009
Location: United States
Online Status: Offline
Posts: 229
Posted: June 02 2009 at 16:19 | IP Logged Quote Handman

I was wondering how to require multiple triggers before executing a command or macro. I have an insteon KPL and I would like to use it to open a garage. I have an X10 module that can activate the contacts, so now I just need PH to activate the module. Only problem is that I would like to use a sequence on the KPL to activate the module (e.g., A-B-C) like a security code so the door isn't opened accidentally. Is there a way to require multiple triggers "A", then "B", then "C" within 5 seconds to trigger the PH command to the X10 module?
Back to Top View Handman's Profile Search for other posts by Handman
 
grif091
Super User
Super User


Joined: March 26 2008
Location: United States
Online Status: Offline
Posts: 1357
Posted: June 02 2009 at 17:23 | IP Logged Quote grif091

Powerhome has so many facilities that there are almost always multiple ways of doing something, You can set a Global variable representing the press time of button A. The now() function provides current time down to the millisecond. Button B press can check the time in Global variable set by button A press to be sure button B press is within x seconds of button A. If true, set a Global variable representing the time button B was pressed. When button C is pressed it checks the value in the Global variable representing when button B was pressed. If button C press is within x seconds of button B press, do your X10 command. If any of the conditions are false or if button C press is valid, reset the two Global variables representing button A and button B press time so the process can start over.   

You would put the three KPL buttons in non-toggle mode so the buttons give the same command and it is not necessary to press each button again to turn off the LED.

I am certain there are many other ways to do this.


__________________
Lee G
Back to Top View grif091's Profile Search for other posts by grif091
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: June 02 2009 at 23:00 | IP Logged Quote dhoward

Hmmm...as Lee stated, alot of ways to accomplish this. Im just trying to think of the easiest way.

While I havent actually tried this but this may work. Say you want a combination of 3 buttons to trigger the garage door. I would create a trigger for each button. To keep it simple, lets say the sequence is ABC. I would have the trigger for A enabled and the triggers for B and C disabled. I would have the action for A that disables trigger A and enables trigger B. I would also have the action launch a macro that waits for 5 seconds (or however long you want). The action for trigger B will disable trigger B and enable trigger C. The action for trigger C will open the garage door, kill the waiting macro, disable trigger C and enable trigger A. The last part of the solution is that when the macro wait expires, it enables trigger A and disables triggers B and C.

There may be a simpler way but I think this would be fairly painless to implement.

HTH,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
Handman
Senior Member
Senior Member


Joined: February 02 2009
Location: United States
Online Status: Offline
Posts: 229
Posted: June 03 2009 at 01:03 | IP Logged Quote Handman

Dave, your method worked like a charm. I am certain Lee's would work too, but now I can delay dealing with Global
Variables for a little longer! Now I just have to figure out why the X10 signal is not getting all the way from my PLM to the gate opener. I used to have all Insteon stuff and no X10, but the X10 is soooo much more affordable. The signal is probably getting sucked up somewhere in transit. Nothing a little time and money can't fix!   
Back to Top View Handman's Profile Search for other posts by Handman
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum