Beginner trying to get Barometric Pressure binding from yahoo

This is my first post for help, i am very new . . . but very interested in OpenHAB.

I have the item copied from the wiki and many others but i get a response of 984 inches and not more like 29.1 that i am expecting. Is there a conversion that I am missing?

In my items I have:
Number Weather_Pressure “Barometric Pressure [%.2f in]” { weather=“locationId=home, type=atmosphere, property=pressure, unit=inches” }

Thanks in advance,

~Chris

It looks like Yahoo weather is not delivering the correct information lately:

Yahoo is currently returning the pressure in millibars (hectoPascals), even though the response says the units are in Inches of mercury (inHg). You can confirm this on their developer page: https://developer.yahoo.com/weather/

You can convert the units by dividing by 33.86.

3 Likes

Thanks! now I just need to learn how to do the math in this . . .do you know of any good examples that show were all the parts and pieces go. I tried a rule with Weather_Pressure = Weather_Pressure / 33.86 and that was a bust.

You could have these items:

Number Weather_Pressure_hPa "Barometric Pressure [%.2f hPa]" { weather="locationId=home, type=atmosphere, property=pressure, unit=inches" }
Number Weather_Pressure_in "Barometric Pressure [%.2f in]"

and this rule (not tested):

import org.openhab.core.library.types.DecimalType // not needed in OH2

rule CorrectPressure
when
  Item Weather_Pressure_hPa changed
then
  Weather_Pressure_in.postUpdate((Weather_Pressure_hPa.state as DecimalType) / 33.86)
end

Thanks!!! I got it and it looks much better. i am getting this and your help here went a long way. Thanks again.

1 Like