Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

EventGhost Application Control Plugin

Questions and comments specific to a particular plugin should go here.
phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: EventGhost Application Control Plugin

Post by phlox »

Here we go... EG App Control plugin version 0.2.0 released
(download in the first post)

Change log:

Code: Select all

# 0.2.0    Added action 'EventOnLogEntry': 
#            Fires an event when a monitored log entry occurs
#          Changed displayed plugin name: "EventGhost Application Control" -> "EG App Control"
Sample configuration for the new action 'EventOnLogEntry':
FireEventOnLogEntry settings.png
This might be used as follows:
sample config.png
Let me know if you encounter problems or if it works all right for you.
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: EventGhost Application Control Plugin

Post by blaher »

It works really well, thanks. :) Is there a way to monitor the yellow triangular exclamation point warnings, like the ones you get if you uninstall the win 7 MCE remote service, (or it crashes, of course, that's the practical application)?

Thanks again, this is most beneficial and should be a part of EG by by default.
phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: EventGhost Application Control Plugin

Post by phlox »

blaher wrote:It works really well, thanks. :)
glad to hear, thanks :)
blaher wrote:Is there a way to monitor the yellow triangular exclamation point warnings ...
yep, already implemented in version 0.2.1 - download in the first post
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: EventGhost Application Control Plugin

Post by blaher »

Thank you, that works very well too. :)
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: EventGhost Application Control Plugin

Post by blaher »

For some reason the plugin is not firing an event in the instance I've posted below. Can you see what I've done wrong? It works on some errors, just not all, it seems.

Cheers.
Attachments
Capture.PNG
phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: EventGhost Application Control Plugin

Post by phlox »

Strange... first I thought: unchecking the 'Fire only once' checkbox would solve the problem. But actually I think it won't, because you restart EG after the error occured, therefore the action always catches the first occurence.

Does EG hang after that error? I guess yes, because you want to restart it afterwards. And that could be the problem: If EG is completely in misery, it is maybe not even able to fire your 'Error' event. Maybe you find an earlier symptom to monitor before this plugin causes a crash? And, of course, the best thing would be to fix this plugin...

If you want, you could run 'eventghost.exe -debug' and send me the log file after the next time it happened, maybe I see a bit more in the traces of the log.
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: EventGhost Application Control Plugin

Post by Livin »

phylox,
I thought of a features that would be VERY useful to many here, if you could add it...

Parse the text string from the log and place a portion of it in an EG variable.

current example from Owel on another thread... the log shows a command received, in this case a volume level... HTTP.Volume[u'40']

He wants to extract the "40" and place it into another command to send such as... MVL40

If you plugin provided an easy way to do this and place it in a variable, that would be fantastic. I know a lot of users use/need this functionality and you plugin seems like the proper place for it given it is already doing the log reading and event triggering part.
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: EventGhost Application Control Plugin

Post by phlox »

Yes, I think that should be easy possible. I'm just thinking about how to make it self-explaining and easy to use on one hand and allowing flexibility on the other hand.

I could modify the existing action 'Fire Event On Log Entry'.
- First of all, rename it to 'Log Monitor'
- Leave the upper box "Monitor log message" as is
- Rename the lower box to "Action when found"
- The new GUI could look like this:

Code: Select all

----- Monitor log message -------------------------------
Catch log message ___________________________________
                  [ ] Case sensitive
                  [ ] Whole line

Monitor log messages of type
[x] Error
[x] Warning
[x] Information
[ ] Action
[ ] Macro
[ ] Event

----- Clip the log message ------------------------------
(o) Extract the text between character ___ and ___ (e.g. " and ")
( ) Extract the text between position ___ and ___ (e.g. 27 and 32)
( ) Extract numeric value (e.g. find "40" in "HTTP.Volume[u'40']")
( ) Apply a regular expression ___________________________
( ) Keep the full log message as is

----- Action when found ---------------------------------
[x] Fire an event
    Event name __________________________
               [ ] Fire only once (until next call of this action)
    The clipped log message will be accessible as payload of the event

[x] Set a variable
    Variable name: eg.globals.____________________

[ ] Print the clipped log message

What do you think? Suggestions, ideas? Would someone, who speaks better English than me, correct/improve the labels?
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: EventGhost Application Control Plugin

Post by Livin »

That looks good.

Other very useful parameters are...

"Start search AFTER these characters":__________
-- look for these specific characters, then start searching. In case you don't know where in the string the characters you are looking for will be

"Start searching AFTER character number __ from the left"
-- start the match 5 characters in. In case you know what you are looking for will be at the same location every time

"Grab __ number of Characters AFTER the starting point"
... in case they don't know what characters they are looking for...

Example: If you are trying to pull a specific characters, like "HA" or any given numerals - they could be in the string one of more times... so having a set of characters to look for after , then pulling your search string from the characters after it will help reduce possibility of grabbing the wrong
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: EventGhost Application Control Plugin

Post by blaher »

phlox wrote:Does EG hang after that error?
No, EG is fine. It just stops monitoring my home automation program (Z-Wave Vera), until it is restarted. Your program is really helpful.
If you want, you could run 'eventghost.exe -debug' and send me the log file after the next time it happened, maybe I see a bit more in the traces of the log.
OK, it's running in debug mode now. I can't see a log file, but I'll deal with that when it happens again. :)
phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: EventGhost Application Control Plugin

Post by phlox »

Livin wrote: Other very useful parameters are...
That makes sense. Let's go for it - it's the perfect task for a winter sunday...
phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: EventGhost Application Control Plugin

Post by phlox »

blaher wrote:OK, it's running in debug mode now. I can't see a log file, but I'll deal with that when it happens again. :)
yes, that log file is quite a bit hidden. In Win7, you find it in C:\Users\<Name>\AppData\Roaming\EventGhost\Log.txt
User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: EventGhost Application Control Plugin

Post by Livin »

phlox wrote:
blaher wrote:OK, it's running in debug mode now. I can't see a log file, but I'll deal with that when it happens again. :)
yes, that log file is quite a bit hidden. In Win7, you find it in C:\Users\<Name>\AppData\Roaming\EventGhost\Log.txt
Install a plugin called "Log Redirector" and you can have it write a copy of the log entries anywhere you want. I use it and it is a perfect way to make the log more accessible, and have a duplicate if you need a backup for some reason.

Log Redirector... viewtopic.php?f=9&t=2852
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system
phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: EventGhost Application Control Plugin

Post by phlox »

Livin wrote:Log Redirector... viewtopic.php?f=9&t=2852
That plugin is very handy indeed, I use it all days, but correct me if I'm wrong, I think it's not the same as the '-debug' option of eventghost.exe. Log Redirector writes the Screen Log into a file, while '-debug' creates a debug log file which is saved under AppData\Roaming\EventGhost. I wish strongly that the debug log would also contain the screen log (at least: called macros, actions and events), that would vastly simplify debugging. Maybe Pako is reading as well - what do you think?

Btw, I'm in the middle of implementing the new functionality, but it's always the same, other duties don't allow me big jumps...
phlox
Plugin Developer
Posts: 90
Joined: Wed Jan 11, 2012 3:49 pm

Re: EventGhost Application Control Plugin

Post by phlox »

hi there

here's a first beta of the extended 'Log Monitor' action.

The config screen looks now like this:
grab_data.png
More documentation can be found in the 'Log Monitor' action.

Notes:
  • The action 'Log Monitor' is not backward compatible with the previous version 'EventOnLogEntry' since I refactored it completely. You have to remove calls of 'EventOnLogEntry' and add 'Log Monitor' again.
  • The new version also fixes the bug (found in 0.2.1, reported by blaher) that log monitoring stopped when the application window was minimized.
  • I did not yet implement the proposed 'Start searching AFTER ...' options. Please try with the current implementation if you can achieve what you desire. If not, let me know. But I think with the given modes, especially with the regex mode, you can achieve almost everything.
Any feedback is welcome.

Edit: attachment removed since obsolete.
Last edited by phlox on Mon Jan 21, 2013 8:49 pm, edited 2 times in total.
Post Reply