SchedulGhost

Questions and comments specific to a particular plugin should go here.
Post Reply
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SchedulGhost

Post by Pako » Fri Sep 07, 2012 7:56 am

woodi wrote:Thanks Pako!
But I think a new bug occured instead.
I executed my macro "Bathmode" after the schedule Poolpump started (08:12:11) and the schedule sent an OFF-event while it was disabled.
But no ON-events anymore, thats good. :)
It's not a bug, it is the intention.
I think a pair of ON/OFF (or Start/Stop) should be complete, even if you disable the schedule between them.
If it bothers you, you can to disable the corresponding macro too.

BTW - why do you use the Timer plugin also?
After all, you can use SchedulGhost for that purpose.
You must choose the type of schedule "Time span" and to run the action "Run schedule immediately".

Pako
You know flattr ? You can Image

thebeetleuk
Posts: 9
Joined: Sun Dec 09, 2012 9:36 pm

Re: SchedulGhost

Post by thebeetleuk » Fri Dec 14, 2012 10:33 am

Hi All,

The link to this seems to be broken? Where can I get the download?

Thanks

M

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

Re: SchedulGhost

Post by Pako » Fri Dec 14, 2012 2:19 pm

Thank you for pointing.
Link to download is corrected.

Pako
You know flattr ? You can Image

cargen
Posts: 4
Joined: Sun Mar 10, 2013 10:02 am

Re: SchedulGhost

Post by cargen » Tue Mar 26, 2013 7:27 am

Hi,

this looks a great plugin
can I ask if the plugin wakeup the pc to perform a schedule event at a certain time?

Thanks

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

Re: SchedulGhost

Post by Pako » Sun May 05, 2013 10:02 am

Added new action Reload data from xml.
This is done in response to a request XML back door to SchedulGhost? .
Download link is in the initial post.

Pako
You know flattr ? You can Image

Samme
Posts: 33
Joined: Tue Nov 22, 2011 9:07 am

Re: SchedulGhost

Post by Samme » Fri Oct 04, 2013 2:39 pm

Hi!

After update to latest version of EventGhost, SchedulGhost no longer works.
16:29:59 Error starting plugin: SchedulGhost
16:29:59 Traceback (most recent call last) (1640):
16:29:59 File "C:\Program Files (x86)\EventGhost\eg\Classes\PluginInstanceInfo.py", line 177, in Start
16:29:59 self.instance.__start__(*self.args)
16:29:59 File "C:\Program Files (x86)\EventGhost\plugins\SchedulGhost\__init__.py", line 1653, in __start__
16:29:59 self.data = self.xmlToData()
16:29:59 File "C:\Program Files (x86)\EventGhost\plugins\SchedulGhost\__init__.py", line 2424, in xmlToData
16:29:59 xmldoc = miniDom.parse(xmlfile)
16:29:59 File "xml\dom\minidom.pyc", line 1918, in parse
16:29:59 File "xml\dom\expatbuilder.pyc", line 924, in parse
16:29:59 File "xml\dom\expatbuilder.pyc", line 211, in parseFile
16:29:59 ExpatError: no element found: line 1, column 0
Any ideas what to do?

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

Re: SchedulGhost

Post by Pako » Sat Oct 05, 2013 5:12 am

Samme wrote:After update to latest version of EventGhost, SchedulGhost no longer works.
I'm sorry, but I can not confirm.
I have no problem with that.
I believe that you have a problem.
In order to find the cause, you have to provide more information (so that the error was reproducible).

Pako
You know flattr ? You can Image

Samme
Posts: 33
Joined: Tue Nov 22, 2011 9:07 am

Re: SchedulGhost

Post by Samme » Sat Oct 05, 2013 9:11 am

Found the problem - for some reason the xml file was empty, must happened when EG crashed or something! I deleted it and started over from scratch and now it works again!

Fritte
Posts: 9
Joined: Sun Dec 29, 2013 7:29 pm

Re: SchedulGhost

Post by Fritte » Sun Dec 29, 2013 7:56 pm

I have some problem and think it's a bug.
I get the following in the log every 2nd or 3rd time I run the script:

Code: Select all

20:26:31   HTTP.SetWakeUpTime [u'2013:12:30:14:0:0']
20:26:31      Python-skript
20:26:31         Python-skript
20:26:31            Traceback (most recent call last):
20:26:31              Python script "15", line 14, in <module>
20:26:31                eg.plugins.SchedulGhost.AddSchedule(u"[0, u'Godmorgon Johan', 0, [u'"+str(alarmtime.hour)+":"+str(alarmtime.minute)+":"+str(alarmtime.second)+"', u'00:00:00', '"+str(alarmtime.year)+"-"+str(alarmtime.month)+"-"+str(alarmtime.day)+"', 0], u'2013-01-01 00:00:00', u'SchedulGhost', u'Godmorgon.Johan', '', '']");
20:26:31              File "C:\Tools\EventGhost\plugins\SchedulGhost\__init__.py", line 2723, in __call__
20:26:31                self.plugin.UpdateEGscheduler()
20:26:31              File "C:\Tools\EventGhost\plugins\SchedulGhost\__init__.py", line 2268, in UpdateEGscheduler
20:26:31                eg.scheduler.CancelTask(sched)
20:26:31              File "C:\Tools\EventGhost\eg\Classes\Scheduler.py", line 119, in CancelTask
20:26:31                self.heap.remove(task)
20:26:31            ValueError: list.remove(x): x not in list
My python script is:

Code: Select all

import datetime
#Get payload
payload = eg.event.payload;
alarmtime = payload[0];

if alarmtime == "off":
    eg.plugins.SchedulGhost.DisableSchedule(u'Godmorgon Johan');
    print "Godmorgon Johan inaktiverat";
else:
    #Convert payload to date format -15 minutes
    alarmtime = datetime.datetime.strptime(alarmtime, "%Y:%m:%d:%H:%M:%S") - datetime.timedelta(minutes=15);
    #Schedule alarm time
    eg.plugins.SchedulGhost.AddSchedule(u"[0, u'Godmorgon Johan', 0, [u'"+str(alarmtime.hour)+":"+str(alarmtime.minute)+":"+str(alarmtime.second)+"', u'00:00:00', '"+str(alarmtime.year)+"-"+str(alarmtime.month)+"-"+str(alarmtime.day)+"', 0], u'2013-01-01 00:00:00', u'SchedulGhost', u'Godmorgon.Johan', '', '']");
    eg.plugins.SchedulGhost.EnableSchedule(u'Godmorgon Johan');
    print "Godmorgon Johan aktiveras: "+str(alarmtime.year)+"-"+str(alarmtime.month)+"-"+str(alarmtime.day)+" "+str(alarmtime.hour)+":"+str(alarmtime.minute)+":"+str(alarmtime.second);
Everything works ok if I comment out line 14 (EnableSchedule). Except that the schedule is still disabled.

What I'm doing is to set time for wake up light based on alarm on my android phone.

Fritte
Posts: 9
Joined: Sun Dec 29, 2013 7:29 pm

Re: SchedulGhost

Post by Fritte » Sun Dec 29, 2013 7:58 pm

* double post *
Last edited by Fritte on Wed Jan 01, 2014 12:09 pm, edited 1 time in total.

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

Re: SchedulGhost

Post by Pako » Tue Dec 31, 2013 9:33 pm

It is difficult to reproduce the error on the basis of available information.
Can you please attach the whole (or the relevant part of) EventGhost configuration file (xml)
and configuration file of SchedulGhost plugin (xml) ?

Pako
You know flattr ? You can Image

Fritte
Posts: 9
Joined: Sun Dec 29, 2013 7:29 pm

Re: SchedulGhost

Post by Fritte » Wed Jan 01, 2014 12:20 pm

Here it is.

Code: Select all

<Autostart Name="Autostart" Expanded="True">
        <Plugin Identifier="SchedulGhost" Guid="{39EFE2FF-6CA9-4450-B0E3-1AA125420B37}" File="SchedulGhost">
            gAIoWC8AAABDOlxVc2Vyc1xTZXJ2ZXJBZG1pblxBcHBEYXRhXFJvYW1pbmdcRXZlbnRHaG9zdHEAWD0AAABDOlxVc2Vyc1xTZXJ2ZXJBZG1pblxBcHBEYXRhXFJvYW1pbmdcRXZlbnRHaG9zdFxTY2hlZF9Mb2cudHh0cQFYDAAAAFNjaGVkdWxHaG9zdHECXXEDKF1xBF1xBWVLAHRxBi4=
        </Plugin>
        <Plugin Identifier="TellStickDuo" Guid="{197BDE4F-0F1A-446C-B8EE-18FDB5077A56}" File="TellStickDuo">
            gAIoiIiIiYlHP9MzMzMzMzOIdHEALg==
        </Plugin>
        <Plugin Identifier="NetworkReceiver" Guid="{8F35AE6D-AF12-4A94-AA91-4B63F0CBBE1C}" File="NetworkReceiver">
            gAJNAARYAAAAAHEAWAMAAABUQ1BxAYdxAi4=
        </Plugin>
        <Plugin Identifier="NetworkSender" Guid="{B4F0DAFE-2E0B-47F3-A155-ED72C7A4E270}" File="NetworkSender">
            gAJYDAAAADE5Mi4xNjguNS4yMHEATQEEWAAAAABxAYdxAi4=
        </Plugin>
        <Plugin Identifier="MCE_Vista" Guid="{A7DB04BB-9F0A-486A-BCA1-CA87B9620D54}" File="MceRemote_Vista">
            gAIpLg==
        </Plugin>
        <Plugin Identifier="Webserver" Guid="{E4305D8E-A3D3-4672-B06E-4EA1F0F6C673}" File="Webserver">
            gAIoWAQAAABIVFRQcQBLUFgXAAAAQzpcVG9vbHNcRXZlbnRHaG9zdFx3d3dxAVgKAAAARXZlbnRHaG9zdHECWAAAAABxA2gDfXEEdHEFLg==
        </Plugin>
        <Plugin Identifier="BroadcastListener" Guid="{5E8DA56B-24AC-4092-9521-169343C5171C}" File="Broadcaster">
            gAIoWAkAAABCcm9hZGNhc3RxAFgNAAAAMjU1LjI1NS4yNTUuMHEBTTWCiVgCAAAAJiZxAlULMTkyLjE2OC41LjVxA3RxBC4=
        </Plugin>
        <Plugin Identifier="NMA" Guid="{4D5F1C9D-0F0F-4CB9-A98B-7112B46E66F0}" File="NMA">
            gAJdcQBdcQEoWAQAAABTR1MzcQJYMAAAADgxYzY2NTczZmYyOTYyNjg0MzBmODcyNjNlYjhlZjU4ZWFhZGQ1YWFjM2ZiYWQ2MnEDWAAAAABxBGVhaASGcQUu
        </Plugin>
        <Plugin Identifier="AutoRemote" Guid="{C18A174E-71E3-4C74-9A2B-8653CE9991E1}" File="Autoremote">
            gAIoVQpBdXRvUmVtb3RlcQBNGgdYCgAAAEV2ZW50R2hvc3RxAV1xAihYBQAAAEk5MzAwcQNYFAAAAGh0dHA6Ly9nb28uZ2wvUmZobHJMcQRYogAAAEFQQTkxYkY1RE1tSXZ6ajQxSmJuMW13TTFublFEd2ZlaTBDZ3JxU2hkYjB2aUUza0VjYXlBNXFYNFk5bjVhOEJhNTVUenZZc3QtdGFTQ0tPbVE3cUh1SGc0MkR3dE80dEl1NVRoaWw0clRqQWVZdHJYX25LcTV1bW9WRHBUVE5scS1BU0o1bGRvWmJnTTRIN1NkZ1NEb2FBQTVpZTBnV24yZ3EFTolOdHEGYVgMAAAAZnJpdGhpb2ZmLnNlcQdYGQAAAEM6XFRvb2xzXEF1dG9yZW1vdGUgZmlsZXNxCIlYLQAAADEvR1M2eU5VbWVIZzRuNFRESDdBRTRQVWZ2NXpLay1IMkxjR3dsb3NwOUk0QXEJiYlYEgAAAFNlbmQgdG8gRXZlbnRHaG9zdHEKdHELLg==
        </Plugin>
        <Action>
            AutoRemote.RegisterEventGhost(u'I9300', u'http://goo.gl/RfhlrL', u'APA91bF5DMmIvzj41Jbn1mwM1nnQDwfei0CgrqShdb0viE3kEcayA5qX4Y9n5a8Ba55TzvYst-taSCKOmQ7qHuHg42DwtO4tIu5Thil4rTjAeYtrX_nKq5umoVDpTTNlq-ASJ5ldoZbgM4H7SdgSDoaAA5ie0gWn2g', u'')
        </Action>
    </Autostart>

.......

<Folder Name="Set Wake Up Time HTTP" Expanded="True">
            <Macro Name="Python-skript" Expanded="True">
                <Event Name="HTTP.SetWakeUpTime" />
                <Action>
                    EventGhost.PythonScript(u'import datetime\n#Get payload\npayload = eg.event.payload;\nalarmtime = payload[0];\n\nif alarmtime == "off":\n    eg.plugins.SchedulGhost.DisableSchedule(u\'Godmorgon Johan\');\n    print "Godmorgon Johan inaktiverat";\nelse:\n    #Convert payload to date format -15 minutes\n    alarmtime = datetime.datetime.strptime(alarmtime, "%Y:%m:%d:%H:%M:%S") - datetime.timedelta(minutes=15);\n    #Schedule alarm time\n    eg.plugins.SchedulGhost.AddSchedule(u"[0, u\'Godmorgon Johan\', 0, [u\'"+str(alarmtime.hour)+":"+str(alarmtime.minute)+":"+str(alarmtime.second)+"\', u\'00:00:00\', \'"+str(alarmtime.year)+"-"+str(alarmtime.month)+"-"+str(alarmtime.day)+"\', 0], u\'2013-01-01 00:00:00\', u\'SchedulGhost\', u\'Godmorgon.Johan\', \'\', \'\']");\n    eg.plugins.SchedulGhost.EnableSchedule(u\'Godmorgon Johan\');\n    print "Godmorgon Johan aktiveras: "+str(alarmtime.year)+"-"+str(alarmtime.month)+"-"+str(alarmtime.day)+" "+str(alarmtime.hour)+":"+str(alarmtime.minute)+":"+str(alarmtime.second);')
                </Action>
            </Macro>
        </Folder>
Attachments
SchedulGhost.zip
(732 Bytes) Downloaded 192 times

kkl
Experienced User
Posts: 312
Joined: Wed May 04, 2011 9:32 pm

Re: SchedulGhost

Post by kkl » Fri Jan 10, 2014 10:34 pm

I don't think I understand the Span value. Is it possible with SchedulGhost to have a Periodic event that only happens during certain hours of the day? I want to trigger an event every 20 minutes from 0800-2300. I get an error when putting in a Span value (thinking that a Span of 15:00:00 + 08:00:00 = 2300).
Capture1.PNG
Could someone clue me in? Thanks.

kkl
Experienced User
Posts: 312
Joined: Wed May 04, 2011 9:32 pm

Re: SchedulGhost

Post by kkl » Sat Jan 11, 2014 9:47 pm

No help here, so I made a workaround using Python script that stops the macro if the time is not within the bounds set:

Code: Select all

import time
from time import strftime, localtime
if not int("0800") < int(strftime("%H%M", localtime())) < int("2300"):
    print "Not within time constraints."
    eg.StopMacro()

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

Re: SchedulGhost

Post by Pako » Sun Jan 12, 2014 9:16 am

Fritte wrote:I have some problem and think it's a bug.
It appears that a bug is actually in the plugin.
However, help is easy. You must first disable a schedule and only then you can set it and enable it.
Please use a modified script:

Code: Select all

import datetime
#Get payload
payload = eg.event.payload
alarmtime = payload[0]

eg.plugins.SchedulGhost.DisableSchedule(u'Godmorgon Johan')
if alarmtime == "off":
    print "Godmorgon Johan inaktiverat"
else:
    #Convert payload to date format -15 minutes
    alarmtime = datetime.datetime.strptime(alarmtime, "%Y:%m:%d:%H:%M:%S") - datetime.timedelta(minutes=15)
    #Schedule alarm time
    d = alarmtime.strftime('%Y-%m-%d')
    t = alarmtime.strftime('%H:%M:%S')
    schedule = u"[0, u'Godmorgon Johan', 0, [u'%s', u'00:00:00', u'%s', 0], u'2013-01-01 00:00:00', u'SchedulGhost', u'Godmorgon.Johan', '', '']" % (t, d)
    eg.plugins.SchedulGhost.AddSchedule(schedule)
    eg.plugins.SchedulGhost.EnableSchedule(u'Godmorgon Johan')
    print "Godmorgon Johan aktiveras: %s %s" % (d, t)
kkl wrote:I don't think I understand the Span value. Is it possible with SchedulGhost to have a Periodic event that only happens during certain hours of the day? I want to trigger an event every 20 minutes from 0800-2300. I get an error when putting in a Span value (thinking that a Span of 15:00:00 + 08:00:00 = 2300).
Could someone clue me in? Thanks.
Yes, it is obvious that you do not understand the meaning of the span.
And even that is very helpful to your case. :D
But you'll need one extra schedule.
The attached picture is an example.
SchedulGhostSpan.png
I believe that now you'll understand.

Pako
You know flattr ? You can Image

Post Reply