View unanswered posts | View active topics It is currently Mon May 20, 2013 2:21 am



Reply to topic  [ 4 posts ] 
 Email status alerts 
Author Message

Joined: Jul 10, 2004
Posts: 195
Post Email status alerts
Is there an easy way to create events for when devices cannot be read. For example, my ez-flora broke and was sending messages to the log "2012-06-30 05:35:06 Error "Sprinkler Group #2 - Rock Wall Spray (Pool)" on; send failed (no acknowledgment)". It would be great if I could crate an event to email me a message when a send fail or no response from device message came, and I would want the email message to tag which device failed.

I use Indigo to control my sprinklers during the week at my weekend house and just went a week without water because I was not warned about the failure. Would be great if I could detect early.


Sat Jun 30, 2012 8:52 am
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post Re: Email status alerts
There is a trigger in the SQL Logger plugin (logging doesn't have to be enabled) called "Error in Event Log" that will fire when an error is detected. Select "Plugin" from the trigger type, "SQL Logger from the plugin popup, and "Error in Event Log". If you only want server errors (like the one you specify above) select "Internal Indigo Errors".

While you can't specify which device failed, you can use the following Python script action to send you the last few lines of the event log to you - that should show the device that caused the error:

Code: Select all
contents = indigo.server.getEventLogList(lineCount=NUMBEROFLINESTOEMAIL)
indigo.server.sendEmailTo("ADDRESS", subject="SUBJECT", body=contents)


Substitute your values for the ALL CAPS words. There's an action in the Action Collection plugin to do it without a script but it has a bug and will email all log lines since the last reboot or 1500, whichever is lower, so I suggest using the script above until we get that bug fixed in the next release.

_________________
Jay (Indigo Support)
Image


Sat Jun 30, 2012 9:58 am
Profile WWW

Joined: Jul 10, 2004
Posts: 195
Post Re: Email status alerts
Thanks. This is helpful and I have already integrated the logic. To be more proactive, is there a way I can check all devices proactively and make sure they are all responsive (like maybe a nightly check)?


Sat Jun 30, 2012 2:27 pm
Profile
Site Admin
User avatar

Joined: Mar 19, 2008
Posts: 6642
Location: Austin, Texas
Post Re: Email status alerts
You could force a status request on your devices (that's one of the built-in actions). I personally don't think it's a good idea since status requests are extremely expensive and signal noise is often transient so checking at a specific time isn't very useful. If you do just make sure you have a healthy delay (2-3 seconds) between each status request or those commands will flood the network and you'll end up getting a lot of false positives.

_________________
Jay (Indigo Support)
Image


Sun Jul 01, 2012 6:45 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.   Template designed by STSoftware.