To calculate the sunrise, sunset and the twilight times for a given location, which the phone gets by GPS (net). The times are shown by PopUp and the sunrise/sunset is saved in global variables as well.
Version 6 - fixed a bug (lat lon example not commented out), uploaded to sunriseset3.js (no right to delete the previous file)
Version 5 - (half)fixed (quick+dirty) the sunriseset.js (bug with at), uploaded to sunriseset2.js
Version 4 - works in Tasker v4 now, bugfix in JS (new file), bugfix in profile (new file)
Version 3 - added twilight times. Further DST fixes - please email me if this fails in your TZ.
Version 2 - corrected for Daylight Savings Time.
Version 1 - initial version.
The example profile will run once a day at 00:01 o'clock and set the variables %SUNSET and %SUNRISE to the appropriate times, it will show a PopUp with all times.
The script also returns the twilight times as follows:
%at_start Astronomical twilight start
%nt_start Nautical twilight start
%ct_start Civil twilight start
%ct_end Civil twilight start
%nt_end Nautical twilight start
%at_end Astronomical twilight start
Adapted from the NOAA Solar Calculator.