Group Trigger Plugin

Posted on
Wed Dec 14, 2011 3:42 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Group Trigger Plugin

Neat plugin idea.

Is the idea behind the meta 1) On Trigger and 2) Off Trigger that they fire whenever there is a transition from ALL devices in the group are OFF to at least ONE of them is ON (for #1), and when there is a transition of ANY of the devices being ON to ALL of them are OFF (#2)? If so, then the actions could be to update a KeypadLinc LED button to represent the ON state of a group of devices.

Can you instead of creating a custom plugin Device instead just create a custom plugin Trigger? It seems like that is more of what you want in this case.

Image

Posted on
Thu Dec 22, 2011 1:41 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger plugin

Beta 0.9.7 is now available. The number of ON and Off devices is no longer limited. See the first post in this thread for more information.

Posted on
Thu Dec 22, 2011 4:17 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Group Trigger plugin

Great plugin

Any reason why I can't see devices created by another plugin? I have an alarm plugin Ians created (which is outstanding) that has a device for each zone. I would like to use group trigger with say all my motion zones. Does it only work for on off signals or will it also work for device state changes?

Posted on
Thu Dec 22, 2011 4:28 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger plugin

terry dew wrote:
...Any reason why I can't see devices created by another plugin? I have an alarm plugin Ians created (which is outstanding) that has a device for each zone. I would like to use group trigger with say all my motion zones. Does it only work for on off signals or will it also work for device state changes?


The problem is that plugin defined custom devices do not contain the onState property like regular Indigo devices. So, the plugin author has to create a 'state' that can be used instead. There is a note to this effect at the bottom of the first post in this topic. It's easy to miss, so here it is again:

A note for Plugin Developers: This plugin supports all Indigo devices which support the onOffState state indigo.devices.states['onOffState']. Support is provided for custom plugin devices which contain ...states['onOffState'] as a OnOff boolean. This will allow the states of alarm zones, relay boxes, etc. to be used as members of a group trigger.

For an alarm system the zone state definition might look like:
Code: Select all
         <State id="onState">
            <ValueType boolType="OnOff">Boolean</ValueType>
            <TriggerLabel>Zone state is On (fault)</TriggerLabel>
            <ControlPageLabel>Zone state is On (fault)</ControlPageLabel>
         </State>

and the plugin code to update the state is :
indigoDevice.updateStateOnServer(key='onOffState', value=True)
or
indigoDevice.updateStateOnServer(key='onOffState', value=False)
Last edited by berkinet on Fri Dec 23, 2011 8:25 pm, edited 1 time in total.

Posted on
Thu Dec 22, 2011 5:03 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Group Trigger plugin

Thanks. I missed the note. I know almost nothing about modern programing so if my question is dumb, please forgive.

Could you include access to variables in the device list so the variables could be set by other plugins to the correct "onstate"?

Posted on
Thu Dec 22, 2011 5:20 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger plugin

terrydew wrote:
Thanks. I missed the note. I know almost nothing about modern programing so if my question is dumb, please forgive.

Could you include access to variables in the device list so the variables could be set by other plugins to the correct "onstate"?

Modern, unlike... ALGOL, APL, COBOL, PL/1, ADA, LISP, Fortran, Pascal, SNOBOL :-)

Yes, adding support for variables is on the todo list. It is a little complicated to support a range of values. So, at least initially, I will support True or False values only. But, at least you would be able to use a variable as a semaphore between a device and the group trigger.

Posted on
Thu Dec 22, 2011 5:46 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Group Trigger plugin

Cobol Fortran. Not as much the age of the language but the time from last use, which is considerable. Don't know how to use the smiley face so have to make my own. :-)))

Thanks for having that on the list. I think it would be much easier than negotiating with numerous plugin developers for changes.

Posted on
Fri Dec 23, 2011 7:36 am
IanS offline
Posts: 9
Joined: Jun 16, 2011

Re: Group Trigger plugin

Added your suggested code above to the GE Caddx NX-8e plugin version 0.2.8 and sent to Terry offline to try. It should trigger any Alarm zone "triggered" state selected.

Posted on
Fri Dec 23, 2011 12:54 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger plugin

IanS wrote:
Added your suggested code above to the GE Caddx NX-8e plugin version 0.2.8 and sent to Terry offline to try. It should trigger any Alarm zone "triggered" state selected.

Thanks. This must be @terrydew's lucky day . I also sent him an advance copy of the Group Trigger plugin with variable support.

Happy Holidays to you.
Last edited by berkinet on Sat Jan 14, 2012 7:01 pm, edited 1 time in total.

Posted on
Fri Dec 23, 2011 4:49 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Group Trigger plugin

Yes I got both. Thank y'all for the effort. You must write code faster than I can talk. :D

Posted on
Sat Dec 24, 2011 1:41 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger plugin

Beta 0.9.10 is now available on dropbox

    v 0.9.9 Dec 24, 2011
  • Fixed a bug in handling of devices with no action set.
  • Added support for Indigo variables.
  • Changed device on/off logic to use device.states['onOffState']
  • Added test to make sure devices have changed state.

    v 0.9.10 Dec 24, 2011
  • Fixed a startup bug in log level setting.

See the first post in this thread for more information.
Last edited by berkinet on Sat Dec 24, 2011 2:59 pm, edited 1 time in total.

Posted on
Sat Dec 24, 2011 2:05 pm
gregjsmith offline
Posts: 946
Joined: Apr 01, 2003
Location: Rio Rancho, NM

Re: Group Trigger plugin

It's the first time I've installed this plug in. I get an error when the plug in tries to load.

Code: Select all
Indigo Group Trigger Error      Error in plugin execution InitializeMain:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "plugin.py", line 46, in __init__
<type 'exceptions.AttributeError'>: 'Plugin' object has no attribute 'logLevel'

Posted on
Sat Dec 24, 2011 2:10 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger plugin

Thanks for finding that, there should have been a default. I'll get it fixed in the next release. For now, just go to the plugin config and select a logging level. Let me know if that works.

Posted on
Sat Dec 24, 2011 2:48 pm
gregjsmith offline
Posts: 946
Joined: Apr 01, 2003
Location: Rio Rancho, NM

Re: Group Trigger plugin

I'm not getting a config menu. Just a disable, reload and about menu.

Posted on
Sat Dec 24, 2011 2:57 pm
berkinet offline
User avatar
Posts: 3290
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Group Trigger plugin

Ok, try this update
http://dl.dropbox.com/u/50307533/Group- ... 0-9-10.zip

Let me know how this works.

Who is online

Users browsing this forum: No registered users and 11 guests