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.

SunTracker - with moving ghost

Questions and comments specific to a particular plugin should go here.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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).
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: SunTracker - with moving ghost

Post 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
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
holle75
Posts: 33
Joined: Thu Apr 19, 2012 5:47 pm

Re: SunTracker - with moving ghost

Post 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)
Last edited by holle75 on Tue Aug 21, 2012 7:46 pm, edited 1 time in total.
Jbravo2
Posts: 7
Joined: Mon Jul 23, 2012 6:30 am

Re: SunTracker - with moving ghost

Post by Jbravo2 »

Same error here, seems connected to getting weather info from google...
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
pywapi.py
(13.56 KiB) Downloaded 283 times
holle75
Posts: 33
Joined: Thu Apr 19, 2012 5:47 pm

Re: SunTracker - with moving ghost

Post 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?! ;)
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
Jbravo2
Posts: 7
Joined: Mon Jul 23, 2012 6:30 am

Re: SunTracker - with moving ghost

Post 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.
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
Image2.jpg
Jbravo2
Posts: 7
Joined: Mon Jul 23, 2012 6:30 am

Re: SunTracker - with moving ghost

Post 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.
Jbravo2
Posts: 7
Joined: Mon Jul 23, 2012 6:30 am

Re: SunTracker - with moving ghost

Post 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.
RainerH
Posts: 3
Joined: Fri Aug 24, 2012 6:17 pm

Permanent error messages

Post 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
suntracker 1.jpg
suntracker 2.jpg
suntracker 3.jpg
rpbras
Posts: 5
Joined: Tue Jun 07, 2011 9:40 am

Re: SunTracker - with moving ghost

Post by rpbras »

I'll have the some errors. Anyone a solution?
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: SunTracker - with moving ghost

Post 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
Post Reply