Page 1 of 7

Group Trigger Plugin

PostPosted: Wed Dec 14, 2011 3:42 pm
by matt (support)
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.

Re: Group Trigger plugin

PostPosted: Thu Dec 22, 2011 1:41 pm
by berkinet
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.

Re: Group Trigger plugin

PostPosted: Thu Dec 22, 2011 4:17 pm
by terrydew
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?

Re: Group Trigger plugin

PostPosted: Thu Dec 22, 2011 4:28 pm
by berkinet
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)

Re: Group Trigger plugin

PostPosted: Thu Dec 22, 2011 5:03 pm
by terrydew
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"?

Re: Group Trigger plugin

PostPosted: Thu Dec 22, 2011 5:20 pm
by berkinet
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.

Re: Group Trigger plugin

PostPosted: Thu Dec 22, 2011 5:46 pm
by terrydew
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.

Re: Group Trigger plugin

PostPosted: Fri Dec 23, 2011 7:36 am
by IanS
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.

Re: Group Trigger plugin

PostPosted: Fri Dec 23, 2011 12:54 pm
by berkinet
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.

Re: Group Trigger plugin

PostPosted: Fri Dec 23, 2011 4:49 pm
by terrydew
Yes I got both. Thank y'all for the effort. You must write code faster than I can talk. :D

Re: Group Trigger plugin

PostPosted: Sat Dec 24, 2011 1:41 pm
by berkinet
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.

Re: Group Trigger plugin

PostPosted: Sat Dec 24, 2011 2:05 pm
by gregjsmith
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'

Re: Group Trigger plugin

PostPosted: Sat Dec 24, 2011 2:10 pm
by berkinet
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.

Re: Group Trigger plugin

PostPosted: Sat Dec 24, 2011 2:48 pm
by gregjsmith
I'm not getting a config menu. Just a disable, reload and about menu.

Re: Group Trigger plugin

PostPosted: Sat Dec 24, 2011 2:57 pm
by berkinet
Ok, try this update
http://dl.dropbox.com/u/50307533/Group- ... 0-9-10.zip

Let me know how this works.