0 votes
by (160 points)

Re-built this after shelving the WeatherUnderground version I built many years ago.  Now working with OpenWeather except the values reported in Imperial are not correct.

For example, for city 5333180, and settings.h set to "IS_METRIC = false", the forecast is saying I'm going to get 11.89" of rain.  When "IS_METRIC = true", the forecast gives 11.89mm of rain.

Looking at the string returned from OpenWeatherMap, it looks like it is not giving me the right results for rain estimates.  Even when I compare the numbers for other weather field between metric and imperial, they don't compare.

Any idea what is going on?

Here's the metric query (my API blocked out) 


And one line of the forecast results

{"temp":7.83,"feels_like":5.87,"temp_min":7.83,"temp_max":7.83,"pressure":1011,"sea_level":1011,"grnd_level":1005,"humidity":91,"temp_kf":0},"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":{"all":100},"wind":{"speed":3.05,"deg":286,"gust":6.39},"visibility":7208,"pop":1,"rain":{"3h":11.89},"sys":{"pod":"d"},"dt_txt":"2023-02-25 00:00:00"},{"dt":1677294000,"main":
and here's the imperial query 
and the same line of forecast results
{"temp":46.09,"feels_like":42.57,"temp_min":46.09,"temp_max":46.09,"pressure":1011,"sea_level":1011,"grnd_level":1005,"humidity":91,"temp_kf":0},"weather":[{"id":501,"main":"Rain","description":"moderate rain","icon":"10d"}],"clouds":{"all":100},"wind":{"speed":6.82,"deg":286,"gust":14.29},"visibility":7208,"pop":1,"rain":{"3h":11.89},"sys":{"pod":"d"},"dt_txt":"2023-02-25 00:00:00"},{"dt":1677294000,"main":

So the rain in both is 11.89, wind speed and gust in metric results is less than half that of Imperial, which isn't right either. 

Anyone know what's going on?  Is there a setting I need to make in my OpenWeatherMap account?

by (160 points)
OpenWeatherMap is to blame - even on their webpage, when I toggle between metric and imperial, the rain estimate remains as metric.
by (160 points)
And this morning, it's flipped.  Now the API is returning Imperial units for the rain, no matter if I ask for Imperial or Metric.  The temp and wind speed changes though.  

The website still only reports rain estimates in metric though.  So weird.
Here's what I get when I ask for metric answers ""pop":0.81,"rain":{"3h":0.47}"
and here it is for imperial  ""pop":0.81,"rain":{"3h":0.47}"

1 Answer

0 votes
by (160 points)

I received an email from OpenWeatherMap Tech Support, and they confirm they only send the rain amount estimate in one format - metric.

Which doesn't quite make sense for what I'm seeing come back after an API call, but I'll code the Color Weather code to translate it to inches anyways and see if it tracks better to reality.


Thank you for reaching out. My name is Viacheslav. I will gladly assist with your request.

Yes, we are not currently recalculating rain data in imperial values. This data is provided in only one format.

If you have further questions, don't hesitate to ask!

Viacheslav Verbytskyi
Technical Support Specialist
London, UK

Welcome to ThingPulse Q&A, where you can ask questions and receive answers from other members of the community.