Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: Timed Event Calculation Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
RWCS
Senior Member
Senior Member
Avatar

Joined: October 28 2002
Location: United States
Online Status: Offline
Posts: 102
Posted: November 01 2004 at 19:00 | IP Logged Quote RWCS

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 View RWCS's Profile Search for other posts by RWCS Visit RWCS's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: November 01 2004 at 20:33 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
RWCS
Senior Member
Senior Member
Avatar

Joined: October 28 2002
Location: United States
Online Status: Offline
Posts: 102
Posted: November 02 2004 at 17:20 | IP Logged Quote RWCS

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 View RWCS's Profile Search for other posts by RWCS Visit RWCS's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: November 02 2004 at 19:14 | IP Logged Quote dhoward

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 View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum