[Answered] Which device triggered the group?

Posted on
Mon Oct 05, 2015 8:01 am
CraftGeek offline
User avatar
Posts: 107
Joined: May 13, 2015

[Answered] Which device triggered the group?

Hi,

I have a device group that includes all leak detectors. Any one of them can turn the group value to On. This is a trigger for an action group that sends many emails using the Better Email plugin. Some of the emails go to cell phone texting services that only display the first few lines of the email so I can't simply list all leak sensor states in the email. I want to include the name of the triggering sensor in the alert emails. Better Email can show variable and device states in the subject and body text.

What I need help with is...

How do I set a variable with the name of the sensor that is detecting the leak?

I know I can create a list of triggers, one for each sensor, that will set a variable to a value. I want to avoid this approach if possible.
Last edited by CraftGeek on Mon Oct 05, 2015 3:14 pm, edited 2 times in total.

Sean

Posted on
Mon Oct 05, 2015 9:50 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Which device triggered the group?

Currently there is no information passed from the triggering event to any actions.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 05, 2015 9:54 am
CraftGeek offline
User avatar
Posts: 107
Joined: May 13, 2015

Re: Which device triggered the group?

jay (support) wrote:
Currently there is no information passed from the triggering event to any actions.

Is there a value or property of a device group that tracks the member device that caused the group to change state?

Sean

Posted on
Mon Oct 05, 2015 9:55 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: [ANSWERED]Which device triggered the group?

I know I can create a list of triggers, one for each sensor, that will set a variable to a value. I want to avoid this approach if possible.

Your best bet might be a short Python script executed as part of the trigger -- simply check each sensor you want to include to see if it has been tripped and update the variable when found; of course you could have more than one tripped and may want to account for that.

Adam

Posted on
Mon Oct 05, 2015 10:37 am
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Which device triggered the group?

CraftGeek wrote:
jay (support) wrote:
Currently there is no information passed from the triggering event to any actions.

Is there a value or property of a device group that tracks the member device that caused the group to change state?

No, not currently. Definitely on the wish list though.

Image

Posted on
Mon Oct 05, 2015 10:44 am
CraftGeek offline
User avatar
Posts: 107
Joined: May 13, 2015

Re: Which device triggered the group?

So, I can learn Python scripting and implement Adam's suggestion or create a separate trigger for each of my leak detectors which sets the value of a variable to the name of the triggering sensor?

If I know no scripting languages, are there other options?

Sean

Posted on
Mon Oct 05, 2015 11:07 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Which device triggered the group?

I believe those are the only two options at the moment.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Oct 05, 2015 12:41 pm
CraftGeek offline
User avatar
Posts: 107
Joined: May 13, 2015

Re: Which device triggered the group?

OK, I created a variable called LastActiveSensor. I then created a trigger for each of my 25 window, door and leak detectors. Each of these triggers puts the descriptive name of the triggering sensor into LastActiveSensor.

Now, if the water leak or intrusion alarm sends notification to our email and phones, it will include the name of the sensor that tripped the alarm because I will include %%v: 957581619%% in the text of the notification. Yeah, I stumbled over the syntax. 957581619 is the ID of LastActiveSensor in my system.

Sean

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest