Sunrise and Sunset - injecting current position

I have NR installed on a WYSE3040 in my Motorhome. I have also used several Nodes to get Sunrise and other Astronomical events. All of these nodes ask me to put my current position, which is fine for home, I get the Lat and Long from a map and input them, no problem.

My problem is that the Motorhome moves and I need/(would like) to put in my Lat and Long for each position I am at to get accurate times. This is a pain, especially when I can get the Lat and Long from my Router, which has a GPS Module and, along with MQTT, gives me my current position.

I have looked, but I can't see if this injection of current position is possible with any of the available Nodes, unless of course, anyone knows different and can help me figure it out.

TIA,
Colin J

I think, looking at its help panel, that CRON+ lets you set that via input msg which would probably be the first step?

Yup:
image

I think you use a dynamic schedule. There is some example JSON shown towards the end of the help panel.

Also see the solar events example in the library that you can import.

Thanks Julian, I will investigate.

I thought that CRON+ was the most likely, but couldn't see the wood as there are many, many trees!! I must admit, it is my goto when looking for times and events!!

The cron plus node has example flows you can import.

The "Solar events" flow includes the sunrise time of two places whose latitude and longitude are passed in as msg.payload.location.

Got it! Thank you.

I have been looking at all of these Nodes and just couldn't see how to do it. Seemed I could change everything other than location!

Not to step on Paul's solution.

I did this on an Arduino project a long time ago.
I can't find THE code - shame on me.

But a quick dig on the internet I get this:

I think you're probably remembering the Sunrise Equation in its most compact form. 
Many implementations boil the entire calculation down to a single equation that returns the hour angle, and then convert that directly to minutes after midnight.

A very common version is:

cosω=
cosϕcosδ
sin(−0.833
∘
)−sinϕsinδ
	​


where:

ϕ = latitude
δ = solar declination for the date
ω = hour angle

Then:

sunrise = 720 - 4(longitude + ω°) - E
sunset  = 720 - 4(longitude - ω°) - E

where:

longitude is in degrees (east positive)
E is the Equation of Time (minutes)
the result is minutes after midnight UTC.

Notice how compact that is: once you know δ and E for the day, it's literally just two formulas.

You receive the lat/long from the GPS and just plug the numbers into this formula.