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.

How do I use the timer plugin?

If you have a question or need help, this is the place to be.
Post Reply
BBCritical
Posts: 2
Joined: Tue Oct 23, 2007 12:46 pm

How do I use the timer plugin?

Post by BBCritical »

How can i set the timer to run a command line every 2 minutes starting at 9pm - 6am Monday thru Friday, and not run at all Friday night and Saturday?
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: How do I use the timer plugin?

Post by CollinR »

Ewww you added some complexity with the weekend stuff.

I'll repost what I gave you on the SageTV board so Bitmonster and Bartman can see.

Link to SageTV Forum thread.
Me @ SageTV.com Forums wrote: This should work for you, it should be put in your startup folder.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
    <Action>
        Timer.TimerAction(u'MVP-Night-Limit', 0, 204, 300.0, u'LimitMVP-Night', True, True, 2, u'21:00:00')
    </Action>
</EventGhost>
Your Event will be Timer.LimitMVP-Night, it should go in a globally accessible folder. (cannot be disabled in EG)

Your Event Code should look like:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
    <Macro Name="Limit MVP Night Use">
        <Event Name="Timer.LimitMVP-Night">
        </Event>
        <Action>
            System.Execute(u'C:\\AutomationApps\\GnuWin32\\bin\\wget.exe', u'http://USER:PASS@ADDRESS/sage/SageCommand?context=MVP-MACa&command=Power', 3, False, 2, u'')
        </Action>
    </Macro>
</EventGhost>
Obviously you will need to add a seperate action for each MVP MAC you wish to limit.

What this ~should~ do is fire the event every 5 minutes starting at 9pm for 204 cycles ending at 2pm the following day.

After you add this code you will need to restart EventGhost, or manually execute the timer in the startup group. Otherwise the timer will not start until EG is restarted (process startup group).
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: How do I use the timer plugin?

Post by CollinR »

You might also try using the EG comand line interface and the windows scheduler.

Then you can move the timer from your startup group to your globals and have the scheduler generate events like MPV-Limit-Weekday. The Windows scheduler supports "weekdays" but not "weekends" :roll: luckily you seem to only want a weekday limit.

eventghost.exe -e LimitMVP-Night

Events generated from the command line IIRC come through as Main.xxx, have that start the timer to cycle commands only on weekdays.

So it may look like Main.LimitMVP-Night in the event log.

EDIT: Crap! Friday is a weekday. :(
BBCritical
Posts: 2
Joined: Tue Oct 23, 2007 12:46 pm

Re: How do I use the timer plugin?

Post by BBCritical »

Umm.. where do I put the xml scripts that you posted (literally)... I only see the ability to set up things through the GUI....
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: How do I use the timer plugin?

Post by CollinR »

Just copy/paste it, you should probably modify the user, password, MAC and server IP before you paste the macro into EventGhost.
Post Reply