Timer

Questions and comments specific to a particular plugin should go here.
Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Timer

Post by Bartman » Mon Oct 29, 2007 2:09 pm

This is a topic for questions concerning the Timer plugin.

CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Timer Plugin

Post by CollinR » Mon Nov 05, 2007 8:37 pm

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.

Bartman
Plugin Developer
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am

Re: Timer Plugin

Post by Bartman » Fri Nov 09, 2007 11:27 am

I just use it as an egg timer and i had a macro as a sleep tmer for shutting down the computer.

User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Timer Plugin

Post by Bitmonster » Fri Nov 09, 2007 11:29 am

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:
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!

CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Timer Plugin

Post by CollinR » Fri Nov 09, 2007 1:16 pm

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?

wgs1964
Posts: 1
Joined: Sun Feb 17, 2008 6:21 pm

Re: Timer Plugin

Post by wgs1964 » Thu Feb 28, 2008 10:35 pm

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.

CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Timer Plugin

Post by CollinR » Fri Feb 29, 2008 1:53 am

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>

prostetnic
Posts: 28
Joined: Fri Apr 18, 2008 6:52 pm
Location: Sweden

Re: Timer

Post by prostetnic » Fri Sep 19, 2008 1:39 pm

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?

User avatar
Pako
Plugin Developer
Posts: 2274
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Timer

Post by Pako » Fri Sep 19, 2008 7:03 pm

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

prostetnic
Posts: 28
Joined: Fri Apr 18, 2008 6:52 pm
Location: Sweden

Re: Timer

Post by prostetnic » Sat Sep 20, 2008 10:55 pm

Yes that will do the trick :)
Thanks

manjh
Posts: 41
Joined: Thu Mar 12, 2009 11:14 am

Re: Timer

Post by manjh » Sat Mar 14, 2009 3:18 pm

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?

User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Timer

Post by jinxdone » Sat Mar 14, 2009 4:09 pm

Perhaps this plugin is what you are looking for:

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

manjh
Posts: 41
Joined: Thu Mar 12, 2009 11:14 am

Re: Timer

Post by manjh » Sat Mar 14, 2009 5:46 pm

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?

manjh
Posts: 41
Joined: Thu Mar 12, 2009 11:14 am

Re: Timer

Post by manjh » Tue Jun 09, 2009 10:23 am

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?

krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Timer

Post by krambriw » Tue Jun 09, 2009 1:54 pm

Search for "Scheduler"....or "SunTracker" in this forum if you would like to involve the sun status as condition

BestR Walter

Post Reply