Author |
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: January 27 2010 at 10:37 | IP Logged
|
|
|
Is there a way within a VBS to detect when the RESULTS of executing a PH.InsteonGroup command complete? Yes, the return value comes back immediately, but if the group that the command is directed to has numerous entries in it, there is a delay.
I have a few KPLs that have a button on each for the same scene. There is a trigger for each button. The code runs some PH.InsteonGroup commands to control the status lights on various groups of KPL buttons.
Basically:
I disable any triggers that would be run when the PH.InsteonGroup commands run,
Run the PH.InsteonGroup commands,
Wait 6 seconds,
Enable the triggers that were disabled.
I have attached 2 snapshots to show behavior.
Proper behavior on Jan 25:
Jan 25 20:39:42 KPL button pressed,
Jan 25 20:39:43 Trigger starts,
Jan 25 20:39:43 Disable triggers,
Jan 25 20:39:43 Run (3) PH.InstronGroup commands, affecting (7) groups,
Jan 25 20:39:43 Execute PH.Delay(6000),
-- the groups react, and complete, which takes just under 6 seconds.
Jan 25 20:39:49 Wait period expires,
Jan 25 20:39:49 Enable triggers,
Jan 25 20:39:49 Code completes.
Bad behavior on Jan 26:
Jan 26 20:15:34 KPL button pressed,
Jan 26 20:15:34 Trigger starts,
Jan 26 20:15:34 Disable triggers,
Jan 26 20:15:35 Run (3) PH.InstronGroup commands, affecting (7) groups,
Jan 26 20:15:35 Execute PH.Delay(6000),
Jan 26 20:15:41 Wait period expires,
Jan 26 20:15:42 Enable triggers,
Jan 26 20:15:42 Code completes.
-- the groups react, which took over 6 seconds.
Jan 26 20:15:42 The triggers associated with those KPL buttons start.
-- This causes an endless process of execution.
I can always extend the PH.Delay, but essentially that is an ugly way to work it.
As per the original question, can I detect that each PH.InsteonGroup completes it's actions?
Thank you,
Richard
Jan 26th (Good):
Jan 25th (NG):
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: January 27 2010 at 10:40 | IP Logged
|
|
|
Oops, the titles over the snapshots got reversed,
it should be:
Jan 25th (Good):
Jan 26th (NG):
My apologies.
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: January 27 2010 at 11:22 | IP Logged
|
|
|
None that I know of. Normally Triggers designed to fire on inbound messages from a KPL button press do not fire from outbound messages. What are the trigger conditions that are firing from outbound messages.
__________________ Lee G
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: January 27 2010 at 12:37 | IP Logged
|
|
|
In this scenario, I only have triggers associated to KPL buttons for an "on", or an "off". What (I think) is happening is that when I execute a PH.InsteonGroup("PLMGroup", iOn, 255) to turn on the status lights of associated KPL buttons, those "on" commands are causing the triggers to start. So I think this is what is causing each trigger start, as seen Jan 26 20:15:42. When the code timing is good, and the triggers are disabled while the PH.InsteonGroup runs - all is OK.
In summary, it looks like each trigger is actually responding to an "on" - which really is an "Insteon In"?
Thanks.
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: January 27 2010 at 14:01 | IP Logged
|
|
|
If you want a trigger to fire on a button press try Insteon Group In.
__________________ Lee G
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: January 27 2010 at 15:28 | IP Logged
|
|
|
I'll check on how I have the triggers setup when I get back home.
Just to clarify, does that mean that I can set up a trigger to ONLY fire on a button press - and not via a PH.InsteonGroup command?
Thank you!
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: January 27 2010 at 19:17 | IP Logged
|
|
|
Correct. That is the way an Insteon Group In Trigger works here. Issuing a ph_insteongroup() to a PLM Group that turns on KPL button 4 does not cause the Trigger to fire that is defined to fire on an Insteon Group In for Group 4.
__________________ Lee G
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: January 28 2010 at 09:03 | IP Logged
|
|
|
Lee - great stuff! I got in one line of testing last night, and it works as advertised! Yes, I am now "trigger happy" (I couldn't resist...).
All the bulky trigger changes, delays, etc will get removed from my code, I'll update my triggers and observe. This will be MUCH cleaner. I was using "Insteon Device Change".
Is there a place where the different menu pull downs in triggers, etc are documented? I would have not known to use that selection, or known the low level details of each. There are many other menu items that look interesting.
Is there a PH limit on the number of triggers, or timed events that can be entered?
Thanks so much for saving the day again!
Richard
|
Back to Top |
|
|
grif091 Super User
Joined: March 26 2008 Location: United States
Online Status: Offline Posts: 1357
|
Posted: January 28 2010 at 10:18 | IP Logged
|
|
|
There is no Powerhome limit on the number of Timed Events, Triggers, Macros.
As far as which trigger type to use I have not seen what you are looking for. Some of the forum posts might guide you in how the various selections work. For the paddle/toggle/KPL button press, hardware generates a Group message sequence. Hence the "Insteon Group In" triggers from a Group message sequence Inbound to Powerhome. The "Insteon Device Chg" is a much broader trigger, firing on anything that changes the device status. A lot of Powerhome is trying different variations, seeing what the results are against what you are looking for.
Posting a how do I question is a way to find answers some times. Not every question will generate an answer. Something that has not been tried by the active forum watchers might not get an answer. Powerhome has so much function that there is often multiple ways to accomplish the same result, particularly involving Triggers and Macros. Sometimes you pick the way you have done before. Other times you search around through the online help or forum posts for functions you might not have used before just looking for alternatives or exploring a function not used before. Great fun!
__________________ Lee G
|
Back to Top |
|
|
RichardL Senior Member
Joined: December 29 2008 Location: United States
Online Status: Offline Posts: 165
|
Posted: January 28 2010 at 12:49 | IP Logged
|
|
|
I'm glad to hear that there is no limit, I will certainly use a decent amount.
It looks like the "Insteon Group In" will work, but will confirm with more tests. I am regularly impressed with all the things I find under Powerhome, as you mentioned, much fun finding and trying them. Sometimes you feel like you are breaking new ground! It is also great to get info from other experiences and then putting them into use. I greatly appreciate the help from you and all the other forum members.
I'll keep everyone posted as to how things test out.
Richard
|
Back to Top |
|
|