If this is your first visit, be sure to check out the FAQ. You must register before you can post. Your first post will be checked for appropriate content
(SPAM) - please allow a bit of time for that. After that, you'll be able to post at will!
Announcement
Collapse
No announcement yet.
Daily email including all errors in the log over the past 24 hrs
FYI, my script does look through the entire log line when searching, log type and log text included.
You are of course correct. Serves me right for making assumptions based on my own stumblings without looking properly at your script😳. As I say, my approach is a bit different.
mrceolla
I hope you don't mind but I was prompted(inspired) by your idea to build something similar into my free SDJ-Health pi. I go about it a bit differently because everything is grouped around Interfaces (plug-ins) in the General Devices section of SDJ-Health. One other thing I do slightly differently, which you may want to consider in your script, is that I run matches on the LogType as well as the LogText. The reason being that some plug-ins tend to add words to their name in the LogType. For example the Z-Wave pi uses LogTypes 'Z-Wave', Z-Wave Warning' and 'Z-Wave Error'.
The update is almost complete and will be in the next SDJ-Health beta.
Steve
I certainly don't mind. Seems like the idea fits into the "health" category. I don't quite understand exactly how this would work in your plugin in regards to adding things to look for, and what things to ignore, but I'm sure you'll figure out something people will like.
FYI, my script does look through the entire log line when searching, log type and log text included.
I created my own little script to do this. In case anyone else is interested, I pasted it below. I setup an event to run this about every 24 hrs. You can pass in the number of hours you want to look backwards, otherwise it defaults to 25 hours. You can specify an array of words to look for within the log entries.
mrceolla
I hope you don't mind but I was prompted(inspired) by your idea to build something similar into my free SDJ-Health pi. I go about it a bit differently because everything is grouped around Interfaces (plug-ins) in the General Devices section of SDJ-Health. One other thing I do slightly differently, which you may want to consider in your script, is that I run matches on the LogType as well as the LogText. The reason being that some plug-ins tend to add words to their name in the LogType. For example the Z-Wave pi uses LogTypes 'Z-Wave', Z-Wave Warning' and 'Z-Wave Error'.
The update is almost complete and will be in the next SDJ-Health beta.
Yes. The easiest way to accomplish what I think you're asking is to make a copy of the script, and edit it as you wish for your Daily News purposes. The script searches through the entire log line for a match, so it'll pick up your LogType of "Daily News". Does that answer your question?
mrceolla
i have a question for you
i use this command a lot to write to the log &nhs.WriteLog ("Daily News", ("Motion Has Been Detected In Backyard"))
Daily News
is it possible to run the script manually and have it just email me my (Daily News)
and then a copy of the script to email me with any problems.
Did your alter the script? The error sounds like you have "Dim subject" in there twice. Note the lines with a single quote in front are comments and not executed.
any chance of updating your script to work with hs4 ?
current errors
Compiling script EmailErrLogEntries.vb: Local variable 'subject' is already declared in the current block.
9/30/2020 9:41:13 AM
HomeSeer Error Compiling script EmailErrLogEntries.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Thanks for this useful script, just installed.
Works fine on HS3/Win10
I know you mentioned above that it has to be commented out for most people but would you mind providing details on this part of the script and it's original purpose?
' Send message via script
' Dim subject As String = "HS Log Alerts - Reminder"
' Dim sendTo As String = "$$DSR:359:"
' hs.RunScriptFunc("SendEmail.vb", "Main", sendTo & "|" & subject & "|" & errList, True, False)
Yeah, sorry about that. I should've just left that out to avoid confusion. I store all of my email addresses and other recipient information in virtual devices so if something changes I only need to change it in one place. And I send all of my messaging (email, text, Pushover) through a custom script, bypassing HS's built in email abilities, for a number of reasons, some of which don't apply anymore, and other's that are likely unique to me. For example, I used to run my own email server, but it had no failover if something crashed or I was simply rebooting it, so messages sent during that time would never be received since HS apparently has no retry mechanism. My script would make sure my email server was online and the message was successfully sent, if not, it would send through a different email account on a different server. Another example, Pushover allows you to specify a sound when sending a message. With my script I can check the message subject line and/or body for certain words and automatically specify a specific sound for that message. Similarly, based on body or subject content, I can decide which method I want to use to send the message (email, text, Pushover). This has saved me from having to create a lot of Pushover events.
Thanks for this useful script, just installed.
Works fine on HS3/Win10
I know you mentioned above that it has to be commented out for most people but would you mind providing details on this part of the script and it's original purpose?
' Send message via script
' Dim subject As String = "HS Log Alerts - Reminder"
' Dim sendTo As String = "$$DSR:359:"
' hs.RunScriptFunc("SendEmail.vb", "Main", sendTo & "|" & subject & "|" & errList, True, False)
Leave a comment: