A1: Get Location [
Source: Net
Timeout (Seconds): 30 ]

A2: Variable Set [
Name: %location
To: %LOCN
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]

A3: Variable Set [
Name: %location
To: ,
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]

A4: Variable Set [
Name: %request_para
To: &lat=%location(1)&lng=%location(2)
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]

A5: HTTP Request [
Method: GET
URL: https://api.sunrise-sunset.org/json?%request_para&formatted=0
Timeout (Seconds): 30
Structure Output (JSON, etc): On ]

A6: JavaScriptlet [
Code: const json = JSON.parse(http_data);
var sunrise = json.results.sunrise;
var sunset = json.results.sunset;

var rise_hours = sunrise.substring(11,13)-15;
var rise_minutes = sunrise.substring(14,16);
var set_hours = sunset.substring(11,13)-15+24;
var set_minutes = sunset.substring(14,16);
var sunrise = rise_hours +":"+rise_minutes;
var sunset = set_hours + ":" + set_minutes;
Auto Exit: On
Timeout (Seconds): 45 ]

A7: Variable Set [
Name: %Sunrise
To: %sunrise
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]

A8: Variable Set [
Name: %Sunset
To: %sunset
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]

A9: Flash [
Text: %Sunrise
%Sunset
Continue Task Immediately: On
Dismiss On Click: On ]