openWeatherMap : wrong temp_min and temp_max in daily weather widget

1,845 views
Skip to first unread message

Bobi R

unread,
Aug 1, 2015, 7:15:01 AM8/1/15
to Stalker Middleware
Hi,
we can use open weather map api in different ways
but the query that stalker use , return temp_min and temp_max.
as it says in openweather website:

Example of current weather API respond:
"main":{
"temp":306.15, //current temperature 
"pressure":1013,
"humidity":44,
"temp_min":306, //min current temperature in the city
"temp_max":306 //max current temperature in the city
},
For comparison look at example of daily forecast weather API respond:
"dt":1406080800,
"temp":{
        "day":297.77,  //daily averaged temperature
        "min":293.52, //daily min temperature
        "max":297.77, //daily max temperature
        "night":293.52, //night temperature
        "eve":297.77, //evening temperature
        "morn":297.77}, //morning temperature


and i want to fix this in daily weather widget to show correct daily min and max temp. but it was so hard and complicated for my skills.
can some one please help me ?

i guess we need to modify the openweathermap.class.php

 function normalizeWeatherData($content)

and the url query should be like this:
http://api.openweathermap.org/data/2.5/forecast/daily?q=london,uk&metric&cnt=1




Aleksey Zhurbitsky

unread,
Aug 20, 2015, 11:29:12 AM8/20/15
to Stalker Middleware
You want to display today min and max temperature in the main menu?

Bobi R

unread,
Aug 25, 2015, 11:28:16 PM8/25/15
to Stalker Middleware
Yes please , but as i mentioned , openweather has 2 kind of min & max
1- min and max during a 24 hours period
2- (the one you are using now, and i think it's not a good choice!!) min and max , at current time , BUT in different places of a city : for example if , at this current moment, in the north part of the city current  temperature is +10'c and in the south part of city current temperature is +12'c , then in daily forecast it shows  +10 ~ +12

but i think the right choice is to show the min and max during a complete day (24 hours)

Aleksey Zhurbitsky

unread,
Aug 26, 2015, 6:34:21 AM8/26/15
to Stalker Middleware
Try this patch https://gist.github.com/azhurb/ea322d7a12d944feb1d1
But we don't have plans to add this to the release version.

Bobi R

unread,
Aug 28, 2015, 7:37:43 PM8/28/15
to Stalker Middleware
Thank you very much , for caring about our request , and responding.
Your code is working and it adds a new line showing min & max temperature.
Just forget about this , cause my English is not good enough to explain the problem.

but if you want to know more , please read my first post again
this is the query that you are using :
This query that stalker is using for openweather map , does not have the min & max temperature during a day !!!
this just has the min & max at the current moment , but in different part of the city !!!
"temp_min":31, //min current temperature in the city
"temp_max":31 //max current temperature in the city
this means that , right now , EVERYWHERE the city , min & max is 31


but if we use this query :
http://api.openweathermap.org/data/2.5/forecast/daily?q=london,uk&metric&cnt=1
then we will have
        "min":29, //daily min temperature
        "max":36, //daily max temperature
29'c & 36'c : during a complete 24 hours day , the temperature will change between 29'c to 36'c

Aleksey Zhurbitsky

unread,
Aug 31, 2015, 8:39:23 AM8/31/15
to Stalker Middleware
We do not have information about daily min and max temperature in the database. You can modify code and change what you want.
Reply all
Reply to author
Forward
0 new messages