[ANSWERED] How to create a trigger for AllInstantOff

Posted on
Mon May 12, 2014 4:20 pm
Memaddog offline
Posts: 15
Joined: May 07, 2014

[ANSWERED] How to create a trigger for AllInstantOff

Hello,

I am 100% new to Python as of about 3 days ago forgive my ignorance as I learn. I would like to use the AllInstantOn trigger for multiple Switchlinc dimmers in a room. Looking at http://www.perceptiveautomation.com/wik ... gger_class, I see the AllInstantOn command but my brain doesn't yet know how to put it into action in working script. What is the proper syntax to say "if devices 123 receives a AllInstantOn, do the action"? My thought is this script will go in the trigger section of a Trigger event and the actual actions will go in the actions section of the Trigger.

If it helps to know the final usage, I would like to recreate an ISY program I had where if you double-tapped 'on' any of the main living room switches, all the lights in the living room would turn on. So the final script idea is one that also includes an OR component since it would be responding/watching the AllInstantOn on multiple devices.

Thanks in advance.

Posted on
Mon May 12, 2014 6:06 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: How to create a trigger for AllInstantOff

here is how I would solve this:

1. setup action group
action 1 switch on light 1
action 2 switch on light 2
..

2.setup one trigger per switch
trigger on "if state changes to on on switch 1"
action: action group in #1

and the same for off

that way it would allow you to modify the actions add / remove devices from that scenario.

Karl

Posted on
Mon May 12, 2014 11:23 pm
Memaddog offline
Posts: 15
Joined: May 07, 2014

Re: How to create a trigger for AllInstantOff

Thanks, Karl. That's the sort of direction I'll end up going if I can't figure out the scripting method. I am hoping to avoid creating a trigger for each switch.

Posted on
Tue May 13, 2014 9:25 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: How to create a trigger for AllInstantOff

Triggers cannot execute scripts (only actions).

You can do this, however, by creating a custom plugin that defines its own custom Trigger. The plugin will then subscribe to receive all INTSTEON commands, so it can look for the conditions you are interested in. It would then execute its custom trigger when the right conditions are met. For an example of how a plugin can receive notification of all incoming INSTEON commands, see the Indigo SDK download and look for the Example INSTEON/X10 Listener plugin.

Image

Posted on
Tue May 13, 2014 11:52 am
Memaddog offline
Posts: 15
Joined: May 07, 2014

Re: How to create a trigger for AllInstantOff

Thanks, Matt. I forgot that you can't use a script as a trigger - I was thinking of scripts as conditions. I went ahead and created the desired 6 triggers - 3 for double-tap to turn off all those lights and double-top on to turn on all those lights.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests