Page 17 of 38

Re: SunTracker - with moving ghost

Posted: Tue Aug 28, 2012 5:37 pm
by holle75
... i┬┤m just asking because of the nice, special script you wrote me :

Code: Select all

def TheTask():
   
    theWeather = eg.plugins.Suntracker.GetWeatherCondition()
    #print theWeather

    if eg.globals.IphoneNicoleOUT == "False" or eg.globals.IphoneHolgerOUT == "False":   
        bSunIsDown = eg.plugins.Suntracker.IsSunDown(-60, 60)
   
        if not bSunIsDown and theWeather in (             
                "Fog",
                "Haze",
                "Light rain",
                "Overcast",               
                "Fair",
                "Heavy Rain",
                "Rain",
                "Rain Showers",
                "Rain Shower",
                "Ice/Snow",
                "Freezing Rain",
                "Freezing Drizzle",
                "Light Drizzle",
                "Drizzle",
                "Flurries",
                "Rain and Snow",
                "Showers",
                "Snow",
                "Light snow",
                "Snow Showers",
                "Isolated Thunderstorms",
                "Thunderstorm",
                "Chance of Showers",
                "Chance of Snow",
                "Chance of Storm",
                "Scattered Showers",
                "Mist",
                "Dust",
                "Icy",
                "Smoke",
                "Sleet"
        ):
            if not eg.globals.lights_ON:
                eg.TriggerEvent('LICHT ON')
                eg.globals.lights_ON = True
   
        if not bSunIsDown and theWeather in (
                "Cloudy",
                "Mostly Cloudy",
                "Partly Cloudy",
                "Clear",
                "Sunny",
                "Mostly Sunny",
                "Partly Sunny"
        ):
            if eg.globals.lights_ON:
                eg.TriggerEvent('LICHT OFF')
                eg.globals.lights_ON = False
    else:
        print "niemand da"

    if eg.globals.end == True:
        eg.globals.end = False
        print "Shutting down script..."
        print "Script is stopped"
        eg.StopMacro()
    else:
        remain = 600
        print "Next execution will start in "+str(remain)+" seconds"
        eg.scheduler.AddTask(remain, TheTask)

# Here we go...this is where the script starts
try:
    dummy #Only used to initialise some variables at startup
except NameError:
    dummy = 0
    eg.globals.end = False
    eg.globals.lights_ON = False

TheTask()
if the status messages change, i have to change also the script.

Re: SunTracker - with moving ghost

Posted: Tue Aug 28, 2012 6:33 pm
by krambriw
Yes, I think it may happen.
I believe I am logging if the condition is not found in the list. The trick is to find out all possible conditions that they might use (and the correct spelling). I think for instance the 'Light rain' is used by Google but ' Light Rain' by Yahoo.

BestR Walter

Re: SunTracker - with moving ghost

Posted: Tue Aug 28, 2012 7:01 pm
by holle75
... is there a trick i can print the error in the log in red if a status is not matching any of the statuses in the Walter-Weather-Script?

Re: SunTracker - with moving ghost

Posted: Wed Aug 29, 2012 12:30 pm
by krambriw
...not from the script itself but I have made this handled by the plugin. Check the first post.

BestR Walter

Re: SunTracker - with moving ghost

Posted: Wed Aug 29, 2012 12:49 pm
by holle75
... so smart!

Re: SunTracker - with moving ghost

Posted: Wed Aug 29, 2012 7:37 pm
by holle75
Hello Walter, i got two errors with the newest version (29.08.12) during the day and the SunTracker seems to has stopped in a way (no switching lights at sunset)

the first :

Code: Select all

19:11:02   Walter - Kein Licht ON weil niemand da
19:11:02   Next execution will start in 600 seconds
19:19:01   Yahoo!Weather condition not in list: Unknown
19:19:01   Exception in thread suntracker ANWESEND:
19:19:01   Traceback (most recent call last):
19:19:01     File "threading.pyc", line 532, in __bootstrap_inner
19:19:01     File "C:\Programme\EventGhost\plugins\SunTracker\__init__.py", line 1128, in run
19:19:01       self.iOffset
19:19:01   TypeError: 'bool' object is not iterable
19:19:01   
19:21:02   Unknown
19:21:02   Walter - Kein Licht ON weil niemand da
the second:

Code: Select all

21:31:35            Moving Ghost function OFF
21:31:35            GHOST ist OFF
21:31:35            Yahoo!Weather condition not in list: Light Rain Shower
21:31:35            Traceback (most recent call last):
21:31:35              Python script "10", line 4, in <module>
21:31:35                bSunIsDown = eg.plugins.Suntracker.IsSunDown(-60, 30)
21:31:35              File "C:\Programme\EventGhost\plugins\SunTracker\__init__.py", line 4302, in __call__
21:31:35                self.iTimeAhead
21:31:35            TypeError: 'bool' object is not iterable
21:31:35   Application.Launched.winamp
21:31:35      Spotify UpdateData holger

Re: SunTracker - with moving ghost

Posted: Thu Aug 30, 2012 4:21 am
by krambriw
Ahhhhh, I created a bug in the weather calculation function, sorry

Fixed a new version and uploaded it. Also added the new weather conditions that made my bug visible. You can open the weather_conditions.py file and look inside how the different weather conditions are inserted and categorized.

Hopefully this will now work....

Best regards, Walter

Re: SunTracker - with moving ghost

Posted: Thu Aug 30, 2012 10:31 am
by holle75
i┬┤m going to check. this extra list with the weather conditions is very helpful. thank you for that.

Re: SunTracker - with moving ghost

Posted: Sun Sep 02, 2012 3:36 pm
by cheater
Hi,
I am from Germany, but I'll try my best to write good english :wink: .

I just discovered SunTracker, but its very complicated for me.

I want to start an event at sunrise an start anotherone at sunset. Can someone please explain me how to arrange the right settins? Pictures would be very useful.

Thank you very much!

Re: SunTracker - with moving ghost

Posted: Sun Sep 02, 2012 5:24 pm
by krambriw
Deutsch ist auch ok wenn es leichter wird. Ich wird doch auf English antworten. Probier mal etwas wie es unten geseigt ist.
Gruss, Walter
Image2.jpg

Re: SunTracker - with moving ghost

Posted: Sun Sep 02, 2012 5:54 pm
by cheater
Hallo, was passiert um 11:59 Uhr?

Ich habe es so eingestellt und die Systemuhr umgestellt auf 11:58Uhr, aber es passiert nichts.

Thank you very much. :wink:

Re: SunTracker - with moving ghost

Posted: Sun Sep 02, 2012 6:03 pm
by krambriw
Nothing really happens at 11:59,
any time setting is needed for the logic to start (could maybe be improved in a future version but this is how it is).

At 11:59 (at noon) the sun is up at its highest peak so nothing will be triggered. You will get a trigger at sunset and at sunrise and a sync every 30 min in between if you follow the settings in the picture.

Best regards, Walter

Re: SunTracker - with moving ghost

Posted: Sun Sep 02, 2012 8:29 pm
by cheater
Habe alles genauso eingestellt, aber leider bekomme ich kein Sunrise Event!

Re: SunTracker - with moving ghost

Posted: Mon Sep 03, 2012 5:58 am
by krambriw
Maybe a misunderstanding.

With those settings you will get an event at sunset and at sunrise. The name of the events will be what you have written in "Eventname ON" that will be triggered at sunset and "Eventname OFF" that will be triggered at sunrise.

In your picture you got an event with name "Zeitraffer deaktiviert" at 06.35, at sunrise. This is correct. If Zeitraffer would be a lamp, you would use this event to turn it off.

It is working correctly but maybe you are looking for something else. Please specify better then what you want to achieve.
If you just would like to have an event with the names "Sunrise" and "Sunset" you just put that in as names for "Eventname OFF" and "Eventname ON" respectively.

Best regards, Walter

Re: SunTracker - with moving ghost

Posted: Tue Sep 04, 2012 6:31 pm
by Noelba
Bug?
I run the latest version and fight the following problem. The events Main.sunset and Main.Sunrise appear 2 hours too early, while the announced times in the log are completely correct.

Regards Noelba