Page 1 of 5

Timer

Posted: Mon Oct 29, 2007 2:09 pm
by Bartman
This is a topic for questions concerning the Timer plugin.

Re: Timer Plugin

Posted: Mon Nov 05, 2007 8:37 pm
by CollinR
Bartman maybe you could post some examples of how you have used it, I know it can be used for long running daily events as well as short term remote control toggles.

Re: Timer Plugin

Posted: Fri Nov 09, 2007 11:27 am
by Bartman
I just use it as an egg timer and i had a macro as a sleep tmer for shutting down the computer.

Re: Timer Plugin

Posted: Fri Nov 09, 2007 11:29 am
by Bitmonster
Bartman wrote:I just use it as an egg timer and i had a macro as a sleep tmer for shutting down the computer.
You cook eggs with EventGhost? :shock:

Re: Timer Plugin

Posted: Fri Nov 09, 2007 1:16 pm
by CollinR
Here is 2 timers I am playing with.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
    <Action>
        Timer.TimerAction(u'NightMode', 0, 1, 1.0, u'NightMode', False, True, 2, u'20:00:00')
    </Action>
</EventGhost>
and

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
    <Action>
        Timer.TimerAction(u'Morning', 0, 1, 1.0, u'Morning', False, True, 2, u'05:30:00')
    </Action>
</EventGhost>

Now those start the timers, do I need to build more to reset them daily?

Re: Timer Plugin

Posted: Thu Feb 28, 2008 10:35 pm
by wgs1964
Hi there,

I'm trying to get EventGhost to power on my STB for unattended Beyond TV recordings.

Here is the macro:
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
<Macro Name='Start timer "Test"' Expanded="True">
<Action>
Timer.TimerAction(u'Test', 0, 1, 1.0, u'', True, False, 2, u'13:56:00')
</Action>
<Action Name="Transmit IR Telus Box ON">
USB_UIRT.TransmitIR(u'0000 0047 0000 001A 00EA 00EA 001D 003A 001D 0075 001D 003B 001D 003B 001D 003B 001D 003B 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 0075 001D 0075 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 003A 001D 0075 001D 01D1', 4, 0)
</Action>
</Macro>
</EventGhost>

I have tried changing the loop and interval settings and tried using 12 hour time (but there is no AM/PM) but still no joy.

So what am I doing wrong?

Will.

Re: Timer Plugin

Posted: Fri Feb 29, 2008 1:53 am
by CollinR

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
    <Action>
        Timer.TimerAction(u'Telus Routine', 0, 0, 86400.0, u'Wakeup Telus', False, True, 2, u'13:56:00')
    </Action>
</EventGhost>
In the autostart, this will make the event Telus Routine run every day at 1:56pm your time.

and your action is just map Timer.Telus Routine as the event.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="908">
<Action Name="Transmit IR Telus Box ON">
USB_UIRT.TransmitIR(u'0000 0047 0000 001A 00EA 00EA 001D 003A 001D 0075 001D 003B 001D 003B 001D 003B 001D 003B 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 0075 001D 0075 001D 0075 001D 003B 001D 0075 001D 003B 001D 0075 001D 003A 001D 0075 001D 01D1', 4, 0)
</Action>

Re: Timer

Posted: Fri Sep 19, 2008 1:39 pm
by prostetnic
Is there some way to pause a timer and then start again without restarting from the beginning??
I want to use this to control my fish-tanks lighting. I want the tank to be lit for 10h each day but since the tank is in my home theatre room I don't want it on when I'm using my projector. So I want to turn on the lighting say 10AM each day but then I want to turn it of when I'm watching a DVD etc. and then turned on again afterwords and then stay on until its been on for 10H.

Is it possible to do this in any way?

Re: Timer

Posted: Fri Sep 19, 2008 7:03 pm
by Pako
prostetnic wrote:Is it possible to do this in any way?
Try my solution:

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1449">
    <Folder Name="Check 10 hours lighting">
        <Macro Name="Initialization">
            <Event Name="Main.OnInit" />
            <Action>
                EventGhost.DisableItem(XmlIdLink(16))
            </Action>
            <Action>
                Timer.TimerAction(u'Start_lighting', 0, 0, 86400.0, u'Start_lighting', False, True, 2, u'10:00:00')
            </Action>
            <Action>
                EventGhost.PythonScript(u'eg.globals.Time_Counter = 0\neg.globals.Light_Flag = False\n')
            </Action>
        </Macro>
        <Macro Name="Light ON">
            <Event Name="Timer.Start_lighting" />
            <Action>
                EventGhost.EnableItem(XmlIdLink(16))
            </Action>
            <Action>
                EventGhost.PythonCommand(u'print "Lighting 10 hours started"')
            </Action>
            <Action>
                Timer.TimerAction(u'Check_Time', 0, 0, 60.0, u'Check_time', False, True, 4, u'00:00:00')
            </Action>
            <Action>
                EventGhost.PythonCommand(u'eg.globals.Light_Flag = True')
            </Action>
        </Macro>
        <Folder Name="Pause/Continue" id="16" Enabled="False">
            <Macro Name="Pause">
                <Action Name="Here insert an Event">
                    EventGhost.Comment()
                </Action>
                <Action>
                    EventGhost.PythonCommand(u'print "Now switch light OFF"')
                </Action>
                <Action>
                    EventGhost.PythonCommand(u'eg.globals.Light_Flag = False')
                </Action>
            </Macro>
            <Macro Name="Continue">
                <Action Name="Here insert an Event">
                    EventGhost.Comment()
                </Action>
                <Action>
                    EventGhost.PythonCommand(u'print "Now switch light ON"')
                </Action>
                <Action>
                    EventGhost.PythonCommand(u'eg.globals.Light_Flag = True')
                </Action>
            </Macro>
        </Folder>
        <Macro Name="Minutes counter">
            <Event Name="Timer.Check_time" />
            <Action>
                EventGhost.PythonScript(u'if eg.globals.Light_Flag:\n    eg.globals.Time_Counter+=1\n    if eg.globals.Time_Counter >599: # 10 hours\n        eg.result = True\n    else:\n        eg.result = False\n\n    ')
            </Action>
            <Action>
                EventGhost.NewJumpIf(XmlIdLink(30), 0, False)
            </Action>
            <Action>
                EventGhost.PythonCommand(u'print "Lighting:", eg.globals.Time_Counter,"minutes"')
            </Action>
        </Macro>
        <Macro Name="Light OFF" id="30">
            <Action>
                EventGhost.PythonCommand(u'print "Now switch light OFF"')
            </Action>
            <Action>
                EventGhost.DisableItem(XmlIdLink(16))
            </Action>
            <Action>
                Timer.TimerAction(u'Check_Time', 4, 1, 1.0, u'', False, True, 1, u'00:00:00')
            </Action>
            <Action>
                EventGhost.PythonCommand(u'print "Lighting 10 hours finished"')
            </Action>
        </Macro>
    </Folder>
</EventGhost>
Pako

Re: Timer

Posted: Sat Sep 20, 2008 10:55 pm
by prostetnic
Yes that will do the trick :)
Thanks

Re: Timer

Posted: Sat Mar 14, 2009 3:18 pm
by manjh
I've created two timers in EG to switch lights on and off, at fixed times.
I would like to determine the switch time based on sunset and sunrise... is there a way to do this? I know the alternative is to hook up an LDR (via an Arduino board, no problem). But putting the LDR outside with a wire running in to my computer is not what I would like to do. Simply following the sun times would do the trick
Anyone?

Re: Timer

Posted: Sat Mar 14, 2009 4:09 pm
by jinxdone
Perhaps this plugin is what you are looking for:

http://www.eventghost.org/forum/viewtop ... 22&start=0

Re: Timer

Posted: Sat Mar 14, 2009 5:46 pm
by manjh
jinxdone wrote:Perhaps this plugin is what you are looking for:

http://www.eventghost.org/forum/viewtop ... 22&start=0
Looks like just the one. But am having trouble to load it into EG, when I try it says "cannot read __init__.py..... also, when I compare the contents of the folder, I see there is only the __init__.py, and no __init__.pyc.
Is this something I should generate?

Re: Timer

Posted: Tue Jun 09, 2009 10:23 am
by manjh
I'm looking for a way to use the timer for switching based on the day of the week, e.g. switch garden lights off at 11PM on weekdays, but 01AM in the weekend.
Any way to do this?

Re: Timer

Posted: Tue Jun 09, 2009 1:54 pm
by krambriw
Search for "Scheduler"....or "SunTracker" in this forum if you would like to involve the sun status as condition

BestR Walter