Charmed Quark Systems, Ltd. - Support Forums and Community

Full Version: Difference between Evening and Morning
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I tell this difference? When it is evening and the garage door opens I want to have the garage light on for 15 minutes. But in the morning I only want to have it on for 5 minutes. I use IsNight to determine if I turn it on at all, but I'd like to have diff timeouts based on Morning vs Evening.
When you turn it on, set a global to the appropriate number of minutes before it turns off. Then have a job running every 1 minute that counts down and turns off that light when it reaches 0.

There is a System::IsInTimeRange(starthour, endhour) which you could use. The hours are in 24 hour format, so you can distinguish between specific time ranges. It handles wrap around over midnight.