Closed spyderdsn closed 11 months ago
Hi @spyderdsn, thanks for pointing this out! I believe the weather parameters (the numerical values and the condition
) are all correct, but there's a bug in determining the suffix for the icon
field (-day
/-night
).
Note to self: Seems our daytime check currently does handle sunset being earlier than sunrise during the "UTC day" at a location. (Sydney's is UTC+10)
Icons should be fixed now :)
(side note @spyderdsn you can get timestamps in local time by adding &tz=Australia/Sydney
to the end of your request URL)
Hi @jdemaeyer,
The icons still return night readings early in the morning, now I have mix reading from the day or night.
Hm, not good, thanks for feedback! Could you maybe give me the URL of the request you're sending?
I've been using:
https://api.brightsky.dev/weather?lat=-33.867779&lon=151.207047&date=2023-08-18
since the one below returns 404
https://api.brightsky.dev/current_weather?lat=-33.867779&lon=151.207047
than I tried to filter out occurrences, I think than main problem is, the weather forecast for the day also includes loads of night.
Not sure why one endpoint works for given lat/long, other don't.
Maybe there is an issue with how you are converting the UTC timestamps to your local time? I unfortunately can't check the data from 2023-08-18 as that's too far in the past, but for tomorrow the records for 9:00 and 10:00 in Sydney (23:00 and 0:00 UTC) have the expected "day" icons:
{
"timestamp": "2023-08-18T23:00:00+00:00",
"source_id": 925,
"precipitation": 0,
"pressure_msl": 1016.6,
"sunshine": null,
"temperature": 11.8,
"wind_direction": 268,
"wind_speed": 27.8,
"cloud_cover": 14,
"dew_point": 0.8,
"relative_humidity": null,
"visibility": 34700,
"wind_gust_direction": null,
"wind_gust_speed": null,
"condition": "dry",
"precipitation_probability": null,
"precipitation_probability_6h": null,
"solar": null,
"icon": "clear-day"
},
{
"timestamp": "2023-08-19T00:00:00+00:00",
"source_id": 925,
"precipitation": 0,
"pressure_msl": 1016.9,
"sunshine": null,
"temperature": 13.2,
"wind_direction": 264,
"wind_speed": 27.8,
"cloud_cover": 15,
"dew_point": 0.7,
"relative_humidity": null,
"visibility": 33900,
"wind_gust_direction": null,
"wind_gust_speed": null,
"condition": "dry",
"precipitation_probability": null,
"precipitation_probability_6h": null,
"solar": null,
"icon": "clear-day"
}
You can also let Bright Sky convert the timestamps for you by adding &tz=Australia/Sydney
to the end of the URL.
Not sure why one endpoint works for given lat/long, other don't.
Bright Sky is built around data from Germany's meteorological service (DWD), which only publishes actual measurements from weather stations in Germany. The /current_weather
endpoint only uses actual measurements, hence why it gives you "no sources". The DWD's forecast model, which is included in the /weather
endpoint, contains world-wide data, though, so that one works for Sydney (but not into the past, and what you retrieve are not actual measurements but recent, one hour before-ish, forecasts).
Australia's Bureau of Meteorology publishes actual measurements on their homepage if you wanna check that out. If you click on a specific station there's a link to a JSON file at the bottom.
Closing but feel free to re-open. If the issue persists I'd be glad if you could post a request and the response :)
Hi, I'm in Australia and when I request the weather at 9am, the forecast returns with the night readings.