Author |
|
RWCS Senior Member
Joined: October 28 2002 Location: United States
Online Status: Offline Posts: 102
|
Posted: November 01 2004 at 19:00 | IP Logged
|
|
|
I'd like to create a timed event at sunrise and sunset everyday. If I understand it correctly you need to concatinate today's date with the time of sunrise (or sunset). But sunrise (and sunset) is given in seconds not in the format of HH:MM:SS. So the statement would be a nested thing. date + convert [SUNRISE] Can you help with the exact syntax?
__________________ RWCS LLC
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: November 01 2004 at 20:33 | IP Logged
|
|
|
Bob,
What version of PowerHome are you using? For the last several versions, sunrise, sunset, dawn, and dusk are built into the Timed Events. No calculations or anything needed.
If you are running an older version and dont feel like upgrading, just create a macro and have it execute at midnight (00:00:00) everyday. In this macro, use the Create Timed Event command and place the formula [SUNRISE] / 60 in the send keys field.
How this works is this: The [SUNRISE] system variable contains the number of seconds from midnight that sunrise will occur. If we divide this by 60, we get the number of minutes past midnight that sunrise will occur. The Create Timed Event command allows you to place an exact Date / Time in the send keys field or the number of minutes in the future that you will the timed event created. If we run our macro right at midnight (the [SUNRISE] system variable is dynamically calculated for the current date), we can have our timed event created for us to execute at sunrise.
Let me know if you still need help.
Dave.
|
Back to Top |
|
|
RWCS Senior Member
Joined: October 28 2002 Location: United States
Online Status: Offline Posts: 102
|
Posted: November 02 2004 at 17:20 | IP Logged
|
|
|
Thanks Dave, I think I'm on the right track now. I actually wanted an event an hour after sunrise and an hour before sunset, which is a trivial change to the sunrise/60 calculation above. Thanks again
__________________ RWCS LLC
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: November 02 2004 at 19:14 | IP Logged
|
|
|
Bob,
Yep...for an hour after sunrise just change it to [SUNRISE] / 60 + 60 and I wont bore you with the formula for sunset
Incidently...if you do upgrade, the new timed events will do what you want as well. It includes an extra column for either a random or fixed offset.
Dave.
|
Back to Top |
|
|