I would like it to turn on at 2300, 0r 2359 and off at 0600...
but the plugin doesn't allow those timelines..
Light ON and Light OFF is happending the whole day and not in between sunset/sunrise
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')
if eg.plugins.IsSunDown == "false":
print "yes" (lights switch on/off depending on the weather)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')
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')
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"2) If me or she is NOT at home2) If me AND she is NOT at homeif eg.globals.IphoneNicoleOUT == "True" and eg.globals.IphoneHolgerOUT == "True":
eg.plugins.Suntracker.SetMovingGhostON()
else:
eg.plugins.Suntracker.SetMovingGhostOFF()
(I figured out that this is far less power consumptive than have push switched on)
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"
if eg.event.suffix == 'Weather Condition:'if( eg.event.suffix == 'Weather Condition:' ):eg.globals.end = True
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()
Users browsing this forum: No registered users and 2 guests