Follow

Looking for an API that lets me query the current (estimated) brightness (ideally in lux) for a given set of geo coordinates. Was hoping OpenWeatherMap would offer something like that... sadly not.

· · Web · 9 · 4 · 5

@fribbledom this would be the 1.0 of "i can geo-database now". download sat maps, process them, calc. love this challenge.

@fribbledom What would this take into account? Daylight + cloudiness, basically? Maybe precipitation/cloud, uh, density?

@fribbledom Interesting... Based on the sun or lights/cities?

@fribbledom @waglo My go to for stuff like this is Dark Sky: darksky.net/

They don't seem to have light level (though I haven't searched their entire API), but you might be able to use the UV Index as a proxy.

If you think about it, the UV index is already pretty close to what you want, as it takes both sunlight and cloud cover into account.

Alternately, you could calculate it from the predictable patterns of sunlight intensity and the more complex cloud cover data.

@urusan @fribbledom @waglo I’m alos a Darksky user for my #HomeAssistant setup but isn’t Darksky shutting down it’s API in the near future after their acquisition by #Apple?

@fribbledom Maybe something like this would be a way in?

solar.sheffield.ac.uk/pvlive/r

Pretty sure there's something similar for Germany though can't remember where I saw it. Dunno about anything more global but maybe there's something more real-time associated with this:

ec.europa.eu/jrc/en/pvgis

@fribbledom Redshift must have something for this in their code.

@bionade24
Does it do more than just calculate the time for sunset and sunrise?
As I understand Müsli, he wants the angle of the sun over/under the horizon, resulting sunlight intensity and proportion of light lost to cloud cover.
I saw a thing which did this except for cloud cover, but can't remember what and where...

Oooh, but the latest Blender release has a date/time-dependent daylight simulation environment -- maybe something useful in there?
@fribbledom

@fribbledom you could probably calculate that using the latitude, time of day, day of the year and cloudiness/air quality (if in a city) and get a reasonably accurate result.

@fribbledom Redshift and others use position to get the time.Then they make a timespan where it should be active and gradient the colour change over that span.With time of day and some date intelligence the brightness of daylight is calculateable IIRC

@fribbledom In the US we have "ASOS" weather systems at major airports. They all have an "ambient light sensor" used to calculate "runway visual range". If you get access to the raw data from the system, that should have what you want. Countries with developed airports should have similar data.
ncdc.noaa.gov/data-access/land
ncei.noaa.gov/data/global-hour
Many non-US weather systems also have a solar radiation sensor. Contact your national weather agency to find how to access their data.

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!