eventTrigger [v1.3.5 Beta] (3 Viewers)

mickelin

Portal Pro
September 29, 2006
77
7
Home Country
Sweden Sweden
Re: eventTrigger [v1.2.0 Beta]

I see, then it gets trickier... Do you really need individual light control inside MP? In that case it is probably easiest to buy a second Tellstick and have one in each computer.

On the second topic, my idea assumes that you use a remote to turn on the TV and the projector. If that is the case, EventGhost could detect those events and "know" which one you are using. Are you using a single remote (Harmony or similar?) or an MCE remote together with the original TV and Proj remotes? Try loading the Keyboard or the General HID plugins in EG and see if it detects the TV On and Proj On IR codes from the remote.


The EG code would then look something like this:


Autostart
eg.globals.TVOn = False
eg.globals.ProjOn = False

TVOn Macro
MCERemote.TV On (or whatever the event you get when you push the TV On remote)
eg.globals.TVOn = True
eg.globals.ProjOn = False

ProjOn Macro
MCERemote.Proj On (or whatever the event you get...)
eg.globals.ProjOn = True
eg.globals.TVOn = False

and then when you get MP events from the trigger plugin:

MP Light Control Macro
Main.MP.Movie.Play
If eg.globals.TVOn == True:
Tellstick.TurnOff.1 (TV lights off)
Else:
Tellstick.TurnOff.2 (Projector lights off)


Hope you get the idea.

Similarly, you could implement the Disable function by adding a variable in Autostart, set it using some unused button on your remote and check for it in the MP event:

Autostart
eg.globals.LightControlEnabled = True

Picking up the remote key:

Enable Macro (toggles the enabled/disabled state)
MCEUnusedButtonPressed
If eg.globals.LightControlEnabled == True:
eg.globals.LightControlEnabled = False
Else:
eg.globals.LightControlEnabled = True

And in the MP event:

MP Light Control Macro
Main.MP.Movie.Play
If eg.globals.LightControlEnabled == True:
If eg.globals.TVOn == True:
Tellstick.TurnOff.1 (TV lights off)
Else:
Tellstick.TurnOff.2 (Projector lights off)

Of course this is just "pseudo code" to illustrate the ideas, but hopefully it will guide you in the right direction. For more advanced scripting, check out the EG forum at www.eventghost.net . Lots of really good and helpful people there!

Finally, I saw you using .bat files in your example. You should not need to use bat-files, better to do everything right in EG!

Good luck!
 

gathering

Portal Member
November 27, 2007
15
0
Home Country
Sweden Sweden
Re: eventTrigger [v1.2.0 Beta]

I see, then it gets trickier... Do you really need individual light control inside MP? In that case it is probably easiest to buy a second Tellstick and have one in each computer.

On the second topic, my idea assumes that you use a remote to turn on the TV and the projector. If that is the case, EventGhost could detect those events and "know" which one you are using. Are you using a single remote (Harmony or similar?) or an MCE remote together with the original TV and Proj remotes? Try loading the Keyboard or the General HID plugins in EG and see if it detects the TV On and Proj On IR codes from the remote.


The EG code would then look something like this:


Autostart
eg.globals.TVOn = False
eg.globals.ProjOn = False

TVOn Macro
MCERemote.TV On (or whatever the event you get when you push the TV On remote)
eg.globals.TVOn = True
eg.globals.ProjOn = False

ProjOn Macro
MCERemote.Proj On (or whatever the event you get...)
eg.globals.ProjOn = True
eg.globals.TVOn = False

and then when you get MP events from the trigger plugin:

MP Light Control Macro
Main.MP.Movie.Play
If eg.globals.TVOn == True:
Tellstick.TurnOff.1 (TV lights off)
Else:
Tellstick.TurnOff.2 (Projector lights off)


Hope you get the idea.

Similarly, you could implement the Disable function by adding a variable in Autostart, set it using some unused button on your remote and check for it in the MP event:

Autostart
eg.globals.LightControlEnabled = True

Picking up the remote key:

Enable Macro (toggles the enabled/disabled state)
MCEUnusedButtonPressed
If eg.globals.LightControlEnabled == True:
eg.globals.LightControlEnabled = False
Else:
eg.globals.LightControlEnabled = True

And in the MP event:

MP Light Control Macro
Main.MP.Movie.Play
If eg.globals.LightControlEnabled == True:
If eg.globals.TVOn == True:
Tellstick.TurnOff.1 (TV lights off)
Else:
Tellstick.TurnOff.2 (Projector lights off)

Of course this is just "pseudo code" to illustrate the ideas, but hopefully it will guide you in the right direction. For more advanced scripting, check out the EG forum at EventGhost . Lots of really good and helpful people there!

Finally, I saw you using .bat files in your example. You should not need to use bat-files, better to do everything right in EG!

Good luck!

probably I don't need individual light control inside MP but it would be a really cool thing. :)

I use a Harmony remote and I will try the General HID plugins in EG and see if it detects my TV On and Proj On code.
thanks for that. very clever solution :D I really appreciate all the help. Many thanks. :D

// Martin
 

moryoav

Portal Pro
December 2, 2008
236
86
Home Country
Israel Israel
Re: eventTrigger [v1.2.0 Beta]

I think the beauty of this plugin is its simplicity: just detecting what's happening in MP and letting EventGhost/Girder know about it. All logic should be in EventGhost/Girder, not in the plugin.

You can also do the SwitchKing integration in EventGhost very easily. Just let EventGhost write to a file (using the EG File Operations plugin) that SwitchKing monitors as a "Datakälla". In fact, that is another way to handle the proj/tv issue; by having different groups and scenarios in SwithKing and trigger the right one from EventGhost depending on if proj or TV is on.

Micke is absolutely right, this is exactly my vision - EventGhost as the center or the hub of my smart home with this plugin here just to assist EventGhost (or Girder, for that matter).
EventGhost is such an extensive program, the only two problems are:
1) It's not that simple to use, there's a learning curve to using it. I'm going to prepare many scripts for all kinds of scenarios for that.
2) There are a few things that EventGhost doesn't do very well - like an onscreen menu. I'm going to write new plugins for EventGhost for that (then I could have an onscreen menu that'll be visible inside and outside MediaPortal, with no connection to it).
 

mickelin

Portal Pro
September 29, 2006
77
7
Home Country
Sweden Sweden
Re: eventTrigger [v1.2.0 Beta]

Great, stick to your vision!

Have you checked out Pako's OSM plugin?

/Micke
 

vuego

Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,644
    764
    Göteborg
    Home Country
    Sweden Sweden
    Re: eventTrigger [v1.2.0 Beta]

    that was just my suggestion to the user neorules who seems to be the only user who get two instances of EventGhost. It is my belief that it happens for him because he has two different installations of eventghost. Are you having the same problem as well?

    Yes, if I start MediaPortal Configuration/Plugins when EventGhost is already running I get one more EventGhost window opened + a third EventGhost.exe process launched.

    If I let MediaPortal Configuration/Plugins launch EventGhost I get just one EventGhost Window but after starting MediaPortal I get one more + two more EventGhost.exe processes (now four running).

    I'm using:
    eventTrigger v1.2
    MediaPortal v1.2 Alpha
    EventGhost v0.3.7.r1494
    Windows 7 x64

    There's only one EventGhost installed in C:\Program Files (x86)\EventGhost
     

    Attachments

    • eventtrigger.png
      eventtrigger.png
      163.2 KB

    moryoav

    Portal Pro
    December 2, 2008
    236
    86
    Home Country
    Israel Israel
    Re: eventTrigger [v1.2.0 Beta]

    Great, stick to your vision!

    Have you checked out Pako's OSM plugin?

    /Micke

    Pako's OSM plugin is now part of the regular distribution of EventGhost, and it's not exactly what I've been looking for. My plugin will have more graphical options instead of the ordinary list options.

    that was just my suggestion to the user neorules who seems to be the only user who get two instances of EventGhost. It is my belief that it happens for him because he has two different installations of eventghost. Are you having the same problem as well?

    Yes, if I start MediaPortal Configuration/Plugins when EventGhost is already running I get one more EventGhost window opened + a third EventGhost.exe process launched.

    If I let MediaPortal Configuration/Plugins launch EventGhost I get just one EventGhost Window but after starting MediaPortal I get one more + two more EventGhost.exe processes (now four running).

    I'm using:
    eventTrigger v1.2
    MediaPortal v1.2 Alpha
    EventGhost v0.3.7.r1494
    Windows 7 x64

    There's only one EventGhost installed in C:\Program Files (x86)\EventGhost

    Thank you Vuego, when two people report an issue it's definitely a bug...
    I'm quite sure I know where to look. I'll have a possible fix in the next version (today or tomorrow).
     

    neorules

    Portal Member
    August 27, 2008
    32
    0
    Home Country
    Sweden Sweden
    Re: eventTrigger [v1.2.0 Beta]

    that was just my suggestion to the user neorules who seems to be the only user who get two instances of EventGhost. It is my belief that it happens for him because he has two different installations of eventghost. Are you having the same problem as well?

    Yes, if I start MediaPortal Configuration/Plugins when EventGhost is already running I get one more EventGhost window opened + a third EventGhost.exe process launched.

    If I let MediaPortal Configuration/Plugins launch EventGhost I get just one EventGhost Window but after starting MediaPortal I get one more + two more EventGhost.exe processes (now four running).

    I'm using:
    eventTrigger v1.2
    MediaPortal v1.2 Alpha
    EventGhost v0.3.7.r1494
    Windows 7 x64

    There's only one EventGhost installed in C:\Program Files (x86)\EventGhost

    how lucky
    I thought it was me who was going crazy
    but now I can see that there are more people who have the same problem
     

    moryoav

    Portal Pro
    December 2, 2008
    236
    86
    Home Country
    Israel Israel
    Re: eventTrigger [v1.2.0 Beta]

    that was just my suggestion to the user neorules who seems to be the only user who get two instances of EventGhost. It is my belief that it happens for him because he has two different installations of eventghost. Are you having the same problem as well?

    Yes, if I start MediaPortal Configuration/Plugins when EventGhost is already running I get one more EventGhost window opened + a third EventGhost.exe process launched.

    If I let MediaPortal Configuration/Plugins launch EventGhost I get just one EventGhost Window but after starting MediaPortal I get one more + two more EventGhost.exe processes (now four running).

    I'm using:
    eventTrigger v1.2
    MediaPortal v1.2 Alpha
    EventGhost v0.3.7.r1494
    Windows 7 x64

    There's only one EventGhost installed in C:\Program Files (x86)\EventGhost

    That's a difficult one... I have attached a new version to this post, please try it out and let me know if it works now. Just for the record, my system is identical to yours - Win7, 64bit, same version of EventGhost... and I don't have that problem...
    I hope it's fixed now, if not - I'll do some more research...
     

    Attachments

    • eventTrigger.mpe1
      10.2 KB

    neorules

    Portal Member
    August 27, 2008
    32
    0
    Home Country
    Sweden Sweden
    Re: eventTrigger [v1.2.0 Beta]

    that was just my suggestion to the user neorules who seems to be the only user who get two instances of EventGhost. It is my belief that it happens for him because he has two different installations of eventghost. Are you having the same problem as well?

    Yes, if I start MediaPortal Configuration/Plugins when EventGhost is already running I get one more EventGhost window opened + a third EventGhost.exe process launched.

    If I let MediaPortal Configuration/Plugins launch EventGhost I get just one EventGhost Window but after starting MediaPortal I get one more + two more EventGhost.exe processes (now four running).

    I'm using:
    eventTrigger v1.2
    MediaPortal v1.2 Alpha
    EventGhost v0.3.7.r1494
    Windows 7 x64

    There's only one EventGhost installed in C:\Program Files (x86)\EventGhost

    That's a difficult one... I have attached a new version to this post, please try it out and let me know if it works now. Just for the record, my system is identical to yours - Win7, 64bit, same version of EventGhost... and I don't have that problem...
    I hope it's fixed now, if not - I'll do some more research...

    it got better but now it happens just when I start MediaPortal Configuration / Plugins
    so you are in the right way
     

    Users who are viewing this thread

    Top Bottom