Device ID on trigger

Posted on
Mon Aug 19, 2019 2:57 am
joshh385 offline
Posts: 24
Joined: Jan 04, 2019

Device ID on trigger

I'm working on a plugin for an alarm system. It has several device types, one of which is a contact sensor. Those are added to Indigo and I'm getting back status changes that I expect.
I defined an event for the plugin that will fire any time a contact sensor opens. The idea is to replicate the typical alarm panel behavior that will chime when a door/window opens without having to create a trigger for every contact sensor. I have this setup right now to send a Pushover notification and that's working fine, and actually this works fine with a chime too. The thing with the Pushover notification is that it would be nice to know which device triggered the event. Is there a way to pass a little data along to the trigger, maybe device id? Or another way to accomplish this? I might be missing something obvious with firing the event from my plugin.

Posted on
Mon Aug 19, 2019 6:11 am
FlyingDiver offline
User avatar
Posts: 7217
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Device ID on trigger

You can't pass it along with the trigger, but you could create a variable (call it "last_alarm_event") and write to it before you execute the trigger. Then your notification action could use the substitution syntax to include the contents of that variable in the pushover message.

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

Posted on
Mon Aug 19, 2019 10:43 am
joshh385 offline
Posts: 24
Joined: Jan 04, 2019

Re: Device ID on trigger

Makes sense. I was wondering on that though if there might be an issue with with timing if two sensors opened at close to the same time. I suppose that the majority of the time they would be far enough apart that by the time the second sensor triggered the Pushover notification the first one would have already progressed far enough that it would have pulled the value from the variable to populate its notification. I'll run with that - thanks!

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests

cron