macro programming for safe standby (1 Viewer)

ophth1

Portal Member
January 14, 2007
35
0
45
hi, is it possible to use the MCE replacement plugin to setup a macro, which e.g. stops current TV or video, returns to home screen, and enters standby??
each single step can be controlled by keys on the remote, but how to connect these commands within a macro? Or is there any other option to put mp in a defined standby mode by a push of a single button? thanks!!
 

and-81

Retired Team Member
  • Premium Supporter
  • March 7, 2005
    2,257
    183
    Melbourne
    Home Country
    Australia Australia
    At the moment the plugin doesn't support all the commands that the MediaPortal input handler does. And the MediaPortal input handler doesn't support "macros" by itself.

    I'm going to change the MediaPortal input handler to support multiple actions per input (like a macro), and this should let you do what you want. I will also try to include more macro commands in the plugin.

    The changes to the MediaPortal input handler will be substantial, and need to remain backward compatible, so I will need to be very careful implementing it. I have been meaning to start on this for a couple of weeks now, but I have been too busy with other things. I hope to get something done soon, but I can't say when it will be.

    So basically, you will be able to do what you want, but not yet.

    I'll post back when I have something for you.

    Cheers,
     

    NickName

    MP Donator
  • Premium Supporter
  • June 23, 2006
    359
    12
    Gold Coast
    Home Country
    You should be able to do all of the above with a macro that sends keypresses to MP and runs a program, which in this case could be a VBScript that puts the PC into standby mode.
    Hopefully, I am not talking out of my @#$% but it should be possible(?). I have been think about doing this for myself too as standby doesn't work very well if the TV is still visibly running.

    If you want a hand let me know and I'll see what I can do...

    Cheers,

    Nick Name
     

    NickName

    MP Donator
  • Premium Supporter
  • June 23, 2006
    359
    12
    Gold Coast
    Home Country
    I now have 1 button press to standby my PC.
    The button click displays a "Goodbye" popup message, runs a VB macro (well actually an AutoIT macro, but syntax-wise, nearly the same) that sends MP to the Home screen and turns off Timeshifting, then turns off my TV and surround system. After the Powerscheduler timesout, the PC then enters standby.
    If anyone is interested, I'll happily give the steps and macro required to achieve this.

    Cheers,

    Nick Name.
     

    ophth1

    Portal Member
    January 14, 2007
    35
    0
    45
    macro

    hi, would be great if you could share this macro. I would be really interested... thanks!!
     

    daHive

    Portal Pro
    March 1, 2007
    109
    0
    Home Country
    Austria Austria
    nickname, i´d love to get this macro too, cause whenever i enter standby i have to manually turn tv off and on, otherwise i just get a black screen. i think turning tv off before standby might solve this problem.
     

    NickName

    MP Donator
  • Premium Supporter
  • June 23, 2006
    359
    12
    Gold Coast
    Home Country
    i have to manually turn tv off and on, otherwise i just get a black screen. i think turning tv off before standby might solve this problem.
    Yes, TV must be turned off to enter and resume from standby.
    You'll need AutoIT to run my script. Get it here: http://www.autoitscript.com/
    If you are not using Mediaportal in "English", you'll need to modify the script to suit your language. Just change the first line in the script:

    $HomeScreen = "MediaPortal - Home"

    to suit. For example, in Swedish it (probably) would be:

    $HomeScreen = "MediaPortal - Hem"

    You can get the Home Screen's title by running MP in Window mode and looking at MediaPortal's window's title: I.e. "MediaPortal - Home" (without quotes). You must put the exact title or the script won't be able to find it.
    If you get stuck, just PM me and I'll sort you out.

    Also I use the MCE Replacement Driver to turn off the TV and Surround system and
    do the popup message.
    Ok, the script (and compiled EXE) are attached. If you use English, use the EXE else modify the script and (compile it if wanted). Install AutoIT (to use the script) and you're ready.

    Enjoy,

    Nick Name.
     

    daHive

    Portal Pro
    March 1, 2007
    109
    0
    Home Country
    Austria Austria
    wow, works like a charm! THANK YOU! :)
    so far i´ve only mapped your script to a function key on the sony-keyboard...now i gotta figure out how to get this working correctly with the mce-replacement plugin(let it pause a couple of secs till tv´s turned off?).
     

    NickName

    MP Donator
  • Premium Supporter
  • June 23, 2006
    359
    12
    Gold Coast
    Home Country
    Hi daHive,

    I'm glad it worked for you :)

    FYI.
    With the mce-replacement plugin, I just created a 'macro' on the macro tab which I then assigned to a button on my remote. In the macro I put a popup message to let me know it was shutting down, and then a 'Run Program' command which runs my Script.
    Also in the mce-replacement plugin, I also created an Event on the Event Mapper tab. The Event I used was 'PC_Suspend'. I assigned the IR commands 'learned' from my Amp and TV to turn them off. I let Powerscheduler turn off the PC.
    The way it all works is that I press the button to shutdown and then:
    1) A popup message is displayed (Goodbye),
    2) Mediaportal goes back to the Home screen and Timeshifting is turned off,
    3) Powerscheduler attempts to turn the PC off &
    4) the mce-replacement plugin notices the shutdown and turns off the TV and Amp.
     

    daHive

    Portal Pro
    March 1, 2007
    109
    0
    Home Country
    Austria Austria
    cool, gonna try this as well!

    one last thing i noticed and would like to ask about:
    after the script is run, it takes a couple of seconds until the tv is turned off and mp is back at the homescreen. i noticed that if i press the standby button on the remote too soon, there sometimes are some troubles when i start it up again, like mp can´t connect to the tvserver at first(works after about half a minute and then it starts tv automatically).
    does this happen to you too/how do you avoid it?(i´m thinking of adding a "wait for x seconds" command to the macro so it waits until mp has finished turning the tv off before going to standby...)
     

    Users who are viewing this thread

    Top Bottom