Retreiving the device ID that triggered an Action

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Mon May 14, 2012 10:57 pm
LouisDemers offline
Posts: 3
Joined: May 14, 2012

Retreiving the device ID that triggered an Action

Hi, excuse the newbie question if this is obvious, but could not find any working solution so far (first script)

Objective: catch any device that is broadcasting 'battery low".

Approach: Setup a trigger with the "from" popup set to anydevice and button/group set to 2. This way I get the a trigger for any battery operated device I add. then I want to write a python script that sends an e-mail with the name of the actual device that triggered this action.

Problem: I tested a script,

Code: Select all
emailAddress = "my email address"
emailSubject = "Battery Low, python script version"
emailBody  = "triggered at " + str( indigo.server.getTime() ) + "\n"
emailBody += str(indigo.triggers[1288696085]) + "\n"
emailBody += str(indigo.triggers[1288696085].globalProps)
indigo.server.sendEmailTo(emailAddress, subject=emailSubject, body=emailBody)


but I can't figure out how to retrieve the device object that is responsible for the trigger. I printed the info about the trigger but it never changes, no matter what device triggers it.

Hopefully, I missed something simple. If not this should be a feature request...

Thanks in advance.

Posted on
Tue May 15, 2012 8:31 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Retreiving the device ID that triggered an Action

A couple of problems:

  1. Group 2 is for TriggerLincs but group 3 is for Motion Sensors.
  2. Indigo doesn't pass information to the action about how the action was triggered because there are a bunch of different ways that can happen. The best choice is to just have individual triggers for each battery-powered device - some amount of setup but once it's done maintenance is quite low. You can create a shared script if you want to have a single python method that you call from multiple places.

Passing triggering information to script actions is already on the request list.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue May 15, 2012 9:41 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Retreiving the device ID that triggered an Action

jay (support) wrote:
  1. Group 2 is for TriggerLincs but group 3 is for Motion Sensors.


But group 2 for the TriggerLincs doesn't indicate battery low, right? Group 2 is used only in "multi-scene mode" on the TriggerLincs I think.

Posted on
Tue May 15, 2012 9:58 am
jay (support) offline
Site Admin
User avatar
Posts: 18260
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Retreiving the device ID that triggered an Action

Just checked with Matt (much more up on INSTEON than me) and no, the TL doesn't support low-battery warnings apparently (hur dur). I have no clue what multi-scene mode is either.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue May 15, 2012 8:23 pm
LouisDemers offline
Posts: 3
Joined: May 14, 2012

Re: Retreiving the device ID that triggered an Action

jay (support) wrote:
A couple of problems:
[list=1][*]Group 2 is for TriggerLincs but group 3 is for Motion Sensors.


You are right, I tried to find back where I got this info but only found documentation supporting your point.

I'll go for the brute force approach and create individual triggers...

jay (support) wrote:
Passing triggering information to script actions is already on the request list.


Appreciated. Love my system nonetheless. Thanks for the quick response.

Posted on
Tue May 15, 2012 8:27 pm
LouisDemers offline
Posts: 3
Joined: May 14, 2012

Re: Retreiving the device ID that triggered an Action

nsheldon wrote:
jay (support) wrote:
  1. Group 2 is for TriggerLincs but group 3 is for Motion Sensors.


But group 2 for the TriggerLincs doesn't indicate battery low, right? Group 2 is used only in "multi-scene mode" on the TriggerLincs I think.


Found out that through jumpers, the behaviour is configured as

Jumper Installed: Open = Group 1 On, Closed = Group 1 Off;
Jumper Uninstalled: Open = Group 1 On (or off), Closed = Group 2 On (or Off)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron