Re: SunTracker - with moving ghost
Posted: Fri Jun 01, 2012 4:54 pm
I would like it to turn on at 2300, 0r 2359 and off at 0600...
but the plugin doesn't allow those timelines..
but the plugin doesn't allow those timelines..
You are right, this is a bug...I need to investigate this a bit.Light ON and Light OFF is happending the whole day and not in between sunset/sunrise
Code: Select all
if eg.event.suffix == 'Weather Condition:':
theWeather = eg.event.payload
if theWeather in (
"Cloudy",
"Fog",
"Haze",
"Light rain",
"Overcast",
"Mostly Cloudy",
"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"
):
eg.TriggerEvent('switchOnLight')
if theWeather in (
"Partly Cloudy",
"Clear",
"Sunny",
"Mostly Sunny",
"Partly Sunny"
):
eg.TriggerEvent('switchOffLight')
Code: Select all
if eg.plugins.IsSunDown == "false":
print "yes" (lights switch on/off depending on the weather)Code: Select all
if eg.event.suffix == 'Weather Condition:':
theWeather = eg.event.payload
bSunIsDown = eg.plugins.Suntracker.IsSunDown(0, 30)
if bSunIsDown and theWeather in (
"Cloudy",
"Fog",
"Haze",
"Light rain", #For Google weather
"Overcast",
"Mostly Cloudy",
"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"
):
eg.TriggerEvent('switchOnLight')
if not bSunIsDown:
eg.TriggerEvent('switchOffLight')
Code: Select all
if eg.event.suffix == 'Weather Condition:':
theWeather = eg.event.payload
bSunIsDown = eg.plugins.Suntracker.IsSunDown(0, 30)
if bSunIsDown:
eg.TriggerEvent('switchOnLight')
if not bSunIsDown:
eg.TriggerEvent('switchOffLight')
Code: Select all
if eg.globals.IphoneNicoleOUT == "False" or eg.globals.IphoneHolgerOUT == "False":
if eg.event.suffix == 'Weather Condition:':
theWeather = eg.event.payload
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"
):
eg.TriggerEvent('LICHT ON')
if not bSunIsDown and theWeather in (
"Cloudy",
"Mostly Cloudy",
"Partly Cloudy",
"Clear",
"Sunny",
"Mostly Sunny",
"Partly Sunny"
):
eg.TriggerEvent('LICHT OFF')
else:
print "niemand da"Code: Select all
2) If me or she is NOT at homeCode: Select all
2) If me AND she is NOT at homeCode: Select all
if eg.globals.IphoneNicoleOUT == "True" and eg.globals.IphoneHolgerOUT == "True":
eg.plugins.Suntracker.SetMovingGhostON()
else:
eg.plugins.Suntracker.SetMovingGhostOFF()
Very interesting finding, I need to change my settings in my Iphone, thanks(I figured out that this is far less power consumptive than have push switched on)
Code: Select all
try:
counter
except NameError:
counter = 0
if eg.event.suffix == 'Weather Condition:'
if counter == 0 or counter == 10:
theWeather = eg.event.payload
counter += 1
if counter > 10:
counter = 1
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"
):
eg.TriggerEvent('LICHT ON')
if not bSunIsDown and theWeather in (
"Cloudy",
"Mostly Cloudy",
"Partly Cloudy",
"Clear",
"Sunny",
"Mostly Sunny",
"Partly Sunny"
):
eg.TriggerEvent('LICHT OFF')
else:
print "niemand da"
Code: Select all
if eg.event.suffix == 'Weather Condition:'Code: Select all
if( eg.event.suffix == 'Weather Condition:' ):Code: Select all
eg.globals.end = TrueCode: 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()