[ANSWERED]e-mail notification trigger

Posted on
Sat Aug 31, 2013 12:11 pm
Monstergerm offline
Posts: 274
Joined: Sep 01, 2009

[ANSWERED]e-mail notification trigger

I have setup Indigo to send me an email any time there is an Indigo event error. Trigger type is "SQL logger event". Event is "Error in Event Log". Action "Send email notification".

Now the other day my Internet was down creating such an error. Apparently the software tries to resend the email every 10 min. Since the internet was still down 10 min later, this in turn caused another Indigo event error. So my error messages suddenly increased exponentially by a factor of two every ten minutes.

By the time the internet was up and running I got hundreds of emails. How can I avoid this?

Posted on
Sat Aug 31, 2013 3:09 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: e-mail notification trigger

I'd recommend incrementing a variable when the event fires along with sending the email. Then put a condition on the trigger so that it doesn't fire when the variable goes above some threshold.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Sep 20, 2013 6:41 am
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: e-mail notification trigger

Monstergerm wrote:
I have setup Indigo to send me an email any time there is an Indigo event error. Trigger type is "SQL logger event". Event is "Error in Event Log". Action "Send email notification".


Is this a script? Do you mind sharing?

Posted on
Fri Sep 20, 2013 9:08 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: e-mail notification trigger

No need for a script - use the Error in Event Log trigger event in the SQL Logger plugin to watch for an error in the event log. Then just use the built-in send email action.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Sep 20, 2013 10:49 am
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: e-mail notification trigger

jay (support) wrote:
No need for a script - use the Error in Event Log trigger event in the SQL Logger plugin to watch for an error in the event log. Then just use the built-in send email action.


I guess it would help me to have the SQL Logger plugin enabled :) Thanks!

Posted on
Fri Sep 20, 2013 11:01 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: e-mail notification trigger

Note that you don't have to actually turn on the SQL logging to get the event - you just need the plugin enabled.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Sep 21, 2013 9:28 am
Seeker offline
Posts: 440
Joined: Aug 05, 2013

Re: e-mail notification trigger

This is very powerful. The hoops I had to go through on vera to get something much less useful. This is great, just gotta get my email set up.

Posted on
Tue Sep 24, 2013 12:40 pm
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: e-mail notification trigger

I realize I could probably do this myself by stripping out the exact situations in the log, but I think it would be a nice safeguard for someone to see when a indigo touch or browser client has logged on (maybe just remotely, maybe locally too) to indigo or if there were failures to login due to an incorrect password. So I guess feature request?

Posted on
Tue Sep 24, 2013 1:58 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: e-mail notification trigger

Dewster35 wrote:
... I think it would be a nice safeguard for someone to see when a indigo touch or browser client has logged on (maybe just remotely, maybe locally too) to indigo or if there were failures to login due to an incorrect password. So I guess feature request?


Agreed -- we'll get it added to the feature request list.

Image

Posted on
Fri Nov 01, 2013 5:00 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: e-mail notification trigger

I'd like to restart iRed2 when this appears in the error log:

Error script error: iRed2 got an error: The action could not be performed from module 'iTach' (13)

I assume I copy and paste all or part of that into the "Specific Type" text field when making the trigger?
Have tried a couple variations but nothing has worked as yet.

Thanks,

Carl

Posted on
Fri Nov 01, 2013 5:10 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: e-mail notification trigger

I can't really tell - you need to copy the entire line from the Event Log window and then paste it in between Code tags (use the Code button above the post text area to insert the right markup).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Nov 01, 2013 5:15 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: e-mail notification trigger

Sorry, here it is.

Code: Select all
Error                           script error: iRed2 got an error: The action could not be performed from module 'iTach' (13)


Thanks,

Carl

Posted on
Fri Nov 01, 2013 6:05 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: e-mail notification trigger

Unfortunately, the author of your script didn't specify a unique type so the only thing you can trigger off of is just an error.

If you edit the script, you can specify a type in AppleScript like this:

Code: Select all
log "Some error message" using type "My Script"


Then you'd use "My Script" as the Specific Type in the error trigger.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Nov 01, 2013 8:03 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: e-mail notification trigger

Sorry, I don't understand the actual usage.

This is the attachment I use:

Code: Select all
using terms from application "IndigoServer"
   
   on RemoteControl(TheRemote, TheDevice, irCode)
      with timeout of 3 seconds
         try
            tell application "iRed2" to perform action Code irCode of Device TheDevice of Remote TheRemote using led "external"
         on error
            tell application "IndigoServer"
               log "Error - Could not transmit to iRed2 --> Device: " & TheDevice & ", code: " & irCode using type "iRed:"
            end tell
            
         end try
      end timeout
   end RemoteControl
   
end using terms from


So maybe change the log to something like this?

Code: Select all
on error
    tell application "IndigoServer"
    log "Unable to communicate with iRed2" using type "My Script"


Then in the "Specific Type" field "My Script"?

Thanks,

Carl

Posted on
Sat Nov 02, 2013 10:13 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: e-mail notification trigger

Carl - the error you posted above doesn't match the script you're showing. Notice the wording on the log line in the script is not the same as the wording in the error you posted. An error from that script's log line would look something like this:

Code: Select all
iRed:                           Error - Could not transmit iRed 2 --> Device: Some Device, code: some code


If that were the error, then you could use "iRed:" as the specific type. I can't see where the error you posted above is coming from but it's not that script.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Who is online

Users browsing this forum: No registered users and 16 guests