Yahoo weather binding doesn't deliver metric values and °C

Currently the unchanged openHAB v1.8.1 weather configuration delivers Fahrenheit values instead of °C.

The request

query.yahooapis.com/v1/public/yql?format=json&q=SELECT * FROM weather.forecast WHERE u='c' AND woeid='703274

and also

select * from weather.forecast where u='c' AND woeid in (select woeid from geo.places(1) where text="waiblingen")

on Yahoo Weather API don’t deliver metric values but

{"distance":"mi","pressure":"in","speed":"mph","temperature":"F"}

Therefore it seems to be warmer outside than it is :wink:

Yes, since yesterday. Does someone why?

I thought I was going crazy and changed and item and broke my weather GUI’s… I think @rlkoshak might have mentioned something in this post here: Weather - Yahoo - Bad Request

I have no idea how to switch this back to C from F unfortunately.

Did this get fixed overnight for you?

Magically this fixed itself yesterday evening. :wink: Likely something from Yahoo.

1 Like

Yes, temperature is correct now.
But the pressure is too high:

"atmosphere":{...,"pressure":"33017.30",...

should be in millibar:

"units":{"distance":"km","pressure":"mb"...

It looks like Yahoo is working on a 1st April gimmick :jack_o_lantern:

1 Like

I am experiencing the same. Are you saying, that this is a bug within Yahoo and not within the weather add-on?

Hi Florian,
sorry, for my late answer. I’v just tried Yahoo api again with following requests. With imperial units the pressure looks correct. But with metric ones (initialized with ‘c’ for Celsius) it’s still wrong as 2 years ago:
<http://query.yahooapis.com/v1/public/yql?format=json&q=SELECT * FROM weather.forecast WHERE u=‘f’ AND woeid=‘703274’>
-> pressure “977.0”
<http://query.yahooapis.com/v1/public/yql?format=json&q=SELECT * FROM weather.forecast WHERE u=‘c’ AND woeid=‘703274’>
-> pressure “33085.03”
Therefor weather-add on is correct but the response from Yahoo isn’t :frowning:

openHAB 2.3 provides unit conversion. I have defined the air pressure as follows:

Number:Pressure Weather_Pressure “Air Pressure [%.0f inHg]” {weather=“locationId=home, type=atmosphere, property=pressure”}

My log shows Weather_Pressure changed from 32543.21 hPa to 32543.21 inHg.

In my sitemap, I have defined the following line:

Text item=Weather_Pressure label=“Air Pressure [%.0f hPa]”

This yields a value 1102039, which is still way off the charts. However, apparently a unit conversion has been performed. I conclude, that the input value is not provided in inches mercury. Any idea, which unit is used by yahoo Weather and which abbreviation has to be used within the square brackets in the items file?

Cheers, Florian.

I have no idea how Yahoo calculates the metric pressure value now. I tried some conversions but didn’t find a satisfying solution.
Maybe with a larger number of values a formula could be determined to get a more or less realistic pressure in hPa.