| Author |  | 
      
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          Great idea!
           | Posted: February 04 2007 at 10:34 | IP Logged |   |  
           | 
 |  
 Do you know that you can also enter your latitude and longitude in Setup, Sun?
 
 
 
| Quote: 
 
    
    | 
      
       | This Setup area allows you to define your latitude and longitude which is used in the sunrise, sunset, and civil twilight calculations. You can select your state and city, or manually enter your latitude and longitude. You must also manually select whether or not you observe daylight savings time in your area. |  |  |  You can then check DAWN, SUNRISE, SUNSET, and DUSK.
 
 Also, here's a way to reduce the code a bit...
 
 
 
| Code: 
 
    
    | 
      
       | Case( month( today())when 4 to 9 then ph_createtimedevent( 0,"<YOUR MACRO>", ph_relativedatetime( today(),90)) else ph_macro( "<YOUR MACRO>")) |  |  |  
 Edited by TonyNo - February 04 2007 at 10:42
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | krommetje Super User
 
  
  
 Joined: December 29 2004
 Location: Netherlands
 Online Status: Offline
 Posts: 695
 | 
          
           | Posted: February 05 2007 at 00:20 | IP Logged |   |  
           | 
 |  
| TonyNo wrote: 
 
    
    | 
      
       | Great idea! Also, here's a way to reduce the code a bit...
 
 
 
| Code: 
 
    
    | 
      
       | Case( month( today())when 4 to 9 then ph_createtimedevent( 0,"<YOUR MACRO>", ph_relativedatetime( today(),90)) else ph_macro( "<YOUR MACRO>")) |  |  |  |  |  |  
 sure, i've got the sun tab setup and daylight savings too, but I have found out that here, especially in the sommer, it is not nessecary to have the lights turned on at sunset, mostly it there is daylight enough for at least an hour... and in winter it is just the other way around... I tried at first using your reduced code but for a reason unknown to me I got an error when executing... Also when I was programming it, it wasn't as early as i thought
   
 Peter
 
 Edited by krommetje - February 05 2007 at 00:26
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | cmhardwick Senior Member
 
  
  
 Joined: July 08 2006
 Location: United States
 Online Status: Offline
 Posts: 290
 | 
          Not directly related, but somewhat. Are DAWN, SUNRISE, SUNSET and DUSK PH variables that can be referenced? I have a couple of uses for these if so. I didn't know if they were just internal or could be addressed directly in a macro or formula. (Ok, probably a stupid question, but i'm asking it anyway!
           | Posted: February 05 2007 at 10:13 | IP Logged |   |  
           | 
 |   
 __________________
 Cicero, Enjoying automation!
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          Yup. From the manual...
           | Posted: February 05 2007 at 10:56 | IP Logged |   |  
           | 
 |  
 
 
| Quote: 
 
    
    | 
      
       | [DAWN] This variable returns the start of civil twilight as the number of seconds past midnight. [DUSK] This variable returns the end of civil twilight as number of seconds past midnight.
 [SUNRISE] This variable returns the time of sunrise as the number of seconds past midnight.
 [SUNSET] This variable returns the time of sunset as the number of seconds past midnight.
 |  |  |  | 
       
        | Back to Top |       | 
       
       
        |  | 
        | cmhardwick Senior Member
 
  
  
 Joined: July 08 2006
 Location: United States
 Online Status: Offline
 Posts: 290
 | 
          Manual? Who reads the manual? hehehe
           | Posted: February 05 2007 at 13:18 | IP Logged |   |  
           | 
 |  
 Thanks!
 
 __________________
 Cicero, Enjoying automation!
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | krommetje Super User
 
  
  
 Joined: December 29 2004
 Location: Netherlands
 Online Status: Offline
 Posts: 695
 | 
          I had a question once when I was member of Fido-Net and all I got was: "RTFM!"
           | Posted: February 17 2007 at 00:50 | IP Logged |   |  
           | 
 |  
 Since then the first thing I do is actually read the .. manual
   
 Peter
 | 
       
        | Back to Top |       | 
       
       
        |  | 
        | TonyNo Moderator Group
 
  
  
 Joined: December 05 2001
 Location: United States
 Online Status: Offline
 Posts: 2889
 | 
          I try not to say RTFM until the second question that can be answered by doing it!
           | Posted: February 17 2007 at 12:24 | IP Logged |   |  
           | 
 |    | 
       
        | Back to Top |       | 
       
       
        |  |