Group Trigger Plugin

Posted on
Tue Jan 17, 2012 11:34 am
berkinet offline
User avatar
Posts: 3383
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger plugin

bbruck wrote:
How about another enhancement - have it totally control the new fanlinc?

Already done, using thought control as a trigger, All I need is a FanLinc and a brain to test with :P

Thanks for the compliment.

BTW, to users of this plugin (and any other plugin beta I have released) until the plugin is available in the User Contribution area it is strictly IWHFM*-ware. So, your comments, bug reports, ideas, and most of all, use, are the key to good quality.

* It Worked Here, For Me - YMMV**

** Your Mileage May Vary

Posted on
Tue Jan 17, 2012 2:49 pm
berkinet offline
User avatar
Posts: 3383
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Next features

I am considering the following features for the group trigger plugin. Please let me know if any of these are of interest to you:
  • Ability to immediately end all pending Auto-Off actions.
  • Support for a custom variable True/False pair on a per-device basis (in addition to the current global custom pair).
  • Add your own idea here...

Beyond that, I think this plugin is more-or-less finished. The main idea was to keep it simple and focused. So, I am interested in any ideas that help with the basic mission (allow multiple events to trigger an action or actions) while at the same time, avoiding mission creep.

Posted on
Tue Jan 17, 2012 3:57 pm
berkinet offline
User avatar
Posts: 3383
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Group Trigger Auto-Off

There seems to be a question about the difference between the Group Trigger Auto-Off feature and the Indigo Action option Auto-off after [] minutes.

The plugin supports three capabilities not available with the Indigo built-in option:
  • Execution of a series of actions after the time delay.
  • Control of variables.
  • A non-resettable (fixed time) option.

However, if you are just turning on a device, and want it to shut off after a period of time (allowing for resetting the timer) there is no real difference between a resettable Auto-off in the plugin and the Indigo Action option Auto-off enter [] minutes. But note, with the Indigo built-in feature, there is no need for a separate "Off" action. To use the plugin's auto-off feature, you would need to create a separate Action to be called after the timer expires.
Last edited by berkinet on Tue Jan 17, 2012 4:02 pm, edited 1 time in total.

Posted on
Tue Jan 17, 2012 3:57 pm
terrydew offline
Posts: 257
Joined: Jun 10, 2011

Re: Group Trigger plugin

I vote for custom variable on a per-device basis.
Also the feature you originally mentioned of a "all" option in addition to the any logic. i.e. if all group trigger devices/variables are true then.....

Thanks for your effort.

Posted on
Wed Jan 18, 2012 4:55 am
bbruck offline
Posts: 325
Joined: Oct 05, 2008

Re: Group Trigger plugin

I may have more feedback after I start using it more, but certainly the ALL option would help

Posted on
Sun Feb 26, 2012 12:26 am
terrydew offline
Posts: 257
Joined: Jun 10, 2011

Re: Group Trigger Plugin

Any more thought on adding an "all" function?

Posted on
Sun Feb 26, 2012 1:38 am
berkinet offline
User avatar
Posts: 3383
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger Plugin

terrydew wrote:
Any more thought on adding an "all" function?
For the time being, I am inclined to leave it the way it is. Adding support for "All" requires a lot of work to track the state of every device that is included in the trigger. Also, I think you might be able to do pretty much the same thing with the new Conditions editor.

For example, trigger if lamp a is on, with the conditions that lamps b, c, d, e, f, etc. are also on (Or, you could, of course, do the opposite, if all are Off).

Give that a try and post a note with your results.

Posted on
Sun Feb 26, 2012 1:42 pm
terrydew offline
Posts: 257
Joined: Jun 10, 2011

Re: Group Trigger Plugin

Not sure that would work for what I want to do.

I have 10 door security devices with states of triggered and normal. I have set the custom variable to true for triggered and false for normal and I have a trigger to load the device state into a variable for each device which I use the the group trigger.

I want the group trigger to set a variable "anydoor" to true when any door is opened.

I want the variable "anydoor" set to false when all doors are closed

----------------------------------------------------------------------------------------------

Tried setting up two group triggers one for the on event (door opened) and one for the off event (door closed) using the conditions as you suggested. This does not work. I even removed all the conditions and the off group triggered never fired when a door closed. I also tried using a regular trigger as the off action and that did not work either.

I tested the group trigger on a group of lights with action to toggle another light. Worked fine. Did the same trigger but used the door variables and the on (door opened) trigged turned the action light on then off (blink). The off action did nothing either by action light or any entry in event log that the group trigger had fired. To test the variable system I set up test variables by loading the device state of two light switches. I then used those variables in the group trigger and it worked as expected.

So the problem is in the custom variable area. It looks like when it gets a custom variable "on" it sends two actions (it the test where the action was to toggle a light it sent a on and a off). When it gets a "off" it does not send an action.

I up graded to the latest version (0.9.13) before I started testing.

Posted on
Sun Feb 26, 2012 2:30 pm
berkinet offline
User avatar
Posts: 3383
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger Plugin

Sorry, I wasn't clear. You should use a regular trigger, not the Group Trigger. Here is a step-by-step...

Use the Group Trigger for all of your alarm zones, as you now have. In addition to whatever it now does, add two actions: the first sets a variable (alarmChange) true, the second sets it false after a very (0.02 minute) delay. The purpose of this is ti have something that indicates any change in your alarm system.

Now, create a standard trigger (not a Group Trigger). Have if triggered on any change in alarmChange. Add 10 conditions - ALL must be true - one for each zone variable you already have. Each conditions tests for a false for the zone. So, each time there is any change in your system, this trigger will check if all zones are false, and then do something.

Does that make sense?

Posted on
Sun Feb 26, 2012 3:29 pm
terrydew offline
Posts: 257
Joined: Jun 10, 2011

Re: Group Trigger Plugin

I tried the regular trigger with the same problem. I combined two posts in one. The first was what I was trying to do and the second part is a bug report. Sorry, I should have separated them. I can see how a separate regular trigger might work but can't test due to bug in the custom variable area. If I can do more testing or try different ways, please let me know.

Posted on
Sun Feb 26, 2012 6:31 pm
berkinet offline
User avatar
Posts: 3383
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger Plugin

@terrydew. Good catch on that bug. I was able to duplicate the problem and found there were actually two issues. First, the variable "Off" processing was due to a bug, and is fixed in 0.9.14. However, the problem with the lights blinking on and then off was due to reversing the logic in the variable settings. In this case, when a zone is faulted, and you want an On action, the variable should be set to True, then set to False when the zone is restored.

After fixing the bug, here is what I did that worked.

First I created triggers to maintain variables that tracked the zone states (True = fault, False = clear).

Next, I created a Group Trigger that looked for ANY of the variables to become true, and if so, had three actions:
    1) Turn on a light
    2) Change the variable alarmChanged to True
    3) after a 0.02 minute delay change alarmChanged to False
EDIT: Now that I think about it, there is probably no need for steps 2 & 3 here. You only want to test that ALL zones are cleared when one becomes Off. There is no point in testing when a zone becomes faulted.

In the same Group Trigger, for the Off trigger I selected the same variables I used for the On trigger, and for the Off Action I selected a Action Group that did the following:
    1) Change the variable alarmChanged to True
    2) after a 0.02 minute delay change alarmChanged to False

Finally, created a regular Indigo trigger that looked for variable alarmChanged to become True. The trigger had several conditions ALL of which had to be logically True. Then, I selected each zone tracking variable and set the condition to "is false" (I.e. all variables had to be false as a condition for executing the action. Finally, the Action turned off the light.

Now that we (hopefully) have all of that squared away, I think you can make this a bit easier. I think IanS changed his GE Caddx plugin to be directly compatible with the Group Trigger plugin. So, you should be able to just track the devices directly in the Group Trigger without needing variables (except for alarmChange, which triggers the ALL condition test). One caveat, there have been some changes in Indigo since IanS made that change and updates to the Group Trigger may have broken the ability to read the Caddx device states. If that his the case, let me know and I will get with IanS to get it fixed.

Posted on
Sun Feb 26, 2012 6:32 pm
berkinet offline
User avatar
Posts: 3383
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Group Trigger Plugin b-0.9.14 Available

Beta 14 is now available. See this post for more information.

Posted on
Sun Feb 26, 2012 6:55 pm
terrydew offline
Posts: 257
Joined: Jun 10, 2011

Re: Group Trigger Plugin

Thanks for the update. I will try it out soon. At one point Ian had turned that part of his code off because he thought it might be causing issues elsewhere. I think he has since concluded that it was not so if you wouldn't mind, please let him know what changed.

Not sure why you are using the change variable. If the on state triggers the output variable (anydoor) to true when a door opens, and when the (or any) door closes the off trigger starts a regular trigger with conditions that all doors have to have a closed state before it triggeres the output variable to false, the output variable should always reflect if any door is open "true" or all doors are closed "false". What am I missing? I have to admit that my head starts to hurt after the second level of logic. :D

I will try this and let you know.

Posted on
Sun Feb 26, 2012 7:26 pm
berkinet offline
User avatar
Posts: 3383
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger Plugin

terry dew wrote:
...Not sure why you are using the change variable... ...and when the (or any) door closes the off trigger starts a regular trigger with conditions that all doors have to have a closed state before it triggeres the output variable to false...


I was assuming you'd use an independent trigger to watch a variable and then check all variables when the watched variable changed. However, as you suggest, if you use a trigger as the Off Action (which ignores the trigger definition anyway), then you can use the conditions contained in that trigger. But, I think your approach would work just as all with less complexity - and in complex systems, less is always more.

Good idea.

Posted on
Sun Feb 26, 2012 7:37 pm
terrydew offline
Posts: 257
Joined: Jun 10, 2011

Re: Group Trigger Plugin

I think I found a reason to use your change variable. The zone device currently does not have true/false value available so you can't use in the conditional editor. I can't use my zone variables either as they are normal/triggered and the equal to function in the conditional editor does not apparently work with strings? Will now try change variable route.

Who is online

Users browsing this forum: No registered users and 1 guest