Page 15 of 38
Re: SunTracker - with moving ghost
Posted: Mon Aug 20, 2012 6:32 pm
by krambriw
Yes of course, I will try it, thank you Pako!
I believe Bitmonster made the eg.Scheduler running in a separate thread, it must be, right?
Best regards, Walter
PS Dear Pako, your solution is more elegant of course and uses already provided mechanism. From CPU load point of view they are the same what I have seen during testing (non significant load).
Re: SunTracker - with moving ghost
Posted: Tue Aug 21, 2012 6:09 am
by Pako
krambriw wrote:I believe Bitmonster made the eg.Scheduler running in a separate thread, it must be, right?
Yes, it probably must.
krambriw wrote:From CPU load point of view they are the same what I have seen during testing (non significant load).
But take into account that you can have several plugins running and inside each of them can be running some separate Thread. I suppose, that if it is a periodic activity and therefore is possible (instead of Thread) the eg.Scheduler use, will reduce the CPU load.
Therefore, I always try to use inside of my plugins the eg.Scheduler instead of a Thread, if possible.
Best regards, Pako
Re: SunTracker - with moving ghost
Posted: Tue Aug 21, 2012 11:32 am
by krambriw
Yes Pako, you are right.
To summarize:
- using eg.Wait(n.n) or time.sleep(n.n) causes the whole EG to pause
- if you have a thread running as part of a plugin and need that it (the thread) takes a pause, use the threads provide wait method instead of eg.Wait(n.n) or time.sleep(n.n)
- if you have a need to make repetitive "things" with a delay between, use eg.scheduler
Hope this was correct now
Best regards, Walter
Re: SunTracker - with moving ghost
Posted: Tue Aug 21, 2012 6:31 pm
by holle75
Hello Walter, a slight time after initialising i┬┤m getting an error:
Code: Select all
20:27:01 Exception in thread Thread-9:
20:27:01 Traceback (most recent call last):
20:27:01 File "threading.pyc", line 532, in __bootstrap_inner
20:27:01 File "threading.pyc", line 484, in run
20:27:01 File "C:\Programme\EventGhost\plugins\SunTracker\__init__.py", line 1848, in main
20:27:01 self.currCondition = self.CheckWeatherCondition()
20:27:01 File "C:\Programme\EventGhost\plugins\SunTracker\__init__.py", line 1549, in CheckWeatherCondition
20:27:01 ''
20:27:01 File "C:\Programme\EventGhost\plugins\SunTracker\pywapi.py", line 81, in get_weather_from_google
20:27:01 dom = minidom.parseString(xml_response)
20:27:01 File "xml\dom\minidom.pyc", line 1928, in parseString
20:27:01 File "xml\dom\expatbuilder.pyc", line 940, in parseString
20:27:01 File "xml\dom\expatbuilder.pyc", line 223, in parseString
20:27:01 ExpatError: syntax error: line 1, column 0
i don┬┤t know where this is coming from.
best
H.
EDIT: it just happens from time to time (when restarting. Not every restart)
EDIT2: it happens also every now and then (today)
Re: SunTracker - with moving ghost
Posted: Tue Aug 21, 2012 7:06 pm
by Jbravo2
Same error here, seems connected to getting weather info from google...
Re: SunTracker - with moving ghost
Posted: Tue Aug 21, 2012 9:28 pm
by krambriw
Hi, the problem is related to getting the weather data from Google. I have seen this too once and made a modification to the attached file. Can you replace with this instead? It is in the same folder ..\plugins\SunTracker.
Please let me know if the problem gets solved
Best regards, Walter
Re: SunTracker - with moving ghost
Posted: Tue Aug 21, 2012 10:53 pm
by holle75
Code: Select all
00:35:41 Next execution will start in 600 seconds
00:35:41 Main.IsSunDown.True u"-60|30|Mostly Cloudy|Real Sunset expected:|2025|Virtual Sunset expected:|1910|Minutes to Virtual Sunset:|1115|Minutes adjusted:|-75|IsSunDown:|True"
00:42:40 Weather condition missing...
00:43:40 Weather condition missing...
00:44:40 Weather condition missing...
00:45:41 Next execution will start in 600 seconds
00:45:41 Main.IsSunDown.True u"-60|30|Mostly Cloudy|Real Sunset expected:|2025|Virtual Sunset expected:|1910|Minutes to Virtual Sunset:|1105|Minutes adjusted:|-75|IsSunDown:|True"
00:48:04 System.UnIdle
00:54:13 System.ClipboardChanged
00:55:41 Next execution will start in 600 seconds
00:55:41 Main.IsSunDown.True u"-60|30|Mostly Cloudy|Real Sunset expected:|2025|Virtual Sunset expected:|1910|Minutes to Virtual Sunset:|1095|Minutes adjusted:|-75|IsSunDown:|True"
im getting now..... that seems intended?!

Re: SunTracker - with moving ghost
Posted: Wed Aug 22, 2012 4:25 am
by krambriw
Thanks!
Yes, this is looking ok, no crash but a report that weather data was not received from Google (after 20 attempts with 2 seconds delay in between each).
You may see one of the following print statements if Google weather returns some data:
"Weather condition missing..."
"Weather data empty..."
or
"Retry getting weather..." if Google Weather is not even responding
Best R Walter
Re: SunTracker - with moving ghost
Posted: Wed Aug 22, 2012 7:31 pm
by Jbravo2
A simple question...
How do I set up "Day and Time Settings" to turn on the lights at sunset and turn them off them at sunrise? The lights are outside and should stay on all night.
Thanks.
Re: SunTracker - with moving ghost
Posted: Thu Aug 23, 2012 6:12 am
by krambriw
You can do as in the example below. We have to set at least one time per day to get the thing going. Assuming sun is at its highest peak at noon, I put in 11.59. The lights will actually not turn on because the sun is up but the "logic" will start running.
Best regards, Walter
Re: SunTracker - with moving ghost
Posted: Fri Aug 24, 2012 7:03 am
by Jbravo2
Thanks, that solved it.
May I suggest adding a checkbox to enable/disable the "day" without adding a specific time. If enabled an event should be fired at sunset, sunrise.
Re: SunTracker - with moving ghost
Posted: Fri Aug 24, 2012 7:06 am
by Jbravo2
krambriw wrote:Hi, the problem is related to getting the weather data from Google. I have seen this too once and made a modification to the attached file. Can you replace with this instead? It is in the same folder ..\plugins\SunTracker.
Please let me know if the problem gets solved
Best regards, Walter
pywapi.py
The fix seems to work here, thanks.
However, checking the weather condition each minute seems to be a bit of overkill, and the eg log gets flooded.
Permanent error messages
Posted: Fri Aug 24, 2012 6:26 pm
by RainerH
Dear all!
Every time I start the SunTracker Plug-in, I receive some error messages after a few seconds. I searched the forum and the net, but couldn't find a solution to it. I tried a few different versions of eventghost an suntracker, but without success. Perhaps it's because I'm new to the whole thing and have no experience? Is there anybody who can help me? Thanks a lot in advance!!!
Best regards
Rainer
Re: SunTracker - with moving ghost
Posted: Fri Aug 24, 2012 8:19 pm
by rpbras
I'll have the some errors. Anyone a solution?
Re: SunTracker - with moving ghost
Posted: Sat Aug 25, 2012 5:19 am
by krambriw
The problem is that I do not handle all characters correctly. You named the thread "FS20 Gartenkugeln an/aus" and the character "/" will then be used incorrectlly.
Please try to rename it with another character instead like "FS20 Gartenkugeln an_aus" or similar.
For a later version, I will check if I can improve this
Best regards, Walter