Node-red-contrib-nighttime. Need to provide GPS Day or Night node via JSON

I am using node-red-contrib-nighttime and currently I am typing LAT & LONG manualy.
I need to make it autonomous so I am getting coordinates from on line service.
Day_or_Night node says it can get LAT/LONG data from location service.
"lat and long will autofill if you allowed location service."
But I am finding problems on how to make it work in my Raspberry Pi, not even ChatGPT is provinding something that works.
Assistance wellcome.

What is it you are trying to achieve? What is the overall goal?

It may be you simply need something like node-red contrib-Cron-plus to emit a message when it is sunset or dusk?

Or you could send a message with coordinates to the cron plus node and it will tell you the phase of the Sun and whether it is day or night.

Note this would be 100% local. No need for calls to external web services.

1 Like

I don't know of node-red contrib-Cron-plus.
But the objetive is simple, to switch on lights of some lamps when it darkens in my region, switch some when it is 22:00hs and some when the sun comes up in the morning.
So far it works well typing my GPS coordinates in this Day_or_Night node but I want it to be autonomous but the Day_or_Night node has no input and it says as explained above that it can get these coordinates from this "location service" that sounds like something I have to setup in my Raspberry Pi system.
I have GPS coordinates in JSON format from the internet to provide to this "location service" I just have no idea how to do it.
Day_or_Night is simple and outputs true for night and false for day, that all I need.
Thanks

It is over six years since it has been updated.

It uses the suncalc library. Which you could use yourself in a function node instead. Using a public coordinates lookup API to get a rough position. If you want an exact position, GPS sensors exist that could work with a Pi or an ESP/Arduino device.

Personally, I use node-red-contrib-suncalc - not sure but I think you can feed it coordinates.

1 Like

Just had a look.
It seems it can do the job.
Will try.
Thanks a lot.

I need to feed LAT/LONG dinamicaly.
Thanks

Why? Are you doing something similar to a location tracking phone app?

No, but I intend to ship the device to places for testing and would like to avoid people entering GPS coodinates.