Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Sunrise/set in CumulusUtils

Discussion of the Cumulusutils tool and website generator.

Moderator: HansR

Post Reply
mingjen
Posts: 35
Joined: Wed 21 Dec 2011 3:40 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10
Location: Fyn, Denmark
Contact:

Sunrise/set in CumulusUtils

Post by mingjen »

Hi.
I have a problem with sunrise and sunset in CU utils. I think I have got mixed something between my site in Denmark and Spain so that the sunrise/set for Spain are shown in my site for Denmark. If I look at the data in CUtags.php it is the correct data.
Can anyone tell me how the sunrise/set are set in CUMX utils?
https://mingjen.net/odense
Davis Vantage Pro2 weather station
CumulusMX
User avatar
HansR
Posts: 5871
Joined: Sat 20 Oct 2012 6:53 am
Weather Station: GW1100 (WS80/WH40)
Operating System: Raspberry OS/Bullseye
Location: Wagenborgen (NL)
Contact:

Re: Sunrise/set in CumulusUtils

Post by HansR »

To be honest, this is quite astonishing and it had been some time since I created the code so I had to take a deep dive, but I think I can explain.

The sun disc is created at startup or refresh of the page.
The sun and moon values (moon is also the same on both sites!) are calculated with the help of the Suncalc library (see About=>license).
The suncalc takes date, latitude and longitude as arguments in a function to get all sun-event times including sunrise and sunset.
Latitude and Longitude are taken from the Cumulus.ini file at compile time.

So in my view, it can only be mixed up if you shared the cumulusutils.js library file between the sites.
Generated files are not interchangeable between sites, they contain site specific data.

Hope this clarifies a bit (and I hope I am right otherwise I don't know at the moment).
Let me know how you get on.
Hans

https://meteo-wagenborgen.nl
CMX build 4017+ ● RPi 3B+ ● Raspbian Linux 6.1.21-v7+ armv7l ● dotnet 8.0.3
mingjen
Posts: 35
Joined: Wed 21 Dec 2011 3:40 pm
Weather Station: Davis Vantage Pro2
Operating System: Windows 10
Location: Fyn, Denmark
Contact:

Re: Sunrise/set in CumulusUtils

Post by mingjen »

Thank you. You solwed the problem. 👍 It was the cumulusutils.js. It went wrong when I updated some days ago. I have to keep the two sites seperate😊
https://mingjen.net/odense
Davis Vantage Pro2 weather station
CumulusMX
Post Reply