Capture Sunset and Surise Time in Ignition

How can I capture Sunset and Sunrise Time in Perspective ignition ?
Can you provide me some direction?

You could use system.net.httpClient to get these values from an online API. One example: Sunset and sunrise times API - Sunrise-Sunset.org.

You could also do the calculations yourself: ESRL Global Monitoring Laboratory - Global Radiation and Aerosols

2 Likes

There are very good resources from the NOAA organisation https://www.noaa.gov/ but I couldnt find the specific links so you will need to search further.
In the past I found sample spreadsheets (NOAA_Solar_Calculations_day.xls) for the relevant calculations for the Equation Of Time. Using the sample spreadsheets you can change the parameters and it will give various solar time calculation results, then you can implement the same equations in python to be able to use within any Ignition project driven by parameters for lat/long, TZ and date.
This link may help
GitHub - porrey/Solar-Calculator: Calculates the sunrise and sunset for a given date and location (using GEO coordinates). This library uses the method outlined NOAA Solar Calculations Day spreadsheet found at http://www.esrl.noaa.gov/gmd/grad/solcalc/calcdetails.html.

1 Like