author: "Arnaud",
description: "Turn ON light(s) and/or dimmer(s) when there's movement and the room is dark with illuminance threshold and/or between sunset and sunrise. Then turn OFF after X minute(s) when the brightness of the room is above the illuminance threshold or turn OFF after X minute(s) when there is no movement.",
category: "Convenience",
+ iconUrl: "http://neiloseman.com/wp-content/uploads/2013/08/stockvault-bulb128619.jpg",
iconX2Url: "http://neiloseman.com/wp-content/uploads/2013/08/stockvault-bulb128619.jpg"
)
page(name: "configurations")
page(name: "options")
+
+
}
def configurations()
}
section ("Zip code (optional, defaults to location coordinates when location services are enabled)...")
{
- input "zipCode", "text", title: "Zip Code?", required: false, description: "Local Zip Code"
+ input "zipCodeText", "text", title: "Zip Code?", required: false, description: "Local Zip Code"
}
}
}
}
section ("Zip code (optional, defaults to location coordinates when location services are enabled)...")
{
- input "zipCode", "text", title: "Zip Code?", required: false, description: "Local Zip Code"
+ input "zipCodeText", "text", title: "Zip Code?", required: false, description: "Local Zip Code"
}
}
}
def astroCheck()
{
- def s = getSunriseAndSunset(zipCode: zipCode, sunriseOffset: sunriseOffset, sunsetOffset: sunsetOffset)
+ def s = getSunriseAndSunset(zipCode: zipCodeText, sunriseOffset: sunriseOffset, sunsetOffset: sunsetOffset)
state.riseTime = s.sunrise.time
state.setTime = s.sunset.time
log.debug "Sunrise: ${new Date(state.riseTime)}($state.riseTime), Sunset: ${new Date(state.setTime)}($state.setTime)"