HTPCInfo plugin v1.15.0 for MediaPortal 1.3.0 and higher (8 Viewers)

joz

Portal Pro
March 17, 2008
1,353
306
Home Country
Netherlands Netherlands
Re: HTPCInfo plugin for MediaPortal v1.0.7

Would it be possible to run external program/batch when MP goes into hibernate/shutdown to send commands to turn off my NAS? Thinking on a batch with telnet/ssh commands.

This can be done by poweroff, that's what I use to have some shortcuts and stuff to power on (WOL) and power off (windows poweroff service on nas and client on htpc etc).
For example I have done some eventghost scripting to power on my nass for onebuttonmusic functionality to not choke up completely (if nas is off and play is pressed you get popups saying it can't reach the nas)
If you want I can share some scripts
 

1stdead

Portal Pro
February 1, 2008
1,089
139
Copenhagen
Home Country
Denmark Denmark
Re: HTPCInfo plugin for MediaPortal v1.0.7

Would it be possible to run external program/batch when MP goes into hibernate/shutdown to send commands to turn off my NAS? Thinking on a batch with telnet/ssh commands.

This can be done by poweroff, that's what I use to have some shortcuts and stuff to power on (WOL) and power off (windows poweroff service on nas and client on htpc etc).
For example I have done some eventghost scripting to power on my nass for onebuttonmusic functionality to not choke up completely (if nas is off and play is pressed you get popups saying it can't reach the nas)
If you want I can share some scripts

Please do, i'm very interessted! I'm searching all options right now..

Best i found for now is:
script for standy/hibernation:
Run Batch/Program After Waking from Standby - Windows-XP-General-Discussion - Windows-XP
Win32_PowerManagementEvent Class (Windows)

and then make a simple script for logoff and logon...

The feature you mention sounds great. Perhaps you can make a topic with it:D
 

joz

Portal Pro
March 17, 2008
1,353
306
Home Country
Netherlands Netherlands
Re: HTPCInfo plugin for MediaPortal v1.0.7

Hi again Micropolis,
I'm planning to buy a NAS and need to know a bit about how: Wake On LAN for computers inside to your local network. works.

Currently i restart MP on startup(due to hibernate weird screen issue), will it send multiple times? Does it matter?

Would it be possible to run external program/batch when MP goes into hibernate/shutdown to send commands to turn off my NAS? Thinking on a batch with telnet/ssh commands.

For the first question; firing dozens of magic packets (WOL packets) does not mather, a PC is either on or off (well not really with all these diff. S states). Send a magic packet it goes on (if configured right). Send another one and it'll still be on, and no more, or less, on then on :)

Regarding the second one is a bit tricky cause the trigger being standby. I think if you use MP for handling sleep then a plugin solution will be best, otherwise there are solutions to think of with task scheduler or some sort of regular polling for some sort of activity.
Not enough into windows programming to come up with anything better then that but there's probably a nicer solution.
Can't help with the MP plugin part (but I bet micropolis could) but that would be a nice solution.

In my usage scenario I turn the NAS on from within MP with a multishortcut button or using onebuttonmusic on basichome. The last one I scripted so that it plays a dingdong sound when it detects the nas is off, fires a packet and waits till nas reachable + 5 seconds for shares to become alive and then simulates a "p" press (actually all "play" presses are handled this way so will also work from say my tv-series).
My NAS will power itself off after 5 minutes of no activity, so for me it's just a mather of getting it to power on. But just in case I do have a shortcut to power it off with poweroff. Can be setup as a service, remote functionality for restart, poweroff etc and decent commandline support to be run with shortcuts or batches.
 

Micropolis

Portal Pro
July 22, 2009
1,588
1,796
Bavaria
Home Country
Germany Germany
Re: HTPCInfo plugin for MediaPortal v1.0.7

Hi joz, hi 1stdead,
yes sure, I can create a solution for the described feature "pre-/post-commands after standby/hibernate".
Please understand, that this will not be included into the HTPCInfo plugin, please take a look to PowerControl, in my opinion this a better place. Let's discuss further steps after I'm back.

Cheers, Micropolis ;-)
 

joz

Portal Pro
March 17, 2008
1,353
306
Home Country
Netherlands Netherlands
Re: HTPCInfo plugin for MediaPortal v1.0.7

Sure,

However the big part (the whole play button handling) is scripted in Eventghost, not really like normal scripting goes but dragged and dropped some stuff (that's how Eventghost works, really powerful), I can share my eventghost xml config file if you'd like (@ work still atm).

What I can dig up for you atm is poweroff commands;
Poweroff NAS On said:
"C:\Program Files\MediaPortal\PowerOff\poweroff.exe" wol -ip 192.168.xxx.xxx -subnet 255.255.255.0 -mac SOMEMACHERE
Poweroff NAS Off said:
"C:\Program Files\MediaPortal\PowerOff\poweroff.exe" standby -remote 192.168.xxx.xxx -password SOMEPASS -username SOMEUSER

The last one will only work if you have poweroff running on the NAS (as a service or just the default client GUI is running), you have configured it for remote access (set a pass etc.). You can even change ports, did not need that but you can look that up in poweroff help.

Now for the Eventghost part I can describe how I did things;
- Both: Setup eventghost on both sides (client + server)
- Both: Add the plugins;
* network event receiver
* network event sender
- HTPC: Capture the play button (for me MCERemote.play event)
- HTPC: Create a macro with that event (reffered to as IsNasOn)
- HTPC: after the event add a network event sender with a variable (I named mine isNasOn)
- HTPC: add 2 "jump" commands, the first one to be triggered on success and jumping to some macro which will emulate the "p" press, The second on fail and jump to a macro which will send a WOL packet.
- HTPC: For the WOL macro you just add the eventghost WOL command, and add a always jump to IsNasOn macro (to recheck if the NAS is on already, you can add a sleep in between to not have too heavy load)
- NAS: Create a macro with the isNasOn event trigger on the server side and send back some value. Which ofcourse will not be send when the NAS is off, so that explains the 2 jump commands (the failure will be triggered within I think 2 sec, so no long waiting. If it receives something from server the success will be triggered instantly so that also introduces a small lag (under a second, need a roundtrip to the server in order to determine server state))

Quite a lot, took a while to get right but works pretty solid for me (I left non essential stuff such as sounds out for simplicities sake). If you are really interested in this solution PM me and I'll send you an anonimized version of my eventghost xml definitions
 

chefkoch

Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    AW: Re: HTPCInfo plugin for MediaPortal v1.0.7

    Hi micropolis,

    where i can found the source of your plugins?

    greets
    commander
    I also requested the source. Please be patient, micropolis is currently on a business trip. He will make it available for us when he is back.

    cheers
    chefkoch
     

    joz

    Portal Pro
    March 17, 2008
    1,353
    306
    Home Country
    Netherlands Netherlands
    Re: HTPCInfo plugin for MediaPortal v1.0.7

    Updated my streamedmp skin files for htpcinfo, changes;

    - The toggle sections button is now invisible and triggered when pressing ok when not in the hidden side menu
    - No more using of groups which makes white text white instead of 50% opaque white

    --- EDIT ---

    Also updated my streamedmp basichome overlay
     

    Attachments

    • streamedmp.zip
      1.5 MB

    Users who are viewing this thread

    Top Bottom