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.