Figuring out which member triggered a virtual dev group

Posted on
Sun Dec 15, 2019 9:35 am
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Figuring out which member triggered a virtual dev group

Hello everyone,

I have defined a virtual device group, containing several movement sensor devices.
Whenever ANY of the sensor devices turns on, the group device is triggered and the intended action group runs. Everything seems to work as designed.
Each individual movement sensor also have action groups assigned to them for individual action to be taken depending on each sensor.
Now I'm willing to clean up the need for code in several different parts of the solution, concentrating all logic inside the group device action group. The problem is, I don't know how to figure out, inside a python script, which member of the group triggered ...
So I thought maybe one of you Python experts could lend a hand and point me in the right direction. Any help will be much appreciated.

Best regards,
Cesar Guimaraes

Posted on
Sun Dec 15, 2019 12:36 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Figuring out which member triggered a virtual dev group

Hi Cesar,

Unfortunately, that information isn't saved or available in the information pipeline when the action executes. You could create individual actions for each sensor that override an Indigo variable value with their ID, then your group device action could look at the variable value to try to determine which sensor caused it to execute. There could be timing issues with that if multiple sensors fire at the same time (overriding the variable value before it is read), but realistically that probably won't be a problem. The only question is if it is worth it to approach it this way when you'll end up still needing the individual triggers for each sensor (might or might not depending on what you are doing).

Note improving the action pipeline to include information about the underlying trigger information is on the request/ToDo list.

Image

Posted on
Sun Dec 15, 2019 12:50 pm
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Re: Figuring out which member triggered a virtual dev group

Thanks Matt for your prompt reply and glad to know it's in the request list.

Enjoy the rest of your Sunday.

Cesar

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 9 guests