Jump to content

Sun Interval Timer Running Strangely


Recommended Posts

I've got a Raspberry Pi based system and I'm creating a sun interval timer.  I've run the TimerSunInterval script and when I go to the device explorer page, I see the device.  I can see the output turn on and off, but the times aren't correct.


Here is the command line version for how I'm building the timer (I've changed the longitude and latitude to 0 for privacy reasons):


run_script("Scripts/Device/Virtual/TimerSunInterval", days:"", id:"sun_timer", intervals:"5:00 to sunrise + 10*60, sunset + 10*60 to 23:00", latitude:0, longitude:0, weekdays:"")


Why isn't the timer working properly?

Link to comment
Share on other sites

Since you are using a Sun Interval Timer, your times can be a function of either absolute time, or sunrise and sunset.  Looking at your script, you are using all three.  If just your sunrise and sunset times are wrong, most likely your longitude and latitude values are not set properly for your location.  If all your times are wrong, then your Pi's clock may be off.


Raspberry Pis don't have a hardware clock, so every time they power on, they need to get the time from the internet.  If your Pi is not connected to the internet, it will take a guess at the time (which is commonly the last real time it knew).  If your Pi is not connected to the internet, it will likely have a time which is way off.  This would cause all your times to be off.  To see if the your Pi's time is correct, from a command prompt, type "date".  If the date is incorrect, make sure your Pi is connected to the internet.


If your Pi is connected to the internet and your timer on and off times are still wrong, it's possible that your Pi has the wrong timezone.  The raspi-config program (type "sudo raspi-config" from the prompt) has a pick for changing the timezone in the "Internationalisation Options" section.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...