Conditions in Action Groups

Posted on
Thu Oct 03, 2019 9:52 am
Swancoat offline
Posts: 499
Joined: Nov 20, 2009
Location: Houston

Conditions in Action Groups

I feel like I've mentioned this before, but didn't find it with a search, so I'll put it down here again for certainty.

I'd really like to be able to add conditionals like the triggers have, to action groups.

I have some action groups that I like to execute only on a given set of conditions, and maybe have multiple ways of triggering them. It makes sense for me to pile that all in one big action group, and then just build the few triggers to call it, rather than have to build several triggers, all with the same set of conditions.

It's also handy with respect to calling action groups from outside of Indigo. (i.e. using Home Remote to call an action group which I may only want to run conditionally).

It seems right now that the only way to do this is to make an action group, then an other action group which is just a python script that calls the target action group based on some conditions, and then having my external trigger reference that second action group. It's all just kind of inelegant.

http://nerdhome.jimdo.com

Posted on
Thu Oct 03, 2019 1:53 pm
jay (support) offline
Site Admin
User avatar
Posts: 16020
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Conditions in Action Groups

It really depends on how you are executing the action group really - how are you triggering the action group?

And, yes, this is on the request list.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Oct 04, 2019 2:41 pm
Swancoat offline
Posts: 499
Joined: Nov 20, 2009
Location: Houston

Re: Conditions in Action Groups

I'm triggering it from Home Remote (in the instance that brought this to my attention - but it seems to come up fairly often for me).

The current example is I have a shortcut to turn on a bunch of lights in our bedroom and bathroom etc. when I acknowledge the alarm on my iPhone in the morning (triggered via Siri shortcut through Home Remote). But I only want it to trigger if my wife is already up so she doesn't get blasted with light if she's sleeping later than me (she always turns on particular lights when she gets up, so it's readily testable). Maybe I can handle that logic in Home Remote, but with multiple ways of interacting with the HA setup now (Siri, etc..) I really want Indigo doing as much of the actual logic as possible, and then other things like that just touching Indigo for to trigger a group or whatever.

http://nerdhome.jimdo.com

Posted on
Fri Oct 04, 2019 4:33 pm
FlyingDiver offline
Posts: 3930
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Conditions in Action Groups

Seems to me that the easiest solution is to have Home Remote set a variable, and then have Indigo trigger on that variable which would let the conditions work.

Yes, it's a little more complicated because you're adding a variable. And if HR can't do a variable directly, another action group to set that variable.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Oct 04, 2019 5:47 pm
matt (support) offline
Site Admin
User avatar
Posts: 19735
Joined: Jan 27, 2003
Location: Texas

Re: Conditions in Action Groups

FlyingDiver wrote:
Seems to me that the easiest solution is to have Home Remote set a variable, and then have Indigo trigger on that variable which would let the conditions work.

Good idea – that is a trick I also use a few places. Just a simple action that uses the action to increment the variable value by 1, then a trigger on any value change for that variable. It isn't much overhead and the variable can go in an "internal" folder that is hidden from Indigo Touch.

Image

Posted on
Mon Oct 07, 2019 1:53 pm
Swancoat offline
Posts: 499
Joined: Nov 20, 2009
Location: Houston

Re: Conditions in Action Groups

FlyingDiver wrote:
Seems to me that the easiest solution is to have Home Remote set a variable, and then have Indigo trigger on that variable which would let the conditions work.

Yes, it's a little more complicated because you're adding a variable. And if HR can't do a variable directly, another action group to set that variable.


Right, I've thought of that. But then Home Remote doesn't set variables. Soyou can have an action group that sets a variable. But that's turning into another action group to set a variable which sets a trigger which conditionally activates an action group. At that point, I think it'd be simpler to just make an action group that runs a python script that uses the conditional logic to fire the target action group. Still needs two action groups, but at least has one less unnecessary variable. It just feels like having a condition available on the action group is a bit more natural.

Given that triggers can conditionally execute a group of actions, and schedules can conditionally execute groups of actions, it's weird to me that there isn't just a condition available on any action group.

Overall, the problem isn't so much that I can't do this thing. It's that I pretty much need a workaround to do what should be pretty natural (and the reason I think it's natural, is that I've been surprised more than once by the fact that action groups don't have conditions available).

http://nerdhome.jimdo.com

Posted on
Thu Feb 13, 2020 12:44 pm
resnick offline
Posts: 59
Joined: Jan 18, 2015
Location: Urbana, IL

Re: Conditions in Action Groups

Swancoat wrote:
Right, I've thought of that. But then Home Remote doesn't set variables. Soyou can have an action group that sets a variable. But that's turning into another action group to set a variable which sets a trigger which conditionally activates an action group. At that point, I think it'd be simpler to just make an action group that runs a python script that uses the conditional logic to fire the target action group. Still needs two action groups, but at least has one less unnecessary variable. It just feels like having a condition available on the action group is a bit more natural.

Given that triggers can conditionally execute a group of actions, and schedules can conditionally execute groups of actions, it's weird to me that there isn't just a condition available on any action group.

Overall, the problem isn't so much that I can't do this thing. It's that I pretty much need a workaround to do what should be pretty natural (and the reason I think it's natural, is that I've been surprised more than once by the fact that action groups don't have conditions available).


Yep, let me put in my +1 for this feature for exactly the reasons Swancoat talks about. I've got about half a dozen of these sorts of actions, and setting up multiple actions, triggers, and variables for these is a PITA.

Posted on
Thu Feb 13, 2020 2:20 pm
ckeyes888 offline
Posts: 2151
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Conditions in Action Groups

Doesn’t the Super Conditions plugin allow conditions in Actions?

Carl

Posted on
Fri Feb 14, 2020 1:09 pm
resnick offline
Posts: 59
Joined: Jan 18, 2015
Location: Urbana, IL

Re: Conditions in Action Groups

ckeyes888 wrote:
Doesn’t the Super Conditions plugin allow conditions in Actions?


Looks promising. I'll play with it. Not the most obvious UI, but I suppose you have to work with what the plug-in UI gives you. :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest